Logo 
Search:

Unix / Linux / Ubuntu Answers

Ask Question   UnAnswered
Home » Forum » Unix / Linux / Ubuntu       RSS Feeds
  on Feb 11 In Unix / Linux / Ubuntu Category.

  
Question Answered By: Adah Miller   on Feb 11


Ok, that makes sense. I believe the error message woulud indicate it
is not finding the kernel at the specified location. That should
probably happen on the "linux" line. there are a couple of
possiblities that seem reasonable to me:

1) you are pointing at the wrong partition. Did you consider grub2
starts naming partitions at hd0,1 instead of as in grub_legacy which
has first as hd0,0?

2) It may not need "/boot" in front of the direction, instead you could try:
linux /vmlinuz root=/dev/sd5
(i am also suggesting specify the root on this line, could do it with
UUID also ala root=UUID=bunch-of-numbers)

sudo blkid -c /dev/null
that command will give you uuids and show what partitions and lables a
booted OS is seeing

3) does it need full path to headers? like
/boot/vmlinuz-2.6.32.-generic? Or does it do that during update-grub
i wonder...

You proabable know as much or more than i do, but I was spacing and
commenting the script over lunch in case the info helped you. It is
always hard to guess experince level. So I was just adding what
little I understood about it to help before I saw your recent message.
Maybe the formatting will make it?? It would be good for me to
learn a little about grub2 one of these days also.

----- script starts below

#!/bin/sh -e

# lines starting with "#" are comments and not part of the code
# the -e flag up there has something to do with ignoring error, as per
"man bash"

# Message below should be shown while running "sudo update-grub"
# ">&2" redirects the echo to your stderr I think (i.e., your monitor)
# honestly, redirection always confuse me
echo "Adding My OS, please wait..." >&2

# This tells the program "cat" to start working and keep
# going until it sees the string "EOF"
cat << EOF

# The uncommented lines below specify what is gettng
# added to the menu

# obviously, the name that shows up in grub is first
menuentry "My OS" {

# Remember grub2 counts partitions starting from 1
# i.e., first is (hd0,1) instead of (hd0,0) as in grub-legacy
# so change the second number accordingly, or use uuid
set root=(hd0,5)

# Would probably be of benifit to try options like
# root=/dev/sdX ro
# to the end of the next line (but relplace the "X" as appropriate
# yours is sd5 if "hd0,5" is correct
linux /vmlinuz root=/dev/sd5 ro
# you could also do "root=UUID=" followed by uuid

# I REALLY THINK THIS OR SIMILAR IS WHAT IS NEEDED:
# linux /boot/vmlinuz-2.6.31-11-generic root=/dev/sd5 ro
# where you replace the numbers and path with the actual location and
name of the file
# but i'm not 100% sure. couldn't hurt though typle "ls" in /boot
and / to check what is available


# note I left out "/boot" above and below and maybe you need to add
# that back in

initrd /initrd.img
# OR:
# /boot/initrd.img-2.6.31-generic
}
EOF

Share: