Friday, March 8, 2013

Grub2 - saving my Fedora17 - adding a new entry

I  have bought a new SSD and installed Fedora 18 into it. Enabled TRIM on it and nived hime folder and swap out to my cylindar hard disk. Everything worked as planned until i found my fedora 17 boot menu missing.

Now i am looking for a quadruple boot with Windows 7, Fedora 17 ,Fedora 18, and Windows XP. Hmmm issues is with devices i bought during various times and their compatibilty with diff OS versions. Thanls to the reckless manufacturers they dont bother upgrading the drivers of outdated devices

Coming back my plan is to rescue my fedora 17 which disappeared from the boot menu. A little search on Grub bought me here - http://www.dedoimedo.com/computers/grub-2.html#mozTocId514088 .

I found my old boot partition safe in the old disk. I just need the grub to point to there and initiate the boot process. In Olden dys this was simple add them to the menu.1st . I rember doing that during collage days -
set root=(hd0,5)
linux /boot/vmlinuz
initrd /boot/initrd.img
  •  set the root variable to (hd0,5) partition
  •  linux - command loads the linux kernel
  • initrd - Load an initial ramdisk for a Linux kernel image, and set the appropriate parameters in the Linux setup area in memory. This may only be used after the linux command (see linux) has been run


But with Grub2 things have changed. Now you need to add the same as a script and put them into /etc/grub.d folder.

Now to get track of my harddisk location of the boot partition i lost i will have to get to the grub-cli and try out with its auto-complete feature typing root(hd0,....(presstab) .

In my case the linux kernel is
-  vmlinuz-3.7.9-104.fc17.i686
and the ram image is 
- initramfs-3.7.9-104.fc17.i686.img

So i created a script file that does this and add that script file to the /etc/grub.d/. Also chmod it to give executable persmission.

My existing scripts in /etc/grub.d/ are:
sudo ls /etc/grub.d/
00_header  10_linux  20_linux_xen  20_ppc_terminfo  30_os-prober  40_custom  41_custom    README

So i decided to a new file like :
15_fedora17 - OS that is will be in the menu after my default linux fedora 18.

Now you can update the grub.cfg by runnimg grob-makeconfig -o

TO my suprise it automaticaly found my fedora 17 inspite of my manual addition.SO finalyy my grub config had two entries for fedora 17 one made by me and another found by fedora.

When i booted i faced another problem my swap space for fedora 17 was removed..grr
SO i had to change the boot options from grub menu and rename the swap space which was mentione din the boot param rd.lvm.lv=



No comments: