how to boot linux from linux?
hi all!
i have installed fedora on external hard drive, but i can not boot it because my notebook have no support for booting from external hdd. but i already have one distribution of linux (gentoo) on my internal hard drive. so, if you can help me how can i boot fedora from gentoo? can i do that? because i can see and mount my extrernal hdd from gentoo. please if you can help me with that. thank you in advance! |
Add the following to your grub.conf (gentoo)...
Code:
title Fedora |
well, that's the problem, i tryed that earlier, because i'm recieving error message that selected disk does not exist.
on my machine, i have two internal hdd's and one external. on that external is fedora i want to boot, on it's second partition - hd(2,1) but, as i said, it can not recognize external hdd. that's why i asked if i can boot linux on external hdd from linux installed on internal hdd. any ideas that may help? tnx in adv! |
You should try copying the fedora /boot partition to your gentoo drive in a specific partition and edit the initrd file to make sure the drivers for the USB drive are present and edit the fstab to point to the USB drive. Then add this partition to grub.
|
Look in your /boot/grub/device.map (on gentoo) and find the entry for the USB HDD, if there isn't one, add one.
|
editing~~~
|
still same error.
my /boot/grub/device.map looks like this (i added last line manually): (hd0) /dev/sda (hd1) /dev/sdb (hd2) /dev/sdc and part of grub.conf: title Fedora2 kernel (hd2,1)/boot/vmlinuz ro root=/dev/sdc2 initrd (hd2,1)/boot/initrd vmlinuz and initrd are proper links to proper files on fedora partition. again, i have two internal hdd's and one external. any help? |
So, the boot partition is the second partition on sdc and sdc is the usb hard drive?
It also says that the root is /dev/sdc2? Isn't your root partition on a Linux LVM? |
type 'find /boot/vmlinuz' at grub command prompt please and show me the result.
|
Quote:
can it help if i post result of fdisk -l command: Code:
localhost grub # fdisk -l |
Since the BIOS does not support booting from USB, you need to copy the kernel and initrd image from the external HD to an internal HD - perhaps in a subdirectory of /boot - call it 'ext', so you have /boot/ext/vmlinuz... and same with the initrd. Set up Grub's menu.lst to use that copy of the kernel and initrd to boot. The kernel should boot, but it might get stuck at attempting to mount the root filesystem - if that happens then you need to alter the initrd file so that it loads all drivers, waits until the system recognizes the external HD, then proceeds with switching from the initrd to the final filesystem.
|
Quote:
pinniped, you're right - i did as you wrote, kernel boots, but it can't mount any of the system directories. how can i alter the initrd to load all the drivers? do i need to recompile the kernel? |
Quote:
As I guess you have worked out by now, the external drive is probably not known at boot time by grub (it can't see it until after some of the drivers are loaded). If you have a separate boot partition on one of the internal drives you can use that and set the real_root parameter in the grub.conf file to point to your /dev/sdc2 (or sdc3). Mons |
Quote:
1. unpack the initrd: mkdir tmp && cd tmp cp /path/to/initrd initrd.gz mkdir image && cd image cpio -i < ../initrd 2. make changes as appropriate - sometimes it's just a matter of finding out what file determines what modules are loaded. You start reading through the 'init' script and see what it does. Somewhere there will be a file with a list of modules to load. You also need to check the lib/modules/... directory to make sure the modules you need are in the image; if they're not, mount your external HD and copy the necessary modules. 3. pack up the initrd again: find . | cpio -o -H newc | gzip > ../your_initrd_name Of course your new initrd doesn't have to have the same name as the original - in fact, don't name it like the original or you're screwed if it doesn't work. Just edit grub's menu.lst to use the new initrd. When you get that working, look at customizing the mkinitramfs scripts on your new system so that the necessary modules are added and loaded; that would make updates much easier. Be careful tweaking the mkinitramfs scripts; some files are not meant to be touched because they will be replaced if the scripts are upgraded - however, there is usually some provision to allow the user to make lasting changes even when the scripts are upgraded. |
hi all!
just to inform you that i did solve this thanks to your advices. solution was very much line in post #11, by pinniped. in gentoo file system dir, i created new dir named /boot/ext/, and placed there vmlinuz and initrd files from fedora installation. also, i have added next lines in grub.conf : Title Fedora kernel=(hd1,5)/boot/ext/vmlinuz initrd=(hd1,5)/boot/ext/initrd that's it, no root definition in grub.conf or anything else. thank you all on your help! |
All times are GMT -5. The time now is 05:54 PM. |