Tuesday, March 6, 2012

Verbose or Silent

When booting up OpenSuSE normally you will see the clean and green splash screen and if you want to see what is going on behind it you need to press the escape button. Now if you want to change it permanently and not having press the button every time you boot you need to do the following.

1. Legacy GRUB
If you are using the old legacy grub you can edit menu.lst directly or by using
   yast2 bootloader. 

When you are log in as a normal user open up a terminal and run.
  •  su root -c'grep -i silent  --colour=auto /boot/grub/menu.lst' 

Enter the root's password and you should see the red text that matches the string silent. This is the option the controls what to display during boot up. silent means to show nothing during the boot process you can do a quick edit to it by using perl. As always we need to back up everything we are editing as a good practice.


First backup menu.lst
  •   su root -c'cp /boot/grub/menu.lst /boot/grub/menu.lst.orig' 

To edit that menu.lst file
  •  su root -c"perl -pi -e 's/silent/verbose/g' /boot/grub/menu.lst" 

Since perl is not a file editor a lot of folks will raise some eyebrows about the code above. Ex is an editor so it is prefered over perl. As root run.
  •    ex -sc "%s/silent/verbose/g|x" /boot/grub/menu.lst  

Check if that did the trick run grep again but with the verbose string.
  •   su root -c'grep -i verbose --colour=auto /boot/grub/menu.lst' 

If that will show the verbose string in it then you are successful. You can now reboot and check if it works,  well it should  but just to be  sure.

2. GRUB 2
Menu.lst is replaced by /etc/default/grub if your using grub2. To be able to edit that file you need to be root.

Again backup the files you are editing.
  •  cp -v /etc/default/grub /etc/default/grub.orig 

Edit that file using ex.
  •    ex -sc "%s/silent/verbose/g|x" /etc/default/grub  
Check if it made the changes. As a normal user you have read access to that file so you dont need to be root to check it unlike menu.lst. As a normal user you can run.
  •   grep -o verbose /etc/default/grub || { echo "It is not verbose." >&2; }  
      You should see a red colored  verbose  ouput in your screen. If you see permission denied then that means you dont have read permission on that file so you need to run the latter command with root rights :-)

      Now backup first /boot/grub2/grub.cfg
      •  cp -v /boot/grub2/grub2.cfg /boot/grub2/grub2.cfg.orig 

      To make the changes recognize by grub2 as root run.
      •   grub2-mkconfig -o /boot/grub2/grub.cfg  

      For some reason you cannot boot because of some grub error's most probably you did something un intended :-) you need to boot from the live media and mount the partition where your /boot directory resides normally if you did not make a separate boot partition that menu.lst file is in the root partition so it will depend on your partition set up. first moun that partition and then copy that menu.lst back to its original name.

      Mount the partition where your menu.lst is located.
      •   su root -c'mount /dev/sXX /mnt' 

      Replace XX with the correct value.

      Legacy grub.
      To restore the original menu.lst file
      •   su root -c'cp /mnt/boot/grub/menu.lst.orig /mnt/boot/grub/menu.lst' 

      GRUB2
      •  cp -v /mnt/etc/default/grub.orig /mnt/etc/default/grub    
      •  cp -v /mnt/boot/grub2/grub2.cfg.orig /mnt/boot/grub2/grub.cfg 

      Where /mnt is the mount point where your disk is mounted it could be in  /media as well but here we choose that directory. umount that root partition and reboot, all should be fine now and start from the beginning.

      Happy booting!

      Last Edited: Sat Aug 31 07:47:45 PHT 2013


      No comments:

      Post a Comment