PDA

View Full Version : How can I make GRUB boot Fedora?



joe.pelayo
10th November 2007, 11:01 PM
Hello everybody.

First of all I apologize with our Admins/CM if this thread does not belong to this category (feel free to move it), but from a certain point of view it does.

Today I bought a Transcend enclosure for 2.5 HDD so I could take advantage of having a spare laptop HDD. I took the new drive and installed Fedora 8 in it, since it is faster I will keep it for the laptop. On the other hand, the laptop's former HDD was put into the enclosure without formatting it first, and to my great surprise when I plugged the 'new' USB drive all the partitions were there!

That gave me the idea of booting from the USB HDD and see if I could work with the OS's already there, but unfortunately I was unable to do so: it failed to mount the root partition!

My questions here are:

Is this actually possible? To make a former 'internal' installation become out of the sudden an 'external' one.

If it is, what can I do to make the Linux inside the HDD to boot? (It's Fedora 7). As a matter of fact the 'old' grub within the now external HDD does show up, and I can actually select what OS to boot.

Somehow I guess this has to do with the 'root' parameter inside GRUB, I'll continue trying to 'find' how does it refer to the external HDD.

Thanks.
Joe.

joe.pelayo
10th November 2007, 11:42 PM
The error messages complain about not being able to mount /dev and /proc

jbkt23
11th November 2007, 12:17 AM
Just a thought haven't tried it or know if can be done, but could you change the boot device in the bios to boot the usb drive first?. Then the second issue would be finding out which device it is so you can label the section in grub correctly.

joe.pelayo
11th November 2007, 12:23 AM
Just a thought haven't tried it or know if can be done, but could you change the boot device in the bios to boot the usb drive first?. Then the second issue would be finding out which device it is so you can label the section in grub correctly.
Well, my BIOS allows me to select boot device 'on the fly' so I can actually select the drive and enter its GRUB. I think the problem is the second thing you mentioned. Anyway I'll try that.

Thanks.
Joe.

jbkt23
11th November 2007, 12:53 AM
I think another hitch is that fstab is going to balk because the paths don't relate anymore.

joe.pelayo
11th November 2007, 01:31 AM
I think another hitch is that fstab is going to balk because the paths don't relate anymore.
I have already edited fstab and changed what I considered should be changed. The problems arise with partitions whose configuration is not explicitly done in fstab: /dev y /proc.

kflorek46
11th November 2007, 08:04 AM
Those errors you are getting about not being able to mount /dev or /proc are from the startup kernel not being able to organize itself. These names are not partitions. They are in memory and don't have any location on the hard drives in themselves.


I have moved drives around and moved linux from one partition to another, and then made linux work. You already mentioned that the GRUB "root" command has to have the correct drive and partition number; and / (which symbolizes the root file system) has to be mounted on the right device in fstab, although if LABELs are used, that should not need to be changed, unless possibly more than one drive/partition has the same name, as once happened to me when I duplicated a drive kept them in the same computer.

Partitions can also get the same name if they both received the default name that the Fedora installer generates. What can happen is that GRUB will load the kernel and the initrd from one drive and partition, but after linux begins to start it loads files from the other partition with the same name, producing total chaos.

Then there is a boot parameter that is passed to the linux kernel on the same line as the GRUB kernel command. It follows the file name of the kernel on the same line and is something like
root=LABEL=/

The Fedora installer generally gives the root partition the default label of /.

/ in this case is a text name, which is somewhat confusing. If it said LABEL=Fedora it would be easier to understand that it really is text.

If the root partition on drive A and drive B both have the label /, you are going to have trouble loading the linux on at least one of them. You can either change the label and also the name used in the parameter or use the device name instead, like
root=/dev/sda1
or
root =/dev/sdb1/


If GRUB chains to the boot sector on another partition, one further problem arises. If the partition is moved from its installed position, the loader on the boot sector will be for the wrong partition, and usually doesn't work. Then a new, proper boot sector has to be put on the partition.