Monday 8 December 2014

Install Grub Boot option - after installing new distro

Install new distro on spare partition or disk. Do not install grub! Boot up original distro (Debian 7 here).
root@sonsmon:/home/sont# update-grub
Generating grub.cfg ...
Found background image: /usr/share/images/desktop-base/desktop-grub.png
Found linux image: /boot/vmlinuz-3.2.0-4-amd64
Found initrd image: /boot/initrd.img-3.2.0-4-amd64
Found CentOS release 5.11 (Final) on /dev/sda2
done

root@sonsmon:/home/sont# cd /boot/grub
root@sonsmon:/boot/grub# vi grub.cfg
### BEGIN /etc/grub.d/30_os-prober ###
menuentry "CentOS release 5.11 (Final) (on /dev/sda2)" --class gnu-linux --class gnu --class os {
        insmod part_msdos
        insmod ext2
        set root='(hd0,msdos2)'
        search --no-floppy --fs-uuid --set=root d87e04c9-0742-46d7-8ad7-39835b144cc8
        multiboot /boot/xen.gz-2.6.16.400.el5
        linux /boot/vmlinuz-2.6.18-400.el5xen root=/dev/sda2
        initrd /boot/initrd-2.6.18-400.el5xen.img
}
### END /etc/grub.d/30_os-prober ###
Create a new boot initrd image loaded with drivers:
[root@localhost ~]# cd /boot
[root@localhost boot]# mkinitrd -v --omit-scsi-modules --preload=xenblk --with=xennet --builtin=virtio_pci --builtin=virtio_blk --builtin=xen_vbd initrd-xen-para-son.img 2.6.18-400.el5xen