2

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/

Michael
  • 468
  • 2
  • 13
  • Are you using partitions or full disks for array members? – Shane Madden Mar 13 '12 at 01:26
  • What are your `mdadm` version numbers? Is your Gentoo install 64-bit? Output of `mdadm -D /dev/md0`? – Andrew Mar 13 '12 at 05:32
  • Full disks for array members. Both are 64-bit. I'll have to check on versions. `mdadm -D /dev/md0` from Ubuntu: http://pastebin.com/5gj2QNkV – Michael Mar 13 '12 at 15:19
  • You could post more context (log) for the "invalid superblock magic" since that could either be the raid superblock or somehow a filesystem superblock. – Mark Wagner Mar 15 '12 at 20:29
  • I've added relevant `dmesg` and `fdisk` output. – Michael Mar 15 '12 at 20:55
  • Kernel raid auto-detection doesn't work for >=1.0 superblocks. Those messages are harmless and you should not enable it. – Mark Wagner Mar 15 '12 at 21:16
  • Would recompiling with auto-detection disabled solve my problem? Or is it just a harmless red-herring? – Michael Mar 16 '12 at 00:58
  • I got it working. I disabled auto-detection and noticed that I hadn't added support for RAID 5. Ended up being much simpler than I thought. Mark, I said the bounty would be given for help, not necessarily a direct answer; if you submit an actual answer I will select it and give you the bounty. – Michael Mar 16 '12 at 06:42

2 Answers2

4

The renaming of software raid devices is something unproblematic (here from md0 to md127). I've seen this over the last years and you shouldn't worry about it.

But your were totally right to ask about the auto-assembly warnings. Here, the devil lies in the details. In dmesg you see it's trying to find mdadm 0.90c superblocks (the old ones). It fails and it does naturally fail, because your volume is formatted using version 1.2 metadata. No problem here too.

See man 8 mdadm about which metadata format you have as default on Ubuntu and Gentoo. I would guess even if it's not in the manpages, that you run different kernel configs concerning soft raid (see "Multiple Devices" in make menuconfig).

So, in my experience of around eight years with mdadm/soft raid with linux, you are good to go. No reason to worry, besides getting a more current kernel :-)

EDIT: Also, dont worry about your array being corrupt. You can clearly see from your status pastes, that its just fine, as one would expect.

Do you have further questions on the matter?

Peter Meyer
  • 440
  • 1
  • 4
  • 12
1

Re-posted:

Kernel raid auto-detection doesn't work for >=1.0 superblocks. Those messages are harmless and you should not enable it.

Mark Wagner
  • 17,764
  • 2
  • 30
  • 47