dd: No Space Left on Device

After running dd for a long time, it stops with an error saying no space is left on the device.

9624 views

Edited: 2019-06-16 09:45

If you do not limit dd via count, it will continue writing data to the disk until it runs out of space.

dd: error writing '/dev/sdb': No space left on device

This error most likely means that the dd command completed writing to a disk, such as when you try to wipe a disk by writing zeros or random data to the disk. You do not need to do anything at this point.

dd ignores any partitions on the disk, and simply writes until the specified end has been reached, or until the end of the disk in case no end is provided. You can limit the number of blocks to write via the count value.

Command:

dd if=/dev/zero of=/dev/sdb bs=1M

The bs part stands for block size. It is recommended to leave this at 1M unless you know the optimal block size for your hard disk.

If you for some reason need to use the count parameter, simply multiply the block size to reach the desired length. A count of 100 in this case would result in 100 megabytes:

dd if=/dev/zero of=/dev/sdb bs=1M count=100

Tell us what you think:

  1. How to use the rm command to delete files and directories in Linux.
  2. How to use the ls command in linux to list files and directories.
  3. How to move files or directories using the mv command in Linux.
  4. How to use 7zip to make and extract archives from terminal.
  5. How to change directories using the terminal in Linux.

More in: Linux Commands