LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-02-2008, 07:04 AM   #1
proNick
Member
 
Registered: Apr 2005
Posts: 104

Rep: Reputation: 15
Question 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!
 
Old 10-02-2008, 07:05 AM   #2
elprawn
Member
 
Registered: Feb 2005
Distribution: Gentoo 2008
Posts: 138

Rep: Reputation: 15
Add the following to your grub.conf (gentoo)...

Code:
title Fedora
      kernel (hd1,0)/vmlinuz-on-fedora-boot ro root=/dev/VolGroup00/LogVol00 rhgb quiet
      initrd (hd1,0)/initrd-on-fedora-boot.img
If (hd1,0) isn't it, try changing to (hd1,1), (hd2,0) etc.

Last edited by elprawn; 10-02-2008 at 07:15 AM.
 
Old 10-02-2008, 07:36 AM   #3
proNick
Member
 
Registered: Apr 2005
Posts: 104

Original Poster
Rep: Reputation: 15
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!
 
Old 10-02-2008, 07:53 AM   #4
Agrouf
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: LFS
Posts: 1,591

Rep: Reputation: 79
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.
 
Old 10-02-2008, 07:56 AM   #5
elprawn
Member
 
Registered: Feb 2005
Distribution: Gentoo 2008
Posts: 138

Rep: Reputation: 15
Look in your /boot/grub/device.map (on gentoo) and find the entry for the USB HDD, if there isn't one, add one.
 
Old 10-02-2008, 08:14 AM   #6
Nocore Ho
LQ Newbie
 
Registered: Oct 2008
Location: China
Distribution: Slackware 13
Posts: 3

Rep: Reputation: 0
editing~~~

Last edited by Nocore Ho; 02-06-2009 at 12:56 PM.
 
Old 10-02-2008, 08:29 AM   #7
proNick
Member
 
Registered: Apr 2005
Posts: 104

Original Poster
Rep: Reputation: 15
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?

Last edited by proNick; 10-02-2008 at 08:30 AM.
 
Old 10-02-2008, 08:43 AM   #8
elprawn
Member
 
Registered: Feb 2005
Distribution: Gentoo 2008
Posts: 138

Rep: Reputation: 15
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?
 
Old 10-02-2008, 08:46 AM   #9
Agrouf
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: LFS
Posts: 1,591

Rep: Reputation: 79
type 'find /boot/vmlinuz' at grub command prompt please and show me the result.
 
Old 10-02-2008, 08:48 AM   #10
proNick
Member
 
Registered: Apr 2005
Posts: 104

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by elprawn View Post
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?
hm... i'm not getting you well..

can it help if i post result of fdisk -l command:

Code:
localhost grub # fdisk -l

Disk /dev/sda: 95.0 GB, 95034885120 bytes
255 heads, 63 sectors/track, 11554 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        5777    46403721    7  HPFS/NTFS
/dev/sda2            5778       11553    46395720    f  W95 Ext'd (LBA)
/dev/sda5            5778       11553    46395688+   7  HPFS/NTFS

Disk /dev/sdb: 100.0 GB, 100030242816 bytes
255 heads, 63 sectors/track, 12161 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1        6081    48845601    7  HPFS/NTFS
/dev/sdb2            6082       12161    48837600    f  W95 Ext'd (LBA)
/dev/sdb5            6082        6343     2104483+  82  Linux swap / Solaris
/dev/sdb6            6344        8893    20482843+  83  Linux
/dev/sdb7            8894       10808    15382206   83  Linux
/dev/sdb8   *       10809       12161    10867941   af  Unknown

Disk /dev/sdc: 200.0 GB, 200049647616 bytes
255 heads, 63 sectors/track, 24321 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1       12749   102400000    7  HPFS/NTFS
/dev/sdc2   *       12750       17847    40949685   83  Linux
/dev/sdc3           17848       20397    20482875   83  Linux
/dev/sdc4           20398       24321    31519530    5  Extended
/dev/sdc5           20398       20652     2048256   82  Linux swap / Solaris
/dev/sdc6           20653       24321    29471211   83  Linux
localhost grub #
 
Old 10-02-2008, 08:54 AM   #11
pinniped
Senior Member
 
Registered: May 2008
Location: planet earth
Distribution: Debian
Posts: 1,732

Rep: Reputation: 50
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.
 
Old 10-02-2008, 09:16 AM   #12
proNick
Member
 
Registered: Apr 2005
Posts: 104

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by pinniped View Post
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.

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?
 
Old 10-02-2008, 10:37 AM   #13
monsm
Member
 
Registered: Feb 2005
Location: London, UK
Distribution: Gentoo
Posts: 568

Rep: Reputation: 37
Quote:
Originally Posted by proNick View Post
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?
Yes, check out genkernel in Gentoo, it will allow you to compile a kernel and create the initrd file at the same time.

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
 
Old 10-02-2008, 05:35 PM   #14
pinniped
Senior Member
 
Registered: May 2008
Location: planet earth
Distribution: Debian
Posts: 1,732

Rep: Reputation: 50
Quote:
Originally Posted by proNick View Post
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?
You need to boot into your usable system, then:

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.
 
Old 10-08-2008, 05:40 AM   #15
proNick
Member
 
Registered: Apr 2005
Posts: 104

Original Poster
Rep: Reputation: 15
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!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
triple boot linux/linux/linux No Windows involved toastermaker Linux - Newbie 12 03-02-2006 11:40 PM
Cannot boot up on Linux, have to boot onto Linux-nonfb after installing nvidia driver /home/kyle Linux - Newbie 6 09-15-2004 12:23 PM
dual boot - XP and Linux - Need to reinstall XP without effecting linux -LILO boot godofmind Linux - General 1 05-05-2004 09:13 AM
Linux Boot Floppy Went Bad on W2K-Linux Dual Boot rzward Linux - General 2 01-15-2003 11:52 AM


All times are GMT -5. The time now is 04:32 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration