Gentoo Archives: gentoo-user

From: Mark Knecht <markknecht@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] How does grub assemble a RAID1 for / ??
Date: Sun, 04 Apr 2010 01:01:36
Message-Id: l2y5bdc1c8b1004031801hb0063c7aj93623e07c02bad3f@mail.gmail.com
In Reply to: Re: [gentoo-user] How does grub assemble a RAID1 for / ?? by Neil Bothwick
1 On Sat, Apr 3, 2010 at 4:37 PM, Neil Bothwick <neil@××××××××××.uk> wrote:
2 > On Sat, 3 Apr 2010 16:07:06 -0700, Mark Knecht wrote:
3 >
4 >>    The install is complete but it won't boot. grub finds the kernel
5 >> and starts booting but then I get the typical VFS file sync error as
6 >> the kernel starts looking for the install on /dev/md3. What I'm not
7 >> understanding is how does the boot process get the information
8 >> required to assemble the RAID device. By hand in the non-RAID install
9 >> I do this:
10 >>
11 >> keeper ~ # mdadm -A /dev/md3 /dev/sdb3 /dev/sdc3
12 >> mdadm: /dev/md3 has been started with 2 drives.
13 >> keeper ~ # cat /proc/mdstat
14 >> Personalities : [raid1]
15 >> md3 : active raid1 sdb3[0] sdc3[1]
16 >>       52436092 blocks super 1.1 [2/2] [UU]
17 >>
18 >> unused devices: <none>
19 >> keeper ~ #
20 >>
21 >> but when I try to boot the RAID install it says it cannot find /dev/md3.
22 >
23 > You need to set the partition type for the RAIDed partitions to "Linux
24 > raid autodetect". You'll probably then find that the kernel sets the RAID
25 > as /dev/md0, not md3.
26 >
27 >
28 > --
29 > Neil Bothwick
30
31 Tried changing root=/dev/md0. No change.
32
33 The actual failure message is the fairly standard
34
35 VFS - Unable to mount root fs on unknown-block(9,0)
36
37 I can control this using (for instance)
38
39 title /dev/sda1 Gentoo Linux 2.6.33-gentoo-RAID
40 root (hd0,0)
41 kernel (hd0,0)/boot/bzImage-2.6.33-gentoo-RAID root=/dev/md3
42 md=3,1,/dev/sdb3,/dev/sdc3
43
44 which changes the message to 'unknown-block(9,3)'
45
46 Since the mknod command for md devices is always 9 1 or 9 3 those match up.
47
48 Is this saying that the special file thing for 9,0 and 9,3 are missing
49 at boot time?
50
51
52 As I posted in the first post the partitions are marked as autodetect,
53 but if it matters I did that late in the process after the RAID was
54 built.
55
56 keeper ~ # fdisk -l /dev/sdb /dev/sdc
57
58 Disk /dev/sdb: 500.1 GB, 500107862016 bytes
59 255 heads, 63 sectors/track, 60801 cylinders
60 Units = cylinders of 16065 * 512 = 8225280 bytes
61 Disk identifier: 0xa06ef201
62
63 Device Boot Start End Blocks Id System
64 /dev/sdb1 1 14 112423+ 83 Linux
65 /dev/sdb2 16 538 4200997+ 82 Linux swap / Solaris
66 /dev/sdb3 544 7071 52436160 fd Linux raid autodetect
67
68 Disk /dev/sdc: 500.1 GB, 500107862016 bytes
69 255 heads, 63 sectors/track, 60801 cylinders
70 Units = cylinders of 16065 * 512 = 8225280 bytes
71 Disk identifier: 0x2ab15637
72
73 Device Boot Start End Blocks Id System
74 /dev/sdc1 1 14 112423+ 83 Linux
75 /dev/sdc2 16 538 4200997+ 82 Linux swap / Solaris
76 /dev/sdc3 544 7071 52436160 fd Linux raid autodetect
77 keeper ~ #
78
79
80
81 Answering Albert - I did it with /dev/md3 because that's how the
82 install guide did it:
83
84 mknod /dev/md3 b 9 3
85 mdadm --create /dev/md3 --level=1 --raid-devices=2 /dev/sda3 /dev/sdb3
86
87 From fstab:
88 /dev/md3 / ext3 noatime 0 1
89
90 From grub.conf:
91 title Gentoo
92 root (hd0,0)
93 kernel /boot/kernel root=/dev/md3
94
95 Granted, my kernel line is a little different:
96
97 root (hd0,0)
98 kernel (hd0,0)/boot/bzImage-2.6.33-gentoo-RAID root=/dev/md3
99
100 but I didn't make it up. I just followed the guide.
101
102 I set the same RAID kernel options as shown in the guide but maybe
103 there is some other requirement not shown in the guide but actually
104 required? The CONFIG_RAID_ATTRS is not discussed for instance::
105
106 keeper / # cat /usr/src/linux/.config | grep RAID
107 CONFIG_RAID_ATTRS=m
108 # CONFIG_BLK_DEV_3W_XXXX_RAID is not set
109 # CONFIG_SCSI_AACRAID is not set
110 # CONFIG_MEGARAID_NEWGEN is not set
111 # CONFIG_MEGARAID_LEGACY is not set
112 # CONFIG_MEGARAID_SAS is not set
113 # CONFIG_SCSI_PMCRAID is not set
114 CONFIG_MD_RAID0=y
115 CONFIG_MD_RAID1=y
116 # CONFIG_MD_RAID10 is not set
117 # CONFIG_MD_RAID456 is not set
118 keeper / #
119
120 Thanks!
121
122 - Mark

Replies

Subject Author
[gentoo-user] Re: How does grub assemble a RAID1 for / ?? Kerin Millar <kerframil@×××××.com>