0

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.

4

2 回答 2

2

只要您不关心 /dev/sdc 驱动器上的内容,请尝试以下操作:

dd if=/dev/zero of=/dev/sdc bs=1m count=10

这会将磁盘的前 10 MB 清零,包括任何 LVM 或 RAID 标头。然后重启;系统应该看到该磁盘不再是任何 LVM 组的一部分。

如果您需要更多灵感,请查看我写的关于恢复 RAID 和 LVM 卷的这篇 Linux Journal 文章:

http://www.linuxjournal.com/article/8874

于 2015-02-09T23:56:37.183 回答
1

这是一个很棒的链接-如果您不熟悉它,请看一下:

在您的情况下,请尝试以下操作:

https://forums.opensuse.org/showthread.php/489778-How-do-I-delete-a-RAID-volume-that-was-created-with-mdadm

  1. 找到 md 及其组件(sda、sdb 等)

    fdisk -l mdadm --detail /dev/md0 or md1 or mdX

  2. 卸载 md(最好使用 -l 标志进行延迟卸载

    umount -l /dev/md0

  3. 停止数组

    mdadm --stop /dev/md0

  4. 将 md 数组中每个设备的超级块归零

    mdadm --zero-superblock /dev/sda mdadm --zero-superblock /dev/sdX ... etc.

根据需要替换您的实际驱动器名称。

我不确定“dd'ed all drive”是什么意思,但是您应该能够使用“mdadm”(如上所述)或“dd”来初始化它们:EXAMPLE: dd if=/dev/zero of=/dev/sdc2 bs=1024K count=100

另请参阅此链接以获取更多提示:

于 2015-02-09T23:57:51.703 回答