Find the answer to your Linux question:
Results 1 to 6 of 6
I'm having problems adding an entry in GRUB2. I have an Arch linux installation on sda4 with its /boot on sda3. Nothing i've tried works. Here's my current entry script: ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Apr 2010
    Posts
    28

    Grub2 problems


    I'm having problems adding an entry in GRUB2. I have an Arch linux installation on sda4 with its /boot on sda3. Nothing i've tried works. Here's my current entry script:
    Code:
    #! /bin/sh
    cat <<EOF
    menuentry "Arch Linux" {
    set root=(hd0,4)
    linux /vmlinuz root=(hd0,3) ro
    initrd /kernel26.img
    EOF
    (Yes, the initial ramdisk is called kernel26. I think this is odd, too.)

    I've tried linux and initrd lines like this as well:

    Code:
    linux (hd0,3)/vmlinuz
    initrd (hd0,3)/kernel26.img

    But that may have been in grub legacy.
    Any pointers?
    Last edited by MikeTbob; 01-03-2011 at 01:49 PM. Reason: Added Code Tags

  2. #2
    Linux Engineer nujinini's Avatar
    Join Date
    Apr 2009
    Posts
    1,272
    Hello fishin4guitars!

    Welcome!

    While waiting for the gurus to clarify on your issue, it might be of help if you can post the output of

    fdisk -l (-l is small -L)
    df -h

    So we can have a better picture of your HD.
    nujinini
    Linux User #489667

  3. #3
    Linux Guru Jonathan183's Avatar
    Join Date
    Oct 2007
    Posts
    3,043
    Here is my entry to boot arch
    Code:
    menuentry "Arch Linux - Use this most of the time ;-)" --class archlinux --class gnu-linux --class gnu --class os {
        echo    Loading Arch Linux from sda1 ...
        insmod ext2
        set root='(hd0,1)'
        search --no-floppy --fs-uuid --set fe38efc3-1346-4a89-8393-0b6416366659
        echo    Loading Linux vmlinuz26 ...
        linux    /boot/vmlinuz26 root=/dev/sda1 ro rootdelay=1
        echo    Loading initial ramdisk ...
        initrd    /boot/kernel26.img
    }
    I don't have a separate boot partition but think you should be able to modify to suit. So your entry should be something like ...
    Code:
    menuentry "Arch Linux - boot sda3, root sda4" --class archlinux --class gnu-linux --class gnu --class os {
        echo    Loading Arch Linux from sda3 ...
        insmod ext2
        set root='(hd0,3)'
        search --no-floppy --fs-uuid --set uuid_for_sda3_goes_here_I_think
        echo    Loading Linux vmlinuz26 ...
        linux    /vmlinuz26 root=/dev/sda4 ro rootdelay=1
        echo    Loading initial ramdisk ...
        initrd    /kernel26.img
    }
    But I am not sure why
    Code:
    grub-mkconfig -o /boot/grub/grub.cfg
    is not generating valid entries.

    What errors do you get when you try to boot your existing entries?

  4. #4
    Linux Guru reed9's Avatar
    Join Date
    Feb 2009
    Location
    Boston, MA
    Posts
    4,651
    Well, I don't use GRUB2, but looking at the Arch Wiki entry, your syntax seems wrong.

    This should be point to the UUID or /dev
    Code:
    linux /vmlinuz root=(hd0,3) ro
    Should probably be
    Code:
    linux /vmlinuz root=/dev/sda4 ro

  5. #5
    Just Joined!
    Join Date
    Apr 2010
    Posts
    28
    Ok. I'll try this. I guess I thought it needed to be in grub's (hdx,y) format to work.

  6. #6
    Just Joined!
    Join Date
    Apr 2010
    Posts
    28
    It actually starts booting, but then it says it can't find something (I can't remember, will update later), and puts me into a ramfs prompt ( [ramfs /]# ).

    --------

    I accidentally created this thread twice. Sorry.

    --------

    It can't find /sbin/init.

    --------

    Also, how did you set up your install so that there was no /boot partition? I've tried, and every time I've ended up with no /boot.
    Last edited by fishin4guitars; 01-06-2011 at 01:17 AM. Reason: question

Posting Permissions

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