How to Delete RAID Signature from a Hard Drive

I wished to remove the RAID signature which had been imprinted on a hard drive.

Having taken a hard drive out of a mirror array and trialled in another server, the characteristics of this other raid array were imprinted on the drive.

When the drive was added back into the original array there was an error message related to a drive having been put into the array in a different order:

Drive positions appear to have changed. Run Drive Array Advanced Diagnostics if previous positions are unknown.

This error highlighted that the drive was no longer stamped with the correct information for the RAID array and its position therein.

To accept the drive back into the array I wished to remove the existing RAID information signature.

I opted to use Linux to perform this operation as I have generally found Linux commands easier to run from the command line to perform this type of action – a personal preference and familiarity.

To perform the action I chose to use the command wipefs.

Wipefs will delete the operating system and RAID array which has been stored at the start of a hard drive.

I put the hard drive into a spare computer, being careful to ensure that the computer would boot from its existing boot drive, not the newly added RAID drive.

Begin by getting a list of drives:

lsblk

which will give a result similar to:

NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
 sda      8:0    0 447.1G  0 disk 
 ├─sda1   8:1    0   512M  0 part /boot/efi
 ├─sda2   8:2    0 439.2G  0 part /
 └─sda3   8:3    0   7.5G  0 part [SWAP]
 sdb      8:16   0   1.8T  0 disk 
 ├─sdb1   8:17   0   128M  0 part 
 └─sdb2   8:18   0   1.8T  0 part 

For more information about the drives use the output parameter to define the columns of information.

lsblk -o name,uuid

For example output is:

NAME   UUID
 sda    
 ├─sda1 5A6C-1ABD
 ├─sda2 12345678-AABB-CCDD-3344-123456789AAC
 └─sda3 23456789-1122-EEFF-5566-23456789ABCD
 sdb    
 ├─sdb1 
 └─sdb2 1122334455667788

Here it can be seen the listing of the devices connected to the computer. For me it was clear that the device sdb was the one I was interested in.

The drive which we wish to remove the RAID imprint is showing as /dev/sdb in the above listing.

The command which I chose to use is wipefs

I found that it was already installed on the computer. It is a part of the Debian package called util-linux. To install run the command:

apt-get install util-linux

Run wipefs command as follows:

wipefs /dev/sdb -n

Using the -n parameter to have no effect until ready.

wipefs -n –all –backup /dev/sdb

/dev/sdb: 8 bytes were erased at offset 0x00000200 (gpt): 23 78 12 45 23 98 12 62
/dev/sdb: 2 bytes were erased at offset 0x000001fe (PMBR): 78 cd
/dev/sdb: calling ioctl to re-read partition table: Success

Do take care when running this command to ensure that its the correct drive which has been chosen to be referenced.

This will render the information stored on the drive inoperable, unavailable and deleted.

Can now restore the drive to the RAID array to be incorporated.

Signature backup

A backup of the signature can be made using the –backup parameter

wipefs –all –backup /dev/sdb

In the above example the removal of the signatures still occurs, but with the addition of –backup a copy of the signatures will be saved within the current users directory.

Naming of the backup file for each signature is:

wipefs-sdb-<offset>.bak.

For example

wipefs-sdb-0x000002fe.bak
wipefs-sdb-0x00000300.bak

References

https://linux.die.net/man/8/wipefs

http://manpages.ubuntu.com/manpages/bionic/man8/wipefs.8.html