5

I have an un-partitioned 500GB disk with a ext3 fs using the entire disk.

If I make sure there are no partitions on the disk using fdisk or parted, "ssm list" will still show an ext3 fs on the disk (because this file system exists outside of any partitions"

I am also still able to mount the fs and use it.

How can I remove any reference to this filesystem?

I'm using centos7 and there is no data on the disk that I want to keep. The server is running in a VM, I could just add a new disk to it, but I want to know how to do it.

5

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.

  • This is what I went with in the end, sledgehammer! I wondered if there was a "proper" way to do it – Dan P Jan 25 '16 at 13:58
  • I suppose you would have to dissect ssm to figure out how it checks for valid file-systems. Maybe it looks for the 1st superblock? Once you find that, you'd have to either remove it manually, or write a small utility to do this for you. Alternatively... the sledgehammer always works :-) – garethTheRed Jan 25 '16 at 14:04
2

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.