Remove filesystem from an unpartitioned disk
An alternative to scrubbing all the data is to use the wipefs
utility from the util-linux
package. Run it without arguments to list the signatures found on the device:
# wipefs /dev/sdb
offset type
----------------------------------------------------------------
0x0 xfs [filesystem]
UUID: 72f2a607-8af7-44c0-83c2-f1565cd68a1a
Then run it with -a
to erase those signatures:
# wipefs -a /dev/sdb
/dev/sdb: 4 bytes were erased at offset 0x00000000 (xfs): 58 46 53 42
# wipefs /dev/sdb
#
This will not delete your data. It'll just remove the filesystem headers so that it's not mountable.
One easy (and heavy handed) way to do this would be to wipe the whole contents of the disk. The simplest way to do that would be to use dd
:
$ sudo dd if=/dev/zero of=/dev/<disk> bs=1M count=500000
By the time the command ends (maybe an hour?) your whole disk will be filled with zeros.
If you're in a rush, you could kill the process with Ctl+C after a few seconds/minutes to see if you've wiped enough data for the disk to be considered as blank.