 |
02-01-2008
|
#1 (permalink)
| | Just Joined!
Join Date: Dec 2007
Posts: 7
| Gentoo on usb hd problem I have just installed gentoo 2007 on my portable hd with usb connection.
here's the disk partition on my usb hd:
/dev/sdb5 ext2 /boot
/dev/sdb6 swap swap
/dev/sdb7 ext3 /
all of them are probably created from one extended partition
here's the grub loader /boot/grub/gurb.conf:
default 0
timeout 10
title=gentoo
root hd(1,4)
kernel=/boot/kernel root=/dev/sdb7
i can boot into usb drive and get into the page of grub loader, but i got error message "error 15, cannot find file" after i selected.
So, anything wrong with my configuration or installation? |
| |
02-02-2008
|
#2 (permalink)
| | Linux Engineer
Join Date: Nov 2007 Location: Córdoba (Spain)
Posts: 1,158
| Quote:
Originally Posted by hongtao I have just installed gentoo 2007 on my portable hd with usb connection.
here's the disk partition on my usb hd:
/dev/sdb5 ext2 /boot
/dev/sdb6 swap swap
/dev/sdb7 ext3 /
all of them are probably created from one extended partition
here's the grub loader /boot/grub/gurb.conf:
default 0
timeout 10
title=gentoo
root hd(1,4)
kernel=/boot/kernel root=/dev/sdb7
i can boot into usb drive and get into the page of grub loader, but i got error message "error 15, cannot find file" after i selected.
So, anything wrong with my configuration or installation? | You have set the root for grub on that partition, so, the correct path is /vmlinux-whatever, and not /boot/vmlinuz-whatever. This is a very common error, that is why a lot of distros just put a recursive symlink. You could do the same by doing this while /boot is mounted: Code: cd /boot
link -s . boot
You can also edit the boot lines on a bash-like fashion while in grub. Press e to edit the selected entry, and use tab to autocomplete paths and file names if you are not sure. |
| |
02-02-2008
|
#3 (permalink)
| | Just Joined!
Join Date: Dec 2007
Posts: 7
| Thank you for your reply.
i already have a symbolic link directed to /boot
i press c under grub and use command: kernel /boot/kernel
it returns: [Linux-bzImage. setup=0x2800, size=0x27e8b8]
here's what i have on /dev/sdb5:
[root@localhost disk]# ll
total 2592
lrwxrwxrwx 1 root root 1 2008-02-01 21:03 boot -> ./
drwxr-xr-x 2 root root 4096 2008-02-01 21:38 grub/
-rw-r--r-- 1 root root 2626232 2008-02-01 21:20 kernel
drwx------ 2 root root 16384 2008-02-01 20:59 lost+found/
[root@localhost disk]# file kernel
kernel: Linux kernel x86 boot executable RO-rootFS, root_dev 0x817, swap_dev 0x2, Normal VGA
here's my fstab:
/dev/sdb5 /boot ext2 noauto,noatime 1 2
/dev/sdb7 / ext3 noatime 0 1
/dev/sdb6 none swap sw 0 0
/dev/cdrom /mnt/cdrom audo noauto,ro 0 0
why is the kernel cannot be found  |
| |
02-02-2008
|
#4 (permalink)
| | Linux User
Join Date: Dec 2004 Location: Arkansas
Posts: 380
| It looks to me that your grub install is seeing your usb hard drive as something different than the livecd's are. Either that, or you spelled it wrong and it can't find it.
Ultimately, you will have to boot into grub, and edit your command from inside grub to find your kernel. |
| |
02-02-2008
|
#5 (permalink)
| | Linux Engineer
Join Date: Nov 2007 Location: Córdoba (Spain)
Posts: 1,158
| As I said, use autocompletion when editing your lines in grub interactivery, for both the root and the kernel lines. Quote:
Originally Posted by gruven It looks to me that your grub install is seeing your usb hard drive as something different than the livecd's are. Either that, or you spelled it wrong and it can't find it. | Of course it is. Grub has nothing to do with linux or linux drivers. It is loaded before you enter any OS. Much before the linux kernel takes into scene, and so, the linux configuration and drivers are not relevant here. |
| |
02-05-2008
|
#6 (permalink)
| | Just Joined!
Join Date: Dec 2004 Location: Sydney, Australia
Posts: 3
| Hongtao - if you're still out there.. Quote: |
i can boot into usb drive and get into the page of grub loader, but i got error message "error 15, cannot find file" after i selected.
| As i92guboj suggested, you can use the grub auto-completion feature to see what is on your usb disk. Specifically, when you get the grub prompt type
"root (hd1," - then hit the Tab key, and grub will list the partitions on hd1 and the types if it recognises them. Let's assume that you finished by typing "root (hd1,4) and hit enter. Now type:
"kernel /" - and again hit the Tab key. grub will list the directories and files on that partition. If you *can* see a /boot directory then continue typing "kernel /boot/", then hit the Tab key again, and grub will list the files in the /boot directory. It's a great feature, because you don't have to guess what directories and files are on what partition.
I apologise if this is too obvious for you, but it seems like you are struggling a bit. Let us know how you get on.
Regards, Rob
__________________
Rob D
Gentoo Hack, Hack, Hacker
|
| |
02-06-2008
|
#7 (permalink)
| | Just Joined!
Join Date: Dec 2007
Posts: 7
| thanks robd, i used auto complete to edit grub configuration, but it doesnt help a lot.
this time i reinstall gentoo on another usb hd, sdb2 mount on /, sdb1 mount on /boot and sdb3 for swapping.
i set root hd(0,0), i just guess my laptop may recognize my usb hd as hd0. and i set root=/dev/sdb2
it started booting but i encounter a kernel panic error, it says it cannot mount selected partition... |
| |
02-06-2008
|
#8 (permalink)
| | Linux User
Join Date: Dec 2004 Location: Arkansas
Posts: 380
| What is happening is that the livecd is actually seeing the hard drive as something other than what grub sees it as when you boot up. The livecd may see it as sdb, whereas when you boot up it may actually be sda. It depends on what you have set in your bios, and if your bios is able to boot from usb.
I would bet you can change what hard drive to boot from in the bios.
If your laptop sees the usb hard drive as sda (hd0), then you will want to append your root option on your kernel boot line to root=/dev/sda2.
And in your grub configuration, you want to set your root=(hd0,*) to whatever partition your /boot is mounted on. So, in this case, you would want this: Code: timeout 20
default 0
splashimage=(hd0,0)/boot/grub/splash.xpm.gz
title=Gentoo
root=(hd0,0)
kernel=/boot/kernel-whatever-you-called-it-gentoo root=/dev/sda2
Don't just assume that your usb hard drive is on sdb. |
| |
02-06-2008
|
#9 (permalink)
| | Linux Engineer
Join Date: Nov 2007 Location: Córdoba (Spain)
Posts: 1,158
| Quote:
Originally Posted by hongtao thanks robd, i used auto complete to edit grub configuration, but it doesnt help a lot.
this time i reinstall gentoo on another usb hd, sdb2 mount on /, sdb1 mount on /boot and sdb3 for swapping.
i set root hd(0,0), i just guess my laptop may recognize my usb hd as hd0. and i set root=/dev/sdb2
it started booting but i encounter a kernel panic error, it says it cannot mount selected partition... | That means that it is no longer a grub problem. The bad part is now on kernel (linux, not grub) land. Grub's autocompletion can't help with that, since grub has no clue on how linux would name the dev node. When I say "it is no longer a grub problem" i mean that the ordering and naming of the drives is completely unknown to grub. So, you need to see how the devs are named. The kernel output can help you with that, if you can see it. If not, you will need to try a bit. You will need to edit your root= thingy on grub.conf. Quote:
Originally Posted by gruven What is happening is that the livecd is actually seeing the hard drive as something other than what grub sees it as when you boot up. The livecd may see it as sdb, whereas when you boot up it may actually be sda. It depends on what you have set in your bios, and if your bios is able to boot from usb.
I would bet you can change what hard drive to boot from in the bios.
If your laptop sees the usb hard drive as sda (hd0), then you will want to append your root option on your kernel boot line to root=/dev/sda2.
And in your grub configuration, you want to set your root=(hd0,*) to whatever partition your /boot is mounted on. So, in this case, you would want this: Code: timeout 20
default 0
splashimage=(hd0,0)/boot/grub/splash.xpm.gz
title=Gentoo
root=(hd0,0)
kernel=/boot/kernel-whatever-you-called-it-gentoo root=/dev/sda2
Don't just assume that your usb hard drive is on sdb. | Correct. |
| | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | | | | Thread Tools | | | | Display Modes | Linear Mode |
Posting Rules
| You may not post new threads You may not post replies You may not post attachments You may not edit your posts HTML code is Off | | | | | | Free Magazines | Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business. subscribe | Systems Management News, the newspaper for IT systems administration and data center managers!
Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field. subscribe | The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business. subscribe | Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company. subscribe | Total Telecom Total Telecom is "The Economist of the communications industry". subscribe | | More free magazines » | All times are GMT. The time now is 12:40 PM. |
| |