2

I am using the dd command to erase a pen drive with this:
sudo dd if=/dev/zero of=/dev/sdd bs=4k && sync
where /dev/sdd is the designated device.

The pen drive is 16GB in size and this process takes a very long time.
Using dd, is there a way to speed up the erasure process?

  • Do you really need to erase the drive? Maybe "quick format" is enough for you. – David Foerster Jan 19 '16 at 19:50
  • Even with bs=1M, you can also add status=progress and you will see it still takes a long time. It was much faster with GParted: https://superuser.com/questions/1758221/how-to-format-a-usb-stick-with-gparted-under-linux-so-it-shows-up-on-a-mac – baptx Feb 21 '24 at 22:33

2 Answers2

3

You can set the blocksize to 1M. That is way faster.

sudo dd if=/dev/zero of=/dev/sdd bs=1M && sync

Kev Inski
  • 1,021
2

You can not make "dd" go quicker. The quickest method to clear the partition will probably be through fdisk

sudo fdisk /dev/sdd

  • do take care to pick the correct device: try to match some info (like the size) with what you believe it to be.
  • "p" to list the partition table
  • "d {number}" to delete it
  • "w" writes the partition table back to the disk
  • "q" quits
  • ("m" for help)

Mind though that this probably means the data will no longer be shown but is still on the pendrive (as it only will recreate the partition table). So if this pendrive is suppose to be used by someone else: stick to "dd" or a formatting tool.

Rinzwind
  • 299,756