I have a big problem with my software raid-1 because the raid device names have been changed (old: /dev/md[0,1,2], new: /dev/md[125,126,127])!
No I need your help because I do not want to damage my system finally (at the moment it runs with one missing hard drive). Here some general informations:
kernel version: 2.6.34-gentoo-r6
mdadm version: mdadm-3.0
software raid: Raid-1 (mirror)
past history
Some time ago i created the raid 1 with the following commands:
Code: Select all
mdadm -C /dev/md0 -l 1 -n 2 /dev/sda1 /dev/sda2
mdadm -C /dev/md1 -l 1 -n 2 /dev/sda2 /dev/sda2
mdadm -C /dev/md2 -l 1 -n 2 /dev/sda3 /dev/sda3Code: Select all
ARRAY /dev/md0 level=raid1 num-devices=2 metadata=0.90 UUID=cb28a94e:40d93554:4fc4e4ff:e7b86def
ARRAY /dev/md1 level=raid1 num-devices=2 metadata=0.90 UUID=860e225c:1d59d285:9224bc57:2ab24b23
ARRAY /dev/md2 level=raid1 num-devices=2 metadata=0.90 UUID=f93c01cd:70d9be28:a740eabd:3d89ce85Some days ago i had to reboot this system which forced me to update the kernel (udev made trouble with the old kernel) with the help of a Gentoo LIVE CD.
Problem: RAID-Devices are named with changing names!
The new kernel works but the raid devices were changed from md[0,1,2] to 125,126,127 (I saw it in the LIVE CD). The system did not boot because it did not find the /dev/md[0,1,2]. Then I thought: "OK, change it in /etc/fstab and grub.conf and everything is ok". But it was not OK because after each reboot the names /dev/md125, /dev/md126, /dev/md127 changed! Example: /dev/md125 was my / partition, after the next reboot /dev/md125 was my /boot partition.
Then i made some changes (I think some mistakes, too!) and at least i disconnected the second hard drive. So I have a backup disk.
current status
My systems boots porperly (without changes raid device names) but one hard drive is missing. I'm wondering about the current names because there is a /dev/md1 instead of /dev/md125 and /dev/md0 still exists. It seems that I have a mix of old an new names
Code: Select all
# ls -l /dev/md*
brw-rw---- 1 root disk 9, 0 Dec 3 14:46 /dev/md0
brw-rw---- 1 root disk 9, 1 Dec 3 14:46 /dev/md1
brw-rw---- 1 root disk 9, 126 Dec 3 14:46 /dev/md126
brw-rw---- 1 root disk 9, 127 Dec 3 14:46 /dev/md127
/dev/md:
total 0
lrwxrwxrwx 1 root root 8 Dec 3 14:46 126_0 -> ../md126
lrwxrwxrwx 1 root root 8 Dec 3 14:46 127_0 -> ../md127
lrwxrwxrwx 1 root root 6 Dec 3 14:46 1_0 -> ../md1Code: Select all
# cat /proc/mdstat
Personalities : [raid1]
md126 : active raid1 sda1[0]
104320 blocks [2/1] [U_]
md1 : active raid1 sda2[0]
1003968 blocks [2/1] [U_]
md127 : active raid1 sda3[0]
77039616 blocks [2/1] [U_]
unused devices: <none>How do I configure mdadm so the raid device names will not change in the future?
2nd question: add a new hard drive?
How do I add a new drive to this "corrupted" raid array. I need a safe step-by-step manual because i do not want to crash my system!
3rd question: How does mdadm recognize the hard drives which belong to an array?
Is that information stored in the superblock? I see the UUID and Preferred Minor?
Code: Select all
# mdadm -E /dev/sda3
/dev/sda3:
Magic : a92b4efc
Version : 0.90.00
UUID : 860e225c:1d59d285:9224bc57:2ab24b23 <--------------- !!!!!!!!!!!!!!
Creation Time : Wed Sep 5 08:36:21 2007
Raid Level : raid1
Used Dev Size : 77039616 (73.47 GiB 78.89 GB)
Array Size : 77039616 (73.47 GiB 78.89 GB)
Raid Devices : 2
Total Devices : 1
Preferred Minor : 127 <--------------------------------- !!!!!!!
Update Time : Mon Dec 6 18:29:42 2010
State : clean
Active Devices : 1
Working Devices : 1
Failed Devices : 1
Spare Devices : 0
Checksum : a6b08bd2 - correct
Events : 40478144
Number Major Minor RaidDevice State
this 0 8 3 0 active sync /dev/sda3
0 0 8 3 0 active sync /dev/sda3
1 1 0 0 1 faulty removed
Have a look into the mdadm.conf: there are md0, md1 and md2 with the correct UUIDs.
Code: Select all
## AUSZUG mdadm.conf
ARRAY /dev/md0 level=raid1 num-devices=2 metadata=0.90 UUID=cb28a94e:40d93554:4fc4e4ff:e7b86def
ARRAY /dev/md1 level=raid1 num-devices=2 metadata=0.90 UUID=860e225c:1d59d285:9224bc57:2ab24b23
ARRAY /dev/md2 level=raid1 num-devices=2 metadata=0.90 UUID=f93c01cd:70d9be28:a740eabd:3d89ce85



