Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 12
I'm trying to install Gentoo (it's been awhile) and I'm having trouble with my /boot/grub/grub.conf. My hard drive has four partitions: /dev/sda1= HPFS/NTFS /dev/sda2 = boot /dev/sda3 = swap /dev/sda4 ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Nov 2006
    Posts
    30

    grub.conf


    I'm trying to install Gentoo (it's been awhile) and I'm having trouble with my /boot/grub/grub.conf.
    My hard drive has four partitions:

    /dev/sda1= HPFS/NTFS
    /dev/sda2 = boot
    /dev/sda3 = swap
    /dev/sda4 = /

    grub.conf is as folllows (per the Gentoo Handbook as best I can tell)

    default 0
    timeout 8

    title Gentoo Linux 2.6.32-r7
    root (hd0,1)
    kernel /boot/linux-2.6.32-gentoo-r7 root=/dev/sda4

    title Gentoo Linux 2.6.32-r7 (rescue)
    root (hd0,1)
    kernel /boot/linux-2.6.32-gentoo-r7 root=/dev/sda4 init=/bin/bb

    title Windows XP
    rootnoverify (hd0,0)
    makeactive
    chainloader +1

    When I try to boot I get my menu.lst but then

    Root-NFS No NFS server available, giving up
    VFS: Unable to mount root fs via NFS, trying floppy
    VFS: Cannot open root device "sda4" or unknown-block(2,0)
    Please append a correct "root=" boot option
    Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(2,0)

    The way I understand writing the grub file is 'drive' and then 'partition'
    sda1=(hd0,0)
    sda2=(hd0,1)
    sda3=(hd0,2)
    sda4=(hd0,3)

    What am I missing?

  2. #2
    Just Joined!
    Join Date
    Jul 2008
    Posts
    93
    Since you have /boot on a separate disk partition (hd0,1) and the kernel is in the /boot partition, the lines should read:
    root (hd0,1)
    kernel /linux-2.6.32-gentoo-r7 root=/dev/sda4 init=/bin/bb

    When grub is reading grub.conf /boot is not yet mounted and so its contents are found at the root of (hd0,1).

    The first occurence of the word "root" tells grub where to look for the Linux kernel. The second occurence of the word "root" tells the kernel where to look for the file system.

  3. #3
    Just Joined!
    Join Date
    Nov 2006
    Posts
    30

    thanks, but...

    that didn't work. And linux-2.6.32-gentoo-r7 is in the boot directory. I really did follow the Gentoo Handbook to the letter, except having Windows on sda1 which moved evrything else up (boot to sda2, swap to sda3, / to sda4). Otherwise I slowly, painfully, and exactly did everything step by step with the manual. And if you look at the handbook (Code Listing 2.3) it shows

    title Gentoo Linux 2.6.31-r6
    # Partition where the kernel image (or operating system) is located
    root (hd0,0)
    kernel /boot/kernel-2.6.31-gentoo-r6 root=/dev/sda3

    (I named it 'linux-2.6... rather than kernel-2.6...)

    heeelllllllllp!

  4. #4
    Linux Enthusiast meton_magis's Avatar
    Join Date
    Oct 2006
    Location
    arizona
    Posts
    699
    did you compile your own kernel? Did you include (I'm guessing) ext2/3/4 support into your kernel, and not as a module?

    If you make your filesystem drivers modules, you have to make an initrd, which is something I've never done.

    you also need to make sure your sata bus drivers are compiled into the kernel, and not a module.

    getting hard drives / filesystems recognized are one of the most difficult things to get done in the gentoo install process, but once you have it done, everything starts to become easier.
    New to the internet, technical forums, or the hacker / open source community??
    Read this to learn good posting habits http://www.catb.org/~esr/faqs/smart-questions.html

    RHCE for RHEL version 5
    RHCT for RHEL version 4

  5. #5
    Just Joined!
    Join Date
    Jul 2008
    Posts
    93
    Quote Originally Posted by crito View Post
    that didn't work. And linux-2.6.32-gentoo-r7 is in the boot directory. I really did follow the Gentoo Handbook to the letter, except having Windows on sda1 which moved evrything else up (boot to sda2, swap to sda3, / to sda4). Otherwise I slowly, painfully, and exactly did everything step by step with the manual. And if you look at the handbook (Code Listing 2.3) it shows

    title Gentoo Linux 2.6.31-r6
    # Partition where the kernel image (or operating system) is located
    root (hd0,0)
    kernel /boot/kernel-2.6.31-gentoo-r6 root=/dev/sda3

    (I named it 'linux-2.6... rather than kernel-2.6...)

    heeelllllllllp!
    The Gentoo Handbook assumes that you have /boot as a part of the same disk partition that contains /. You do not. Therefore the advice in the handbook does not fit your situation.

  6. #6
    Just Joined!
    Join Date
    Nov 2006
    Posts
    30
    Clowenstein

    I'm really not following you. The Gentoo handbook sets up 3 partitions:
    sda1=boot (Code Listing 3.6: Creating the boot partition)
    sda2=swap (Code Listing 3.8: Creating a swap partition)
    sda3= / (Code Listing 3.9: Partition listing after creating the root partition)

    I did the same thing, only
    sda1=NTFS
    sda2=boot
    sda3=swap
    sda4= /

    Under Code Listing 5.1: Mounting partitions
    mount /dev/sda3 /mnt/gentoo
    mkdir /mnt/gentoo/boot
    mount /dev/sda1 /mnt/gentoo/boot

    I dont see where boot (sda1) and / (sda3) are in the same partition in the Handbook.

    Not that I'm being a smart*** or anything, I appreciate your help. And I did try taking your advice, didn't work.

    meton_magis
    thanks, all compiled in the kernel, no modules.

  7. #7
    Just Joined!
    Join Date
    Jul 2008
    Posts
    93
    Quote Originally Posted by crito View Post
    Clowenstein

    I'm really not following you. The Gentoo handbook sets up 3 partitions:
    sda1=boot (Code Listing 3.6: Creating the boot partition)
    sda2=swap (Code Listing 3.8: Creating a swap partition)
    sda3= / (Code Listing 3.9: Partition listing after creating the root partition)

    I did the same thing, only
    sda1=NTFS
    sda2=boot
    sda3=swap
    sda4= /

    Under Code Listing 5.1: Mounting partitions
    mount /dev/sda3 /mnt/gentoo
    mkdir /mnt/gentoo/boot
    mount /dev/sda1 /mnt/gentoo/boot

    I dont see where boot (sda1) and / (sda3) are in the same partition in the Handbook.

    Not that I'm being a smart*** or anything, I appreciate your help. And I did try taking your advice, didn't work.

    meton_magis
    thanks, all compiled in the kernel, no modules.
    Yes but did the Gentoo handbook tell you how to comple the Grub installation?

    I can't find any good references specifically for Gentoo but Grub is operating-system agnostic. Read carefully the first part of the RedHat 7.3 instructions.
    <http://www.redhat.com/docs/manuals/linux/RHL-7.3-Manual/custom-guide/s1-custom-kernel-bootloader.html>, especially the line "If you created a separate /boot partition".

    You _have_ created a separate /boot partition, and the file path information which you give to grub must be relative to that partition.

  8. #8
    Just Joined!
    Join Date
    Nov 2006
    Posts
    30
    officially giving up and going back to debian. I just don't understand this. I am following the Gentoo Handbook EXACTLY. I can look in /boot and SEE 'kernel-2.6.32-gentoo-r7. I can fdisk -l and see / files are on sda4. Restart, boot menu comes up, can't find sda4. And I have a hard and fast rule of never spending more than 2 days trying to install an OS.

    Oh well, maybe some other day

  9. #9
    Linux Enthusiast meton_magis's Avatar
    Join Date
    Oct 2006
    Location
    arizona
    Posts
    699
    Quote Originally Posted by crito View Post
    officially giving up and going back to debian. I just don't understand this. I am following the Gentoo Handbook EXACTLY. I can look in /boot and SEE 'kernel-2.6.32-gentoo-r7. I can fdisk -l and see / files are on sda4. Restart, boot menu comes up, can't find sda4. And I have a hard and fast rule of never spending more than 2 days trying to install an OS.

    Oh well, maybe some other day
    sorry to hear this. Gentoo is definitely not an OS to use if you are short on patience, it requires a lot of work on the user's part. I think that this is an issue of your kernel recognizing your hard drive or filesystem. I had the same issues when I tried Gentoo the first few times, and it didn't work until I just experimented like crazy for a weekend. The problem with the Gentoo handbook is that there are SO many types of computers, they can't predict how the kernel should be compiled for all of them. The other distros get around this by compiling EVERYTHING into the kernel. This is specifically what Gentoo is about, optimizing the OS for your system. It is a lot of fun if you get into tweaking your system, but it's not for those who just want it to work.
    New to the internet, technical forums, or the hacker / open source community??
    Read this to learn good posting habits http://www.catb.org/~esr/faqs/smart-questions.html

    RHCE for RHEL version 5
    RHCT for RHEL version 4

  10. #10
    Linux Guru Jonathan183's Avatar
    Join Date
    Oct 2007
    Posts
    3,042
    Quote Originally Posted by crito View Post
    I am following the Gentoo Handbook EXACTLY. I can look in /boot and SEE 'kernel-2.6.32-gentoo-r7. I can fdisk -l and see / files are on sda4.
    if you have not already formatted the hard drive then you could try
    Code:
    title Gentoo Linux 2.6.32-r7
    root (hd0,1)
    kernel /linux-2.6.32-gentoo-r7 root=/dev/hda4

Page 1 of 2 1 2 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •