Delete all partitions of USB key

By xngo on February 21, 2019

# Assuming your USB device is /dev/sdX
dd if=/dev/zero of=/dev/sdX bs=1k count=2048
sync
partprobe /dev/sdX
 
# sync: To commit buffer cache to disk
# partprobe: To re-read partition table without rebooting. Otherwise, reboot.

About the author

Xuan Ngo is the founder of OpenWritings.net. He currently lives in Montreal, Canada. He loves to write about programming and open source subjects.