Tag Archives: GNU GRUB

Repair GRUB on IBM Thinkpad – The best Linux solution

When you decide to add another OS to the usual OS on your PC you can potentially damage your grub package. The Grub (GNU GRand Unified Bootloader) is the “soul” of you hardware, the program which allows your PC to find the OS during the boot-up.

Today we will not discuss about the old and new malware that are able to influence the GRUB but we will focus our attention on how repairing your computer when you see grub rescue> on your black screen…

The first solution you can find on internet is a detailed command solution but it was unfortunately usefulness in my case because my PC was not able to correctly accept the insmod command. Consequently I decided to use a portable rescue CD-USB to fix the matter.

Normally, if you use an Ubuntu derived OS, you can use Boot-Repair and it will semi-automatically fix your Grub problem in just few minutes. In any case, it is moderately easy but you have to be 100% sure about what HD partition you want to repair. As usual, this wasn’t my case. I had to find something more generic -in term of serviced OS- but effective.

At the end I bumped into the Boot Repair Disk. I had just to burn the free iso on a RW DVD and I could start to test it on my “out of service” laptop. The Boot Repair live CD is a wonderful tool! As soon as you boot up the live CD, Boot Repair guides you to the best possible solution. You have just to follow the suggestion on the screen and, in few minutes, the Boot Repair Disk is able to fix the Grub and to perfectly restore your computer.

Easy, Fast, Effective!! AddThis

Reinstalling and Fixing Grub 2 by NixiePixel

AddThis

Recovering the GRUB 2 Boot Loader by cgermany77

AddThis

How to manage the GRUB and purge old Kernel versions on the start-up menu

After a kernel update, you find the start-up menu populated with extra lines related to all the old kernel versions plus the current one. To manage the start-up manager and safely remove old kernels you have to manually operate on it.
First of all you have to double-check what is the current kernel version.
Open a Terminal and type:
uname -r
The result will be something similar to: 2.6.32-35-generic
Then you will go to the boot directory through the command:
cd /boot ls vmlinuz*
The next step will be to obtain more information about old kernel you have on our PC:
ls vmlinuz*
Now in the Terminal you have results similar to these:
vmlinuz-2.6.32-21-generic  vmlinuz-2.6.32-25-generic  vmlinuz-2.6.32-35-generic
vmlinuz-2.6.32-24-generic  vmlinuz-2.6.32-26-generic
As last step you have to remove all the old version of the kernel using this command:
sudo apt-get remove linux-image-X.X.XX-XX-generic
where “x” is the obsolete kernel version you want to purge. In my specific case the proper command line I used was:
sudo apt-get remove linux-image-2.6.32-21-generic linux-image-2.6.32-24-generic linux-image-2.6.32-25-generic linux-image-2.6.32-26-generic
Last but not least go to System –> Administration –> StartUp Manager (available for installation on Synaptics or on Ubuntu Software Center) and select your OS choice in the Default Operating System menu. That’s all! AddThis

Video – Change GRUB menu list by curemind

AddThis

How to Change the Boot Order in Ubuntu

If you installed Ubuntu and Windows at the same time, you probably noticed that when you start your computer you can choose what operating system to launch. The responsible software for this is usually the GRUB loader and its menu. Obviously, after you install Ubuntu, it is placed as the first option and if you do not explicitly choose Windows in a few seconds, Ubuntu will be started. But what if you want Windows as your default option? Here is how you change the order:

1. Launch a new Ubuntu Terminal (Applications, Accessories). Type in the following command:

sudo cp /boot/grub/menu.lst /boot/grub/menu.lst_backup

This will create a backup of the GRUB configuration file.

2. Now open the file. We’ll do it with a new command:

sudo gedit /boot/grub/menu.lst

You will be prompted for a password, after which a text editor will be launched. In most of the situations, the menu.lst file contains many comments. You have to search for a line that says

default 0

This should not be very far from the end of file. Here you will have to intervene. After a few lines you will the variable called ‘timeout’ and its value (10 by default). If you want to have more or less time available for choosing your operating system, change the 10 with what number you want.

So back to the boot sequence. Scroll through the file again until you find:

title Ubuntu, kernel 2.6.17-10-generic

There will be more titles. Count the order number of Windows, but start from 0. The value you choose should overwrite the default one. For example, if Windows is the 4th title in the list, you will need to type

default 4

instead of ‘default 0’, which was described above. All you need to do at this point is to save the file and restart your computer. AddThis

Recovering root password under Linux with single user mode

It happens sometime that you can’t remember root password. On Linux, recovering root password can be done by booting Linux under a specific mode: single user mode.
This tutorial will show how to boot Linux in single user mode when using GRUB and finally how to change root password.
During normal usage, a Linux OS runs under runlevels between 2 and 5 which corresponds to various multi-user modes. Booting Linux under runlevel 1 will allow one to enter into a specific mode, single user mode. Under such a level, you directly get a root prompt. From there, changing root password is a piece of cake.
Some Linux distribution, such as Ubuntu for instance, offer a specific boot menu entry where it is stated “Recovery Mode” or “Single-User Mode“. If this is your case, selecting this menu entry will boot your machine into single user mode, you can carry on with the next part. If not, you might want to read this part.
Using GRUB, you can manually edit the proposed menu entry at boot time. To do so, when GRUB is presenting the menu list (you might need to press ESC first), follow those instructions:
– use the arrows to select the boot entry you want to modify.
– press e to edit the entry
– use the arrows to go to kernel line
– press e to edit this entry
– at the end of the line add the word: single
– press ESC to go back to the parent menu
– press b to boot this kernel
The kernel should be booting as usual (except for the graphical splash screen you might be used to), and you will finally get a root prompt (sh#).
Here we are, we have gained root access to the filesystem, let’s finally change the password.
As root, changing password does not ask for your old password, therefore running the command:
# passwd
will prompt you for your new password and will ask you to confirm it to make sure there is no typo.
That’s it, you can now reboot your box and gain root access again. AddThis mp3 link