M HYPE SPLASH
// updates

Are wipefs -af and mdadm --zero-superblock equivalent for erasing raid metadata?

By Emma Terry

I saw instructions about how to remove software raid, and some of them contain both instructions: wipefs -af <device> and mdadm --zero-superblock --force <device>.

Is it neccesary to use both? How do they differ in result?

Here I have raid made of /dev/sda3 and /dev/sdb3. I have made a small test, and it looks like result is the same.

machine1:~# wipefs /dev/sda3 # <-- see the signature on sda3
offset type
----------------------------------------------------------------
0x1000 linux_raid_member [raid] LABEL: machine1:md_system UUID: 54f255a8-c32d-2a67-f728-151f89a7471b
machine1:~# wipefs -af /dev/sda3 # <-- wipe signature using wipefs
/dev/sda3: 4 bytes were erased at offset 0x00001000 (linux_raid_member): fc 4e 2b a9
machine1:~# wipefs /dev/sda3 # <-- as you can see, signature was erased
machine1:~#
machine1:~# wipefs /dev/sdb3 # <-- see signature on sdb3
offset type
----------------------------------------------------------------
0x1000 linux_raid_member [raid] LABEL: machine1:md_system UUID: 54f255a8-c32d-2a67-f728-151f89a7471b
machine1:~# mdadm --misc --zero-superblock --force /dev/sdb3 # <-- wipe signature using mdadm
machine1:~# wipefs /dev/sdb3 # <-- as you can see, signature was also erased
machine1:~# 

1 Answer

Both instructions lead to zero-ing the superblock, that means deleting the signature of the filesystem which is here the metadata about the RAID.

2

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

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