6

i've setup a 4-drive RAID-10 array using mdadm-managed, software-raid on an x86_64 box.

it'd up & running and works as expected,

cat /proc/mdstat
    md127 : active raid10 sdc2[2] sdd2[3] sda2[0] sdb2[1]
          1951397888 blocks super 1.2 512K chunks 2 far-copies [4/4] [UUUU]
          bitmap: 9/466 pages [36KB], 2048KB chunk

atm the four SATA drives are physically plugged into the motherboard's 1st four SATA ports.

i'd like to gather the necessary/complete info for catastrophic recovery. reading starting here, http://neil.brown.name/blog, and the mailing list, i'm not yet completely confident i have it right.

i understand 'drive order matters'. is that logical, &/or physical order that matters?

if i unplugged the four drives in this array, and plugged them each back into different ports on the motherboard or a pci card, as long as i've changed nothing in software config, will the array correctly auto-re-assemble?

  • 1
    yes, it will reassemble correctly. that's one of the things written in the metadata ... – Fox Mar 19 '12 at 21:46
  • @Fox, you should add that as an answer. – Zoredache Mar 19 '12 at 21:51
  • @Fox i think that's good news. so, iiuc, as long as the metadata is *preserved* i can plug the four drives in any physical order, and any four ports, and they'll reassemble correctly. clearly, then, that metadata needs to be backed up correctly, along with LVM data, partition maps, etc. can you recommend a documentation reference for the steps/procedure for RAID-10 backup & restore? there's scads of info out here -- i'm sifting through the 99% that's dicey, looking for the 'right' 1% –  Mar 19 '12 at 22:25
  • @locuse: interesting question ... i'm not aware of any way of backing up mdraid metadata ... you'd have to lose metadata on 2 or 3 drives to lose whole array ... actually restoring wrong metadata in wrong place would cause more harm than good. and yes, as long as those ports are in the same computer, it should work automagically :) – Fox Mar 19 '12 at 22:51

1 Answers1

3

As @Fox said, the metadata will guarantee that the array can be assembled no matter what order the drives are detected in.

You should of course be thinking about the devices by their serial number or some other property unique to the physical device, as opposed to the device node name. e.g.:

$ ls -la /dev/disk/by-id/ata-ST3320418AS_6VM9PNFT
lrwxrwxrwx 1 root root 9 2011-11-15 23:20 /dev/disk/by-id/ata-ST3320418AS_6VM9PNFT -> ../../sde

because which physical devices get assigned which device nodes on boot isn't guaranteed. That could be important if you ever need to remove a device, etc. So in my case I think about that disk as serial 6VM9PNFT, not /dev/sde.

As for backing up the metadata, I don't think it's that important because as long as your array assembles you'll have the metadata. If the array doesn't assemble then what is the point of the metadata? Really you aren't meant to be messing around with metadata, you're supposed to be keeping enough available devices!

However, if you really want to back it up, you can dump it out by executing mdadm -E /dev/sde1 for each of the member devices in each of your arrays.

grifferz
  • 928
  • 5
  • 13