[lug] grub2 boot (ubuntu 10.04)

rm at tuxteam.de rm at tuxteam.de
Tue Aug 23 10:19:43 MDT 2011


On Thu, Aug 18, 2011 at 10:52:29PM -0600, Davide Del Vento wrote:
> I have just installed Ubuntu 10.04 on a machine. Now, it refuses to
> boot by itself, it stops at the grub> prompt.
> If I type
> 	
> linux /vmlinuz root=/dev/sda1 ro
> initrd /initrd.img
> boot
> 
> It boots fine and everything works. However I need this machine
> booting by itself, I cannot be there in person at each reboot. I tried
> to modify /etc/default/grub according to the stuff I manually type,
> without any success (in particular, I changed the
> GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" to either "ro" or
> "root=/dev/sda1 ro" and I also tried to uncomment
> GRUB_DISABLE_LINUX_UUID="true" since it's an old laptop). No way, it's
> a lonely machine which wants company of an human being.
> 
> Suggestions?
> Thanks a lot
> Davide

As a starter, you could turn your grub shell commands into a menu entry:

menuentry "Davide's Personal Setup" {
  linux /vmlinuz root=/dev/sda1 ro
  initrd /initrd.img
}

 Now, I strongly suggest giving grub some info about the partition your
kernel and initrd can be found.

menuentry "Davide's Personal Setup" {
  linux (hd0,1)/vmlinuz root=/dev/sda1 ro
  initrd (hd0,1)/initrd.img
}

(assuming that's where they are). Next you want to integrate this into
the update-grub magic. Create a shell script in /etc/grub.d/ that 
prints above text to standard output. We want this menu entry to show
up before the standard autogenerated ubuntu/debian stuff so name it
09_custom or similar (run order is similar to init scripts):

-------------- file: /etc/grub.d/09_custom ----------------------------
#!/bin/sh -e

cat <<EOF

menuentry "Davide's Personal Setup" {
  linux /vmlinuz root=/dev/sda1 ro
  initrd /initrd.img
}

EOF
-----------------------------------------------------------------------

Make that script executable (sudo chmod 755 /etc/grub.d/09_custom) and
update your grub config (sudo update-grub).
That's all.

HTH Ralf Mattes


> PS: I'm getting crazy, now that I was becoming familiar with grub and
> its menu.lsf, they come out with this crappy grub2. GRRRR I want LILO
> back (I'm ok with putting the kernel at the beginning of the disk,
> what else was wrong with it?) - I know, I still could do it, but then
> it'll break the automatic updates of the kernel, so that's not an
> option.
> _______________________________________________
> Web Page:  http://lug.boulder.co.us
> Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug
> Join us on IRC: irc.hackingsociety.org port=6667 channel=#hackingsociety



More information about the LUG mailing list