Home Wiping a disk on Linux
Post
Cancel

Wiping a disk on Linux

Sometimes disks have data or meta data on them that prevents them from being used. This command will wipe the disk completely.

1
wipefs -fa /dev/sd?

Sometimes even this fails. Try this:

1
2
3
4
sgdisk --zap-all /dev/sdx
readlink /sys/block/sdx
echo 1 > /sys/block/sdx/device/delete
echo "- - -" > /sys/class/scsi_host/host5/scan
This post is licensed under CC BY 4.0 by the author.