Possible Duplicate:
MDADM Superblock Recovery

This may just be me being very stupid but I don't get it! I am new to mdadm raid configuration and my system configuration is as follows:

  • 1 * ATA Drive (originally /dev/sda) with Ubuntu on it
  • I then bought 2 * SATA 2Tb (size is relevant) drives which I want to mirror /dev/sdb & /dev/sdc

I then (using sdb & sdc only..)

  • Confirmed the existence hard disk devices using lshw -C disk
  • Partitioned them using fsdisk (one large 2Gb ext3 partition each)
  • Ran: mdadm --create /dev/md0 --level=raid1 --raid-devices=2 /dev/sdb1 /dev/sdc1
  • Wait 7 hours for /proc/mdstat to say that the array is in active
  • Format the /dev/mb0 using ext3 partition
  • Run: mdadm --examine --scan >> /etc/mdadm/mdadm.conf
  • mount it manually and when that worked add to /etc/fstab: /dev/md0 /var/samba_share/raid/ ext3
  • Reboot and it mounts correctly - so everyone seems happy

BUT my questions:

  1. I then powered down the system - unplugged one of the drives and started it up again. The system refused to boot complaining about the fact that it could not mount /dev/md0. Why? This is a raid array and surely it should have happely booted from the remaining drive (if I plug it in again - we are off and running - if I don't I can't mount /dev/md0 myself either)

  2. At some stage - Ubuntu has decided to rename my drives any my original ATA drive is now /dev/sdc whilst the new drives are /dev/sda and /dev/sdb - it doesn't seem to break anything but it confuses me greatly....

  3. If (1) is normal behaviour - how would I recover from it if this was for real? I prefer not to try the --remove --add route just for fun as with these drives it takes 7 hours to sync

Thanks for any advice!

-- Clarification on Giles's comments:

"you should use filesystem UUIDs, filesystem labels or LVM labels and never /dev/sd* to designate drives." -- does that mean I did something wrong?

/boot/grub/grub.cfg (that's a large file so I extracted the bit which I thought may be relevant - please let me know if you need more:

menuentry "Memory test (memtest86+)" { insmod ext2 set root='(hd0,1)' search --no-floppy --fs-uuid --set 41e1c8ad-df5e-4c49-b253-0831cc0a6ec8 linux16 /memtest86+.bin } menuentry "Memory test (memtest86+, serial console 115200)" { insmod ext2 set root='(hd0,1)' search --no-floppy --fs-uuid --set 41e1c8ad-df5e-4c49-b253-0831cc0a6ec8 linux16 /memtest86+.bin console=ttyS0,115200n8 }


proc /proc proc nodev,noexec,nosuid 0 0 /dev/mapper/mediaserver-root / ext4 errors=remount-ro 0 1 UUID=41e1c8ad-df5e-4c49-b253-0831cc0a6ec8 /boot ext2 defaults 0 2 /dev/mapper/mediaserver-swap_1 none swap sw 0 0 /dev/md0 /var/samba_share/raid/ ext3

mdadm -D /dev/md[0-9]*

/dev/md0: Version : 00.90 Creation Time : Tue May 17 14:51:40 2011 Raid Level : raid1 Array Size : 1953511936 (1863.01 GiB 2000.40 GB) Used Dev Size : 1953511936 (1863.01 GiB 2000.40 GB) Raid Devices : 2 Total Devices : 2 Preferred Minor : 0 Persistence : Superblock is persistent

Update Time : Tue May 17 23:30:33 2011
      State : clean

Active Devices : 2 Working Devices : 2 Failed Devices : 0 Spare Devices : 0

       UUID : cf48dce3:ad034531:1fe5419e:fb5a4d56 (local to host mediaserver.debeer.net)
     Events : 0.34

Number   Major   Minor   RaidDevice State
   0       8       17        0      active sync   /dev/sdb1
   1       8       33        1      active sync   /dev/sdc1

marked as duplicate by Oli Dec 9 '11 at 22:00

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • (1) is not normal behavior if everything is set up correctly, but you may have been bitten my /dev/md* renumbering. (2) is normaly; you should use filesystem UUIDs, filesystem labels or LVM labels and never /dev/sd* to designate drives. Show us the contents of /boot/grub/grub.cfg, /etc/fstab and the output of mdadm -D /dev/md[0-9]*. – Gilles May 18 '11 at 7:32

I hope that was a typo when you stated that the RAID members where formatted with ext3 before you added them to the array. Now you have a block device with two super blocks, one ext3 and one md. If say an fsck would be triggered, that raid member would be wiped out. The proper thing to do is dd zeros, use a partition that spans almost the entire disk, and tag it as type fd.

See post MDADM Superblock Recovery

Not the answer you're looking for? Browse other questions tagged or ask your own question.