Tag Archives: Boot Options

Grub 2 – Adding a Boot Option

I always forget how to add an option so here is the quick and dirty.

Add to grub 2 by adding a file to the /etc/grub.d/ folder. There are several in there already (those are the current options) Grub organizes them by name so 00_header comes before 10_linux. Add a new file ie: (12_newfile) and edit it in your favorite editor.

I am going to use this file for an install drive from the mini.iso
so you may have to determine what the correct settings are here is my file:

#!/bin/sh -e
echo “#HD Ubuntu Install”
cat << EOF
menuentry “HD Install” {
set root=(hd0,1)
linux /linux
initrd /initrd.gz vga=normal ramdisk_size=14972 root=/dev/rd/0 rw —
}
EOF

The important part is the root=(hd0,1) and the linux/initrd

root is the drive you want to use, for instance if you want to use /dev/sda1 it is (hd0,1) sda2 would be (hd0,2) sdb1 would be (hd1,1) etc.

linux is the linux image names are often: linux vmlinuz

initrd is often initrd.gz  these things can change so best to do a search to get the right options.

Once your write this file you have to make it executable and have grub reconfigure the grub.cfg file, from the command line type:

sudo chmod +x 12_filename

sudo update-grub

Reboot and your new option will be there.

Links:

http://ubuntuforums.org/showthread.php?t=28948

Leave a Comment

Filed under Ubuntu