Linux boot on a raid1 software raid ?

Posted by azera on Server Fault See other posts from Server Fault or by azera
Published on 2010-03-12T13:50:39Z Indexed on 2010/03/12 13:57 UTC
Read the original article Hit count: 662

Filed under:
|
|
|

Hello

I am trying to convert my single disk boot to a raid1 boot

So far here is what i have:

  • I sucessfully create the raid 1 as degraded with the new drive alone, I copied all the data on it
  • I can mount that raid 1, see its files etc
  • I already have a raid5 that is working on the same box (although not booting on it)
  • I have installed grub on both drive
  • When grub boot, it loads the kernel alright, but during the kernel boot it fails to load the "root block device"

The kernel tells me : 1 - detected that root device is an md device 2 - determining root devices 3 - mounting root 4 - mounting /dev/md125 on /newroot failed: input/output error. Please enter another root device: ...

At this point, if I enter /dev/sda3 (my "old" root device that isn't converted to raid yet) everything boots fine without the root. The /dev/md125 device is indeed created but it seems to be created after the error happens, as in it creates it after loading the device, when mdadm is loaded.

Somehow it looks like it can't/doesn't load the raid array before it needs to mount it, and I don't know how I can solve that.

My config files (taken from the system once it boots with sda3 as root device):

$ cat /etc/mdadm.conf
ARRAY /dev/md/md0-r5 metadata=0.90 UUID=1a118934:c831bdb3:64188b84:66721085
ARRAY /dev/md125 metadata=0.90 UUID=48ec4190:a80d4dde:64188b84:66721085

$ cat /proc/mdstat
Personalities : [raid1] [raid6] [raid5] [raid4] [raid0] [raid10]
md125 : active raid1 sdc3[1]
      477853312 blocks [2/1] [_U]

md127 : active raid5 sdd[0] sdf[3] sdb[2] sde[1]
      4395415488 blocks level 5, 64k chunk, algorithm 2 [4/4] [UUUU]

unused devices: <none>

$ cat /boot/grub/menu.lst
default 0
timeout 8
splashimage=(hd0,0)/boot/grub/splash.xpm.gz

title Gentoo Linux 2.6.31-r10
root (hd0,0)
#kernel /boot/kernel-genkernel-x86_64-2.6.31-gentoo-r10 root=/dev/ram0 real_root=/dev/sda3
kernel /boot/kernel-genkernel-x86_64-2.6.31-gentoo-r10 root=/dev/md125 md=125,/dev/sdc3,/dev/sda3
initrd /boot/initramfs-genkernel-x86_64-2.6.31-gentoo-r10

# blkid
/dev/sda1: UUID="89fee223-b845-4e0a-8a0b-e6cf695d5bcf" TYPE="ext2"
/dev/sda2: UUID="a72296a8-d7d4-447f-a34b-ee920fd1a767" TYPE="swap"
/dev/sda3: UUID="97eb0a6a-c385-4a9d-bf74-c0bab1fa4dc1" TYPE="ext3"
/dev/sdb: UUID="1a118934-c831-bdb3-6418-8b8466721085" TYPE="linux_raid_member"
/dev/sdc1: UUID="d36537fd-19a0-b8a3-6418-8b8466721085" TYPE="linux_raid_member"
/dev/sdd: UUID="1a118934-c831-bdb3-6418-8b8466721085" TYPE="linux_raid_member"
/dev/sde: UUID="1a118934-c831-bdb3-6418-8b8466721085" TYPE="linux_raid_member"
/dev/md127: UUID="13a41589-4cf1-4c04-91ca-37484182c783" TYPE="ext4"
/dev/sdf: UUID="1a118934-c831-bdb3-6418-8b8466721085" TYPE="linux_raid_member"
/dev/sdc2: UUID="a1916397-1b48-45d7-9f98-73aa521e882f" TYPE="swap"
/dev/sdc3: UUID="48ec4190-a80d-4dde-6418-8b8466721085" TYPE="linux_raid_member"
/dev/md125: UUID="c947ed64-1d4d-4d1d-b4d2-24669fff916e" SEC_TYPE="ext2" TYPE="ext3"

# mdadm -E
mdadm: No devices to examine

# fdisk -l

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xe975e9fc

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1           5       40131   83  Linux
/dev/sda2               6        1311    10490445   82  Linux swap / Solaris
/dev/sda3            1312       60801   477853425   83  Linux

Disk /dev/sdc: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xe975e9fc

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1           5       40131   83  Linux
/dev/sdc2               6        1311    10490445   82  Linux swap / Solaris
/dev/sdc3            1312       60801   477853425   83  Linux

Disk /dev/md125: 489.3 GB, 489321791488 bytes
2 heads, 4 sectors/track, 119463328 cylinders
Units = cylinders of 8 * 512 = 4096 bytes
Disk identifier: 0x00000000

Disk /dev/md125 doesn't contain a valid partition table

© Server Fault or respective owner

Related posts about linux

Related posts about boot