View previous topic :: View next topic |
Author |
Message |
DawidD n00b
Joined: 07 Feb 2009 Posts: 3
|
Posted: Sat Feb 07, 2009 11:08 am Post subject: Problem with booting from external HD |
|
|
Hi!
I just installed Gentoo on my Western Digital My Book 250 GB. I have two partitions which Gentoo recognizes as /dev/sdb1 and /dev/sdb2. First is /, while second /home. I have grub installed on disk's MBR.
Here's my grub.conf:
Code: |
# This is a sample grub.conf for use with Genkernel, per the Gentoo handbook
# http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=1&chap=10#doc_chap2
# If you are not using Genkernel and you need help creating this file, you
# should consult the handbook. Alternatively, consult the grub.conf.sample that
# is included with the Grub documentation.
default 0
timeout 30
splashimage=(hd0,0)/boot/grub/splash.xpm.gz
#title Gentoo Linux 2.6.24-r5
#root (hd0,0)
#kernel /boot/kernel-genkernel-x86-2.6.24-gentoo-r5 root=/dev/ram0 real_root=/dev/sda3
#initrd /boot/initramfs-genkernel-x86-2.6.24-gentoo-r5
# vim:ft=conf:
title Gentoo
root (hd0,0)
kernel /boot/kernel-2.6.28-gentoo-r1 root=/dev/sdb1
|
And here's my /etc/fstab:
Code: |
# /etc/fstab: static file system information.
#
# noatime turns off atimes for increased performance (atimes normally aren't
# needed; notail increases performance of ReiserFS (at the expense of storage
# efficiency). It's safe to drop the noatime options if you want and to
# switch between notail / tail freely.
#
# The root filesystem should have a pass number of either 0 or 1.
# All other filesystems should have a pass number of 0 or greater than 1.
#
# See the manpage fstab(5) for more information.
#
# <fs> <mountpoint> <type> <opts> <dump/pass>
# NOTE: If your BOOT partition is ReiserFS, add the notail option to opts.
#/dev/BOOT /boot ext2 noauto,noatime 1 2
#/dev/ROOT / ext3 noatime 0 1
#/dev/SWAP none swap sw 0 0
#/dev/cdrom /mnt/cdrom auto noauto,ro 0 0
#/dev/fd0 /mnt/floppy auto noauto 0 0
/dev/sdb1 / ext3 defaults 0 1
/dev/sdb2 /home ext3 defaults 0 2
# glibc 2.2 and above expects tmpfs to be mounted at /dev/shm for
# POSIX shared memory (shm_open, shm_unlink).
# (tmpfs is a dynamically expandable/shrinkable ramdisk, and will
# use almost no memory if not populated with files)
shm /dev/shm tmpfs nodev,nosuid,noexec 0 0
|
But when I try to boot my Gentoo it says "unable to mount root fs" and booting ends with a "kernel panic" error. I noticed that Gentoo first tries to mount /dev/sdb1 on / and after recognizes my USB disk and creates /dev/sdb1 and /dev/sdb2. What should I do to have my partitions recognized before Gentoo tries to mount them?
Dawid |
|
Back to top |
|
|
honp Guru
Joined: 25 Sep 2006 Posts: 355 Location: Good old Prague, Czech rep.
|
Posted: Sat Feb 07, 2009 11:30 am Post subject: |
|
|
I think that hd0,0 is allways sda (ok, it is not allways, but...) so try root=/dev/sda1. |
|
Back to top |
|
|
DawidD n00b
Joined: 07 Feb 2009 Posts: 3
|
Posted: Sat Feb 07, 2009 11:36 am Post subject: |
|
|
Somewhere I read, that grub counts disks according to bios boot order. So, when I want to boot from my USB disk, I have to set it as first device in boot order and it automatically becomes hd0. And it is true - grub boots right system. But when I look at kernel boot messages, there is written that my internal disk is sda and external sdb. I think that there's no mistake in my conf files, but of course I'll check this in a minute.
edit:
It doesn't work. Your solution just boots my old gentoo on /dev/sda1 with kernel from new gentoo placed at /dev/sdb1 |
|
Back to top |
|
|
honp Guru
Joined: 25 Sep 2006 Posts: 355 Location: Good old Prague, Czech rep.
|
Posted: Sat Feb 07, 2009 11:55 am Post subject: |
|
|
Hm, in this case i would advice you to try device mapping in grub, but i am not sure. I have done this in the past but i can`t remember concretly how:(
maybe somethink like this:
File: grub.info, Node: device, Next: dhcp, Prev: color, Up: General commands
Code: | 13.2.3 device
-------------
-- Command: device drive file
In the grub shell, specify the file FILE as the actual drive for a
BIOS drive DRIVE. You can use this command to create a disk image,
and/or to fix the drives guessed by GRUB when GRUB fails to
determine them correctly, like this:
grub> device (fd0) /floppy-image
grub> device (hd0) /dev/sd0
This command can be used only in the grub shell (*note Invoking
the grub shell::). |
but mayby i am totally out... |
|
Back to top |
|
|
DawidD n00b
Joined: 07 Feb 2009 Posts: 3
|
Posted: Sat Feb 07, 2009 12:32 pm Post subject: |
|
|
You didn't understand me My problem is: gentoo tries to mount /dev/sdb1 and /dev/sdb2 in appropriate mountpoints BEFORE they appear in /dev. |
|
Back to top |
|
|
honp Guru
Joined: 25 Sep 2006 Posts: 355 Location: Good old Prague, Czech rep.
|
Posted: Sat Feb 07, 2009 2:32 pm Post subject: |
|
|
Heh you are right... i didn`t read your post well
So in this case try to compile support for your usbdrive into your kernel instead of using modules for usb.
H. |
|
Back to top |
|
|
x22 Apprentice
Joined: 24 Apr 2006 Posts: 208
|
Posted: Sat Feb 07, 2009 2:59 pm Post subject: |
|
|
Try using "rootdelay=<time in seconds>" kernel parameter. Some USB devices need that since they take longer time to be recognized. |
|
Back to top |
|
|
|