Move an existing RAID 5 array from Ubuntu to Gentoo

Posted by Cocoabean on Server Fault See other posts from Server Fault or by Cocoabean
Published on 2012-03-12T23:50:20Z Indexed on 2012/03/19 18:07 UTC
Read the original article Hit count: 358

Filed under:
|
|
|

I have a 64-bit Ubuntu machine with a 4-disk RAID 5 using software raid (md). I've been able to boot an Ubuntu LiveCD and recognize the array with a simple mdadm -A /dev/md0. It was easy to mount after that and nothing had to rebuild.

I'm installing Gentoo on this box now (multi-boot, non-RAID root partition) and I have md auto-detect turned on in the kernel. When I boot Gentoo I get: "invalid superblock magic on sdd" for each of the drives in the array. I boot back to Ubuntu and they mount no problem.

I tried copying the mdadm.conf that works in Ubuntu to Gentoo, and then ran mdadm -A /dev/md0 but it reports that there is no array named md0.

I don't want to lose data (obviously) and I don't want to have to let the RAID rebuild every time I switch between OSes. Any help is appreciated.

Both are using mdadm 3.1.4

Both are running 64-bit kernels.

mdadm -D /dev/md0 from Ubuntu yields: http://pastebin.com/5gj2QNkV

UPDATE: After rebooting I noticed that it still complains about invalid blocks, but cat /proc/mdstat shows an inactive /dev/md127 with the same disks as my raid. I want to mount it but I don't want to get stuck waiting for a rebuild or destroying it inadvertently. mdadm -D /dev/md127 Here is pastebin of mdadm -D /dev/md127 on gentoo: http://pastebin.com/gDCWn0Rn

UPDATE II:

dmesg output about 'invalid raid superblocks' http://paste.ubuntu.com/885471/

fdisk -l from Ubuntu, /dev/md0 does not have any partitions but I do have it mounted and accessible: http://paste.ubuntu.com/885475/

© Server Fault or respective owner

Related posts about raid

Related posts about mdadm