1 |
On 07/11/2009 08:08 AM, Alex Schuster wrote: |
2 |
> Alan E. Davis writes: |
3 |
>> On Sat, Jul 11, 2009 at 11:26 PM, Neil Bothwick<neil@××××××××××.uk> wrote: |
4 |
>>> On Sat, 11 Jul 2009 10:16:26 +1000, lngndvs@×××××.com wrote: |
5 |
>>>> In grub, it is located first as hd1 (/dev/sdb) and then as |
6 |
>>>> /dev/sda5. That is where I want it to be. |
7 |
>>> |
8 |
>>> Those are two different things. the first is GRUB's root directory, the |
9 |
>>> place where is will find its configuration and stage files (i.e. the |
10 |
>>> location of /boot). The root argument on the kernel line is tell the |
11 |
>>> kernel the location of your root filesystem - /. |
12 |
>> |
13 |
>> I need to have the second drive (SATA #2) as the first boot drive |
14 |
>> because that's the drive with the grub setup in the MBR, for Gentoo. |
15 |
> |
16 |
> Is there a reason why yo keep having grub on #2? If not, I'd just run grub, |
17 |
> enter |
18 |
> root (hd0,0) |
19 |
> setup (hd0) |
20 |
> quit |
21 |
> , copy /boot/grub/grub.conf over and all should be fine. |
22 |
> |
23 |
> If you prefer to leavy it as it is: instead of using the partiton itself |
24 |
> (like /dev/sda5) in grub.conf and fstab, you could try the /dev/disk-by- |
25 |
> label/<label of your root partition> notation. You can use dumpe2fs -h |
26 |
> /dev/sda5 to see the label as Filesystem volume name, and tune2fs -L to |
27 |
> change it. Then it would not matter on which drive the partiton actually is. |
28 |
|
29 |
Alan, FTR this is pretty much what I was going to suggest. As you can see |
30 |
by Alex's amended post, this is a confusing subject and it's all too easy |
31 |
to make a bad mistake. |
32 |
|
33 |
The very first thing I do before changing anything is to make a bootable |
34 |
USB stick or floppy with all of the files needed to install grub, so I can't |
35 |
lock myself out with my stupid mistakes. |
36 |
|
37 |
My USB stick, e.g. shows up in grub as (hd2). Now, I can't possibly think |
38 |
straight enough to know in advance that the USB stick is (hd2), so what I |
39 |
do every time is to use this trick from the grub prompt: |
40 |
|
41 |
grub> root (hd<now I hit TAB for a list of all drives that grub finds> |
42 |
grub> root (hd<TAB> |
43 |
Possible disks are: hd0 hd1 hd2 <that narrows it down to three> |
44 |
|
45 |
Now for each of the three disks I continue this way: |
46 |
grub> root (hd0,<TAB to get a list of all partitions on (hd0)> |
47 |
|
48 |
On the third disk I finally recognize my USB stick because it has only one |
49 |
partition, but just to be sure: |
50 |
|
51 |
grub> root (hd2,0)/<TAB to get a list of all directories on the partition> |
52 |
|
53 |
If by that time I'm still not sure which is the right disk then I'd better |
54 |
go take a nap before proceeding ;o) |
55 |
|
56 |
Now I mount the USB stick and make a new directory /boot/grub and into that |
57 |
I copy all the install files from /lib/grub/i386-pc/ |
58 |
|
59 |
Now you need to install grub onto the USB stick to make it bootable: |
60 |
|
61 |
grub> root (hd2,0) <that's where I put the grub install files> |
62 |
grub> setup (hd2) <don't specify a partition when running setup!> |
63 |
grub> quit |
64 |
|
65 |
You can now boot the USB stick and use it to install grub on a hard disk, |
66 |
and of course you can use it to boot a machine with grub improperly |
67 |
installed or configured. |