Sunday, August 25, 2013

OpenSuSE on usb grub2

Since 12.2 release opensuse has grub2 as an option to use. Come 12.3 it is the default grub in the installation but you can always choose to use the old legacy grub. As of this time of my blog entry Aug 2013, grub2 is still in development but usable (so they say :P ).

Then if your using the old legacy grub  suse has some options to edit the necessary entry in order to boot your system when it has some boot issues.
Sadly if you use grub2 then it is only limited to the following:







































As you can see theres a lot of missing files to be edited unlike old legacy grub.
Well some files were either renamed or removed completely. Grub2 has the following (but not limited to)  files:

1. /boot/grub2/.device.map
2. /etc/default/grub
3. /boot/grub2/grub.cfg
4. /etc/grub.d/

 If your going to do a usb install  then you should not follow the suggested partitioning from the installer since i may offer to use the existing internal partitions or worst suggest to delete it completely. Untick the "proposed separate home partition". Choose create partition setup and check your other partitions if they are mounted automagically by the installer if it is indeed mounted then umount it. The partitioning i suggest is to make the first part the root and if you really need a separate /home then put it in the second partition. A swap partition will be the last. Other wise you will be thrown at the grub prompt during the first reboot ;-(.



You will probablly will encounter some errors similar to  this.









This is to be expected, dont worry you can just copy the error somewhere.

Let it reboot after the installation and boot again from the dvd and choose installation in the menu. 




































































































































































































Once booted to your system you can  do the following commands.

echo '(hd0)  /dev/disk/by-id/ata.....' > /boot/grub2/device.map

Make sure you got the correct id of you disk.
----

  grub2-install --force /dev/sda1  

/dev/sda1 is my root partition so point it to yours.

Yo will get a WARNING but the important message is the last.







----


    grub2-mkconfig -o /boot/grub2/grub.cfg     

----
    /sbin/mkinitrd/     


Now if you will not see any errors from the last command then it is safe to reboot.

This hack is also true if you cloned your disk. This does not apply to efi system since i do not have any close encounter with EFI (at least not yet :P )

Enjoy folks!