V
3  
Tags
Attachments
Dobrica Pavlinušić's random unstructured stuff
grub

Examples of grub usage (as a reminder mostly)



install

Sometimes, grub-install won't owerwrite MBR. If that happends, first reinstall MBR and then grub:

install-mbr /dev/sda
grub-install /dev/sda

If you forget to make /boot/grub/menu.lst (as I did), you will have to do a lot of typing in grub console, so be sure to also run

update-grub

LVM gotchas

There is also corner-case when you have lvm compiled into kernel and /boot partition on LVM. grub will be confused, and simplest solution that I found so far is to move /boot to partition. If you don't have any free space handy, you might try to move swap to LVM and /boot onto swap partition.

fallback

After you have installed grub, you might want to configure fallback kernels. First configure different kernels, with fail-safe one as last one:

/boot/grub/menu.lst

default         saved

fallback        1 2

title           OpenVZ 2.6.18-028test010
root            (hd0,2)
kernel          /vmlinuz-2.6.18-028test018 root=/dev/mapper/vg-root ro
initrd          /initrd.img-2.6.18-028test018
savedefault     fallback
boot

title           Debian GNU/Linux, kernel 2.6.18-028test007.2-ovz-enterprise
root            (hd0,2)
kernel          /vmlinuz-2.6.18-028test007.2-ovz-enterprise root=/dev/mapper/vg-root ro
initrd          /initrd.img-2.6.18-028test007.2-ovz-enterprise
savedefault     fallback
boot

title           Debian GNU/Linux, kernel 2.6.18-3-686
root            (hd0,2)
kernel          /vmlinuz-2.6.18-3-686 root=/dev/mapper/vg-root ro
initrd          /initrd.img-2.6.18-3-686
savedefault
boot

Here is simplier alternative:

default         0

fallback        1

title Debian GNU/Linux
root (hd0,0)
kernel /boot/vmlinuz root=/dev/md0 reboot=warm

title Debian GNU/Linux, with the old kernel
root (hd0,0)
kernel /boot/vmlinuz.old root=/dev/md0 reboot=warm

Then setup reset to default kernel (0) upon successful boot. On debian, you can just add following line in /etc/rc.local:

grub-set-default 0

You might also want to run this once by hand, so that first boot is in first kernel (most recent one presumably).


 

Upload Files

Click "Browse" to find the file you want to upload. When you click "Upload file" your file will be uploaded and added to the list of attachments for this page.

Maximum file size: 50MB

 
 
 
File Name Author Date Uploaded Size

Save Page As

Enter a meaningful and distinctive title for your page.

Page Title:

Tip: You'll be able to find this page later by using the title you choose.

Page Already Exists

There is already a page named XXX. Would you like to:

Save with a different name:

Save the page with the name "XXX"

Append your text to the bottom of the existing page named: "XXX"

Upload Files

Click "Browse" to find the file you want to upload. When you click "Add file" this file will be added to the list of attachments for this page, and uploaded when you save the page.

 
 
 
Add Tags

Enter a tag and click "Add tag". The tag will be saved when you save the page.

Tag: 

Suggestions: