Gentoo Archives: gentoo-user

From: Richard Fish <bigfish@××××××××××.org>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] udev.rules: Two "removeable" SATA-hds...how to map to /dev ???
Date: Fri, 04 Aug 2006 17:50:16
Message-Id: 7573e9640608041043r24232be8w668ab47d6e27250f@mail.gmail.com
In Reply to: Re: [gentoo-user] udev.rules: Two "removeable" SATA-hds...how to map to /dev ??? by Meino Christian Cramer
1 On 8/4/06, Meino Christian Cramer <Meino.Cramer@×××.de> wrote:
2 > Is this logically/technically correct, Richard: ?
3 >
4 > - The BIOS recogizes the "first" disk (grub: hd0) only by the bus it
5 > is attached to: A disk connected to "SATA connector 1" will be hd0,
6 > and another one connected to "SATA connector 2" will be hd1
7
8 It is based on the BIOS boot order mapping. So if the BIOS is
9 configured to boot connector 1 (c1) first, then c2, then yes, c2 will
10 be hd1. But if you remove c1, then c2 will be the first bootable hard
11 drive, and become hd0.
12
13 > - Therefore grub can distinguish the disks and choose the correct one
14 > to boot from right from the BIOS settings and the bus ID even all
15 > disks attached to the system are physically and model-wise
16 > absolutely identical.
17
18 If both drives are permanently connected, then you only need to
19 install grub on the first drive, and it can reference kernels and
20 initrds from the second drive (hd1). But if you are going to remove
21 the first one to boot from the second, or change the order of the
22 drives, then you will want hd0 in the grub configuration for both
23 drives.
24
25 You can use device.map files to specify what the BIOS mapping will be
26 when you boot from each drive. So for example if you wanted to
27 install grub on /dev/sdb, and plan for it to become sda when you boot
28 from it, you can have a device.map that contains:
29
30 (hd0) /dev/sdb
31
32 And install grub on that device with:
33
34 echo << EOF | grub --device-map=device.map
35 root (hd0,0) # assuming /boot is /dev/sdb1
36 setup (hd0)
37 EOF
38
39 > - So, booting a kernel image from the correct disk will be no
40 > problem.
41 > - Now...I will label the root of my bootdisk (grub: hd0) with "root"
42 > (only as an example...) and pass that as kernelparameter:
43 >
44 > root="root"
45
46 For my recovery disk, what I use is "root=LABEL=recovery". You also
47 need an initramfs environment that uses the standard 'mount' command
48 to mount the root filesystem, so that the mount-by-label trick
49 actually works.
50
51 Are you planning on removing one drive to boot from the other? Or
52 keeping both drives permanently installed and using BIOS/grub to
53 decide which drive to boot from?
54
55 -Richard
56 --
57 gentoo-user@g.o mailing list