0

Im using linux debian and tried to use this command sudo dd if=/dev/zero of=/dev/sdb on a usb drive, but I accidentally typed /devsdb whithout / char, and suddenly the OS turned of. As I turn it on it just shows a black screen with some startup text.

How can I correct this, or at least access drives from somewhere like grub to dd an iso file to a usb drive and install an OS again.

  • 11
    You've possibly just filled up the / partition. Boot into rescue mode (or equivalent single-user mode), remove the new file /devsdb and reboot. – Kusalananda Jan 24 at 15:59
  • 3
    Please invest some time writing future questions. e.g. "some text" is to avoid. – Rui F Ribeiro Jan 24 at 17:50
  • @RuiFRibeiro i mentioned it in the question,i wrote it on phone. – Faramarz Jan 25 at 9:21
3

Summarising what has been said in comments, with additional info:

When you ran

sudo dd if=/dev/zero of=/devsdb

you created a file in your / partition called devsdb. The command, if not terminated in time, would continue to run until the partition is totally filled up. Since the command was run as root, it would additionally fill up the small safety space that is usually reserved to allow the system to function somewhat normally (about 10% of the partition size, most of the time). This may well have had an adverse effect on your system.

To fix this, I suggested booting the machine into single-user mode (or "rescue mode", or similar) to be able to mount the / partition and delete the oversized file.

Your command is unlikely to have caused any other damage than accidentally filling up the partition, so removing this file (and rebooting) should be the only action necessary to fix this issue.

0

Luckily, there is no data lost. The OS can not start correctly because the root partition is out of space. To resolve the situation, boot with a Live CD and delete the /devsdb file.

  • 1
    This answer was very short and not particularly clear so I've edited to improve it slightly. Ideally, answers should be more comprehensive. See How to Answer. – Anthony Geoghegan Jan 25 at 12:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.