I have three HDDs that I pulled from an old server. Couldn't remember what was on it or how it was configured until I stuck it into my new server to use for RAID5. I dd
'ed all three hard drives and tried to mdadm --create
a new RAID array and got the following error:
mdadm --create /dev/md0 --level=5 --raid-devices=3 /dev/sdb /dev/sdc /dev/sdd
mdadm: super1.x cannot open /dev/sdc: Device or resource busy
mdadm: /dev/sdc is not suitable for this array.
mdadm: create aborted
Looking into the problem I found out that /dev/sdc2
still contains a logical volume.
# lsblk /dev/sdc
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sdc 8:32 0 931.5G 0 disk
|-sdc1 8:33 0 102M 0 part
`-sdc2 8:34 0 931.4G 0 part
|-VolGroup00-LogVol00 253:2 0 926G 0 lvm
`-VolGroup00-LogVol01 253:3 0 5.4G 0 lvm
# lsblk /dev/sdd
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sdd 8:48 0 931.5G 0 disk
|-sdd1 8:49 0 2G 0 part
`-sdd2 8:50 0 929.5G 0 part
# lsblk /dev/sdb
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sdb 8:16 0 931.5G 0 disk
|-sdb1 8:17 0 2G 0 part
`-sdb2 8:18 0 929.5G 0 part
I tried lvremove
pvremove
and vgremove
but all return with the same error: Incorrect metadata area header checksum on /dev/sdc2 at offset 4096
I am unfamiliar with LVM and tried to look online on what to do. Did a recovery but did not work not to my surprise since the vg
file archive I used was generated on my new server.
My guess is that because I dd
'ed the HDDs I somehow messed up the header metadata. What can I do to wipe all this so that I can create my RAID5? Any help would be much appreciated.
Thanks in advance!
EDIT
To clarify what I mean by dd
'ed:
dd if=/dev/zero | pv | dd of=/dev/sdx
EDIT 2
Just to clarify what helped and give credit to both answers. Both answers below with regards to dd
work. In my case, since the RAID was built on a different box, and I orphaned one of the drives, my new box was complaining about the volume group and such. When I used dd
initially to wipe the data I must not have touch the headers for the RAID/LVM.