Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I wanted to add new menu entry to my GRUB2 list. This is how I tried to do this and necessary info:

Erros after choosing "Debian Wheezy" menu entry from GRUB2 list:

error:file not found
error:you need to load the kernel first

/etc/grub.d/12_debian

#!/bin/sh -e
cat << EOF
menuentry "Debian Wheezy" {
set root=(hd0,5)
linux /boot/vmlinuz-3.2.0-3-amd64
initrd /boot/initrd.img-3.2.0-3-amd64
}
EOF

ls /boot

config-3.2.0-3-amd64  initrd.img-3.2.0-3-amd64  vmlinuz-3.2.0-3-amd64
grub                  System.map-3.2.0-3-amd64

Partitioning

sda1 - ntfs - Windows boot
sda2 - ntfs - Windows C:
sda3 - ntfs - Windows D:
sda4 - extended
-sda5 - ext4 - /boot
-sda6 - lvm - Debian testing
And inside sda6 there's LVM group calld G1 divided into volumes:
home, root, tmp, usr, var, swap

Sources that I used during my unsuccessful of setting everything up.

GRUB2 Naming convention

GRUB 2 bootloader - Full tutorial on Dedoimedo.com

What's wrong? Sorry, I'm still a newbie.

EDIT #1

fdisk -l

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048      206847      102400    7  HPFS/NTFS/exFAT
/dev/sda2          206848    83473739    41633446    7  HPFS/NTFS/exFAT
/dev/sda3        83473799   935802314   426164258    7  HPFS/NTFS/exFAT
/dev/sda4       935802315   976771071    20484378+   f  W95 Ext'd (LBA)
/dev/sda5       935802880   936779775      488448   83  Linux
/dev/sda6       936781824   976771071    19994624   8e  Linux LVM

EDIT #2

Grub console

linux /[TAB]
Possible files are:
lost+found/ bin/ share/ sbin/ lib/ include/ src/ games/ local/

set root=(hd0,msdos5)
linux/[TAB]
Possible files are:
lost+found/ config-3.2.0-3-amd64 vmlinuz-3.2.0-3-amd64 grub/ 
System.map-3.2.0-3-amd64 initrd.img-3.2.0-3-amd64

Grub console, boot test

set root=(hd0,msdos5)
linux /vmlinuz-3.2.0-3-amd64 root=/dev/G1/root
initrd /initrd.img-3.2.0-3-amd64
boot

#Many, many, many lines of text. After few seconds they stop. The most
#interesting i think are:

ALERT! /dev/G1/root does not exist. Dropping to a shell!
/bin/sh: can't access tty; job control turned off

/etc/grub.d/12_debian another try

#!/bin/sh -e
cat << EOF
menuentry "Debian Wheezy" {
insmod ext4
set root=(hd0,msdos5)
echo 'loading...'
linux /vmlinuz-3.2.0-3-amd64
echo 'starting kernel...'
initrd /initrd.img-3.2.0-3-amd64
}
EOF

Result:

error:file not found
loading...
starting kernel...

EDIT #3

part of /boot/grub/grub.cfg

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Debian GNU/Linux, with Linux 3.2.0-3-amd64' --class debian --    class gnu-linux --class gnu --class os {
    insmod gzio
    insmod lvm
    insmod part_msdos
    insmod ext2
    set root='(G1-root)'
    search --no-floppy --fs-uuid --set=root 94215fad-dcbe-4339-92be-f562b1b37133
    echo    'Loading Linux 3.2.0-3-amd64 ...'
    linux   /boot/vmlinuz-3.2.0-3-amd64 root=/dev/mapper/G1-root ro  quiet
    echo    'Loading initial ramdisk ...'
    initrd  /boot/initrd.img-3.2.0-3-amd64
}
### END /etc/grub.d/10_linux ###

/etc/grub.d/12_debian next try

#!/bin/sh -e
cat << EOF
menuentry "Debian Wheezy" {
insmod ext4
set root=(hd0,msdos5)
echo 'loading...'
linux /vmlinuz-3.2.0-3-amd64 root=/dev/mapper/G1-root
echo 'starting kernel...'
initrd /initrd.img-3.2.0-3-amd64
}

Result

error:file not found
loading...
starting kernel...
share|improve this question

3 Answers 3

Because you have a dedicated /boot partition ( you probably don't need one ), that partition has no directory named /boot, hence why the files are not found. Remove the /boot from the path.

share|improve this answer
menuentry "Debian Wheezy" {
insmod ext4
set root='(hd0,msdos5)'
echo 'loading ..'
linux /boot/vmlinuz-3.2.0-3-amd64
echo 'starting kernel ...'
initrd /boot/initrd.img-3.2.0-3-amd64
}
share|improve this answer
    
Still, the same problem: error: file not found. loading... error:file not found. starting kernel... error:you need to load the kernel first Where I could make a mistake? Maybe there's something I could check that'll help with diagnosis? I've posted "fdisk -l" in my question. –  r4czek Sep 22 '12 at 9:46
    
I will suggest you to first troubleshoot it at grubs command prompt. Probably grub is unable to locate the file.You can put command in line by line order, and use tab key to see if grub can locate the file.Example linux [press TAB]/boot/[press TAB] if your file is listed then its some other problem otherwise use a right value in set root –  perilbrain Sep 22 '12 at 16:07
    
I think that there's some progress... I added some new info in my first post! –  r4czek Sep 24 '12 at 22:48
    
@r4czek:- Can you paste your grub.cfg somewhere where I can read.I'll recommend to copy paste the contents from some other menu after linux /boot/vmlinuz-3.2.0-3-amd64. like root=UUID=... OR root=/dev/disk/by-id/... –  perilbrain Sep 25 '12 at 14:27
    
@perlibrain That was my first guess and I've tried it without success... I posted everything you asked for and another try with my menuentry. PS. Thank you for your endurance and help! –  r4czek Sep 26 '12 at 18:42

Hmmm...old thread but it seems like it was never resulted in working answer. I recently had a similar issue which is now fixed. For others with similar issues I recommend changing

set root='(hd0,msdos5)'

to the following

 search --no-floppy --fs-uuid --set=root '5bbd33b6-3333-3a33-3333-8045d333bb63'

where 1234-567A is the UUID for the desired partition obtained from

sudo blkid /dev/sda5

The result of which will look something like the following.

/dev/sda1: LABEL="SYSTEM" UUID="5bbd33b6-3333-3a33-3333-8045d333bb63" TYPE="ext4" PARTLABEL="EFI system partition" PARTUUID="0c33e3ab-d3dc-3af3-333d-a33eee3c333c"
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.