You are not logged in.

#1 2010-08-05 09:10:16

KRTac
Member
From: Croatia
Registered: 2008-07-01
Posts: 99

[SOLVED] Kernel cant rebuild RAID 1 array with mdadm

I am trying to setup a raid 1 array. My problem is that the kernel doesn't assemble the array after reboot and says that it cant find /dev/md1

I've chrooted in the new environment from the existing installation on the old disk and added the mdadm hook and it 'compiled' (mkinitcpio -p kernel26) with the /etc/mdadm.conf. I've added all the stuff to fstab. I have a / and a separate /boot array. The /boot array was created with --metadata=0.90 because grub cant access partitions with newer style metadata.

I added the array info to /etc/mdadm.conf and ran mkinitcpio -p kernel26 with the mdadm hook. The hook ran and printed a notice that it would get the array info from /etc/mdadm.conf, so I guess that worked.

After I reboot and set the drive with the array as the first boot device in the BIOS, grub starts up with one additional entry that I added before:

timeout   5
default   0
color light-blue/black light-cyan/blue

title Arch on RAID
root (hd1,0)
kernel /boot/vmlinuz26 root=/dev/md1 md=0,/dev/sda3,/dev/sdb3 vga=792
initrd /boot/kernel26.img

# (0) Arch Linux
title  Arch Linux
root   (hd0,0)
kernel /boot/vmlinuz26 root=/dev/disk/by-uuid/8b19e18d-9beb-49da-83f1-b29284b8d6e1 ro vga=792
initrd /boot/kernel26.img

# (1) Arch Linux
title  Arch Linux Fallback
root   (hd0,0)
kernel /boot/vmlinuz26 root=/dev/disk/by-uuid/8b19e18d-9beb-49da-83f1-b29284b8d6e1 ro
initrd /boot/kernel26-fallback.img

The first entry is the one that should load the new mdadm enabled kernel and it works...it loads some kernel, but I'm not sure if its the right one since it cant 'find' /dev/md1 witch was added as a hook before.

I'm a little suspicious since /boot is a separate drive in my situation, so technically the kernel would be on /vmlinux26, not /boot/vmlinuz26. Ive tried all different combinations of root (hd0,0, hd0,1, ...) and with or without /boot, but no luck. hd1,0 is the only one that works.

/etc/mdadm.conf:

DEVICE partitions

ARRAY /dev/md0 metadata=0.90 UUID=a5db7993:bc310e03:a0504988:dd22e85f
ARRAY /dev/md1 metadata=1.2 name=scorpion:1 UUID=7e20d1a8:4382351d:56d4cac8:d65a45b8

/etc/fstab:

devpts                 /dev/pts      devpts    defaults            0      0
shm                    /dev/shm      tmpfs     nodev,nosuid        0      0

/dev/md1 / ext4 defaults 0 1
/dev/md0 /boot ext2 defaults 0 1
/dev/sdb1 swap swap defaults 0 0

The array assembles just fine on my existing installation:

[root@scorpion krt]# mdadm -A /dev/md0 /dev/sdb2
mdadm: /dev/md0 has been started with 1 drive (out of 2).
[root@scorpion krt]# mdadm -A /dev/md1 /dev/sdb3
mdadm: /dev/md1 has been started with 1 drive (out of 2).
[root@scorpion krt]# mount /dev/md1 /mnt/root/
[root@scorpion krt]# mount /dev/md0 /mnt/root/boot/
[root@scorpion krt]# mount --bind /sys /mnt/root/sys/
[root@scorpion krt]# mount --bind /proc /mnt/root/proc
[root@scorpion krt]# mount --bind /dev /mnt/root/dev
[root@scorpion krt]# chroot /mnt/root/
[root@scorpion /]#

I was trying to get this going all yesterday, but no luck.

Can anyone help me figure it out? I'm desperate here.

Last edited by KRTac (2010-08-05 17:58:01)

Offline

#2 2010-08-05 12:27:25

Coacher
Guest

Re: [SOLVED] Kernel cant rebuild RAID 1 array with mdadm

If you use separate partition for /boot then you definetely should put /vmlinuz26 not /boot/vmlinuz26.
And under root hd(x,y) you should put your /boot partition number.
If interested here is the output of few commands on my up and running machine with RAID 1 /boot + grub:
http://pzt.me/hzvta
http://pzt.me/c2xz1
http://pzt.me/9gbqx

#3 2010-08-05 17:50:20

KRTac
Member
From: Croatia
Registered: 2008-07-01
Posts: 99

Re: [SOLVED] Kernel cant rebuild RAID 1 array with mdadm

I've got it.

I had to fidle with grub, but I got it to boot the right kernel.

I set the path to /vmlinuz26 and /kernel26.img and root to hd0,2 (my third partition is /boot) and it now boots the raid enabled kernel.

Thanks Coacher.

Offline

#4 2010-08-05 17:56:38

Coacher
Guest

Re: [SOLVED] Kernel cant rebuild RAID 1 array with mdadm

Great!
Please mark this topic as SOLVED.

Board footer

Powered by FluxBB