Feeds:
Posts
Comments

Posts Tagged ‘GRUB’

When initramfs (the initial ramdisk filesystem used to boot into Ubuntu) is updated, whether it be during an official upgrade or through some manual tinkering, the last thing you want to happen is get an error message. More often than not, when you reboot, you won’t be able to get to your desktop, so it’s best to tackle any issues before you do so.

If you were lucky enough to see the initramfs update fail in the terminal, you can usually have success by running it again. If you updated or upgraded your system and didn’t even know anything went wrong until you failed to log in again, there are still ways to get around this.

You’ll find a few different approaches to various error messages, so hopefully something here will be of use to you. When it comes to specific firmware issues, you may need to start a thread at the Ubuntu forums (quite often, someone will point you towards a patch). Best of luck!

Last Resort for Boot Failure Due to initramfs Error

I’ve listed this first, as in most cases it will work, but it should be your last resort. When booting, choose an earlier kernel from the GRUB list, and you should be able to get to your desktop to fix things. Technically, you really should avoid this, especially if you’ve just upgraded Ubuntu and the kernel along with it, since running certain commands may complicate things, or just waste your time. For example, it’s no use recompiling initrd.img when you’ll be doing so to the one for the previous kernel.

But you can use this method to get to your desktop, search the forums and web for answers, and edit configuration files. And, as an absolute last resort, you can even open Synaptic and remove the latest kernel, then reinstall it (take note of all package names when uninstalling, to make sure you reinstall everything correctly).

Failure Generating /boot/initrd.img

This error is unfortunately common, and the message you’ll see is like:

update-initramfs: failed for /boot/initrd.img-2.6.32-22-generic

Quite often, running the following command will let the update start again:

sudo update-initramfs -u

Continued “dpkg was interrupted” Error

This error occurs when the initramfs update has halted, sometimes because something has interfered, but generally when it gives up trying to get the files from the server:

dpkg was interrupted, you must manually run ‘sudo dpkg --configure -a’ to correct the problem

While it gives you the answer, you might find yourself in an endless loop of running sudo dpkg --configure -a over and over again. If it just won’t stop, the last thing you want to do is reboot without having tackled this, so here is a work-around that may help. You’ll be editing a text configuration file as superuser, so paste the following into a terminal:

sudo gedit /etc/initramfs-tools/update-initramfs.conf

Locate the line “update_initramfs=yes” and change it to “update_initramfs=no“. Save and exit the file, then run:

sudo dpkg --configure -a

Hopefully, everything should be fine when you reboot, and later you can try changing the “no” back to “yes” in update-initramfs.conf.

initramfs Update Aborted & Recovery Fails

This problem is fairly common, and can generally be remedied easily, even though it produces a long and rather sinister error message that looks like:

Processing triggers for initramfs-tools … update-initramfs: Generating /boot/initrd.img-2.6.32-22-generic dpkg: subprocess post-installation script killed by signal (Interrupt) Could not install the upgrades The upgrade aborts now. Your system could be in an unusable state. A recovery will run now (dpkg --configure -a). Please report this bug against the ‘update-manager’ package and include the files in /var/log/dist-upgrade/ in the bugreport. E:Sub-process /usr/bin/dpkg returned an error code (2) Setting up initramfs-tools (0.85eubuntu36) … update-initramfs: deferring update (trigger activated) Processing triggers for initramfs-tools … update-initramfs: Generating /boot/initrd.img-2.6.32-22-generic Could not install the upgrades The upgrade aborts now. Your system could be in an unusable state. A recovery will run now (dpkg --configure -a). Please report this bug against the ‘update-manager’ package and include the files in /var/log/dist-upgrade/ in the bugreport. installArchives() failed

You might find that running sudo dpkg --configure -a as suggested doesn’t help, but the following command should do the trick:

sudo update-initramfs -u

Delete Corrupted initrd.img Then Run Update Again

Here’s another way you may be able to get around the familiar update-initramfs: failed for /boot/initrd.img… error message. Some have success with the following commands, so you can try them first:

sudo dpkg --configure -a

sudo apt-get update

But don’t be surprised to find yourself back where you started, but here is a trick that seems rather unlikely, but has worked before: move or delete initrd.img. If that file is corrupted, you would think it would just get overwritten in the update, yet deleting (or moving, if you want to play it safe) initrd.img has made all the difference in some instances.

It’s probably safer just to move the file, since if a replacement is successfully generated, you can delete it later. To move it to your home folder, enter the following command, remembering to replace the kernel number with the one you’re moving:

sudo mv /boot/initrd.img-2.6.32-22-generic ~/

Or you can open the /boot folder as root, and just drag the file to wherever you want:

gksu nautilus /boot

Now try those first two commands, and hopefully all goes well.

°ºÒθÓº°

Hopefully a trick or two here saved your day; if not, godspeed in sorting it out!

°ºÒθÓº°

☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻

Did this information make your day? Did it rescue you from hours of headache? Then please consider making a donation via PayPal, to buy me a donut, beer, or some fish’n’chips for my time and effort! Many thanks!

Buy Ubuntu Genius a Beer to say Thanks!

Advertisements

Read Full Post »

Please note that this is for the “legacy” version of GRUB still widely in use, not the next-generation GRUB 2. If unsure, check out this guide on how to find out which version of GRUB you are using.

↔↔↔↔↔↔↔↔↔↔↔↔↔↔↔↔↔↔↔↔↔

If you’ve protected GRUB with a password, then forgotten it, you can use a Live CD to mount the partition where your GRUB configuration file is stored, then delete the password. To mount your partition, enter the following in a terminal from the Live desktop:

mount -t /dev/sda2 /mnt

remembering to change “sda2” to your Ubuntu partition’s correct designation, if need be. Your Ubuntu partition will now be mounted under /mnt, so you can now edit the GRUB config file (as superuser, so you can save the changes). To do so, enter the following in a terminal:

sudo gedit /mnt/boot/grub/menu.lst

Locate the password line amongst the text and remove it; it will look like:

password --md5 $1$9sdflksdf/sdf44k

Save the file and reboot.

☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻

Did this information make your day? Did it rescue you from hours of headache? Then please consider making a donation via PayPal, to buy me a donut, beer, or some fish’n’chips for my time and effort! Many thanks!

Buy Ubuntu Genius a Beer to say Thanks!

Read Full Post »

Please note that this is for the “legacy” version of GRUB still widely in use, not the next-generation GRUB 2. If unsure, check out this guide on how to find out which version of GRUB you are using.

↔↔↔↔↔↔↔↔↔↔↔↔↔↔↔↔↔↔↔↔↔

You can create your own splash images for the GRUB bootloader menu, but they need to be 640×480 pixels in size, a maximum of only 14 colours, saved in the .xpm format, and then compressed. Sound too hard? Well, here’s a single command that does it all for you in one go!

In this example, the image is called “Ubuntu-Glass.png” and residing in the user’s Pictures folder. Obviously, just replace the path and filename in the example command with that of your own image. Another thing to remember is that some pictures resized will look very different (ie: distorted), so go for ones that have the same shape/ratios (in other words, wallpapers that are 800×600, 1024×768, 1600×1200, etc).

To convert a picture, enter the following (with correct filename) into a terminal:

convert -resize 640×480 -colors 14 ~/Pictures/Ubuntu-Glass.png ~/Pictures/Ubuntu-Glass.xpm && gzip ~/Pictures/Ubuntu-Glass.xpm

You now have a boot menu splash you can get GRUB to load instead of just showing white text on black background. Don’t know how to go about that? Then read about how to add a splash image to GRUB.

☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻

Did this information make your day? Did it rescue you from hours of headache? Then please consider making a donation via PayPal, to buy me a donut, beer, or some fish’n’chips for my time and effort! Many thanks!

Buy Ubuntu Genius a Beer to say Thanks!

Read Full Post »

Please note that this is for the “legacy” version of GRUB still widely in use, not the next-generation GRUB 2. If unsure, check out this guide on how to find out which version of GRUB you are using.

↔↔↔↔↔↔↔↔↔↔↔↔↔↔↔↔↔↔↔↔↔

You can actually add a picture to the GRUB boot menu, but these are special pictures that are compressed and have the extension .xpm.gz. First you’ll need some splash images, so go here and search for “grub”, and save them all in a folder of your choice. You will then need to create a new folder called images in GRUB’s residence, which you do by entering the following into a terminal:

sudo mkdir /boot/grub/images/

To copy all bootsplash files to this new protected folder, open a terminal in the folder you saved the splashes in and enter:

sudo cp *.xpm.gz /boot/grub/images/

If just wanting to copy one file over, you can replace the asterisk (*) with the file name. Note that these files must be .xpm images that have been compressed and so have the extension .xpm.gz (in other words, do not extract the picture from within).

To edit menu.lst to incorporate the image of your choice, enter the following into a terminal:

sudo gedit /boot/grub/menu.lst

then add the following lines at the very top of the file (or change the file name if it already exists):

# Splashimage for Bootloader Background
splashimage=(hd0,1)/boot/grub/splashimages/mygrubsplash.xpm.gz

Note that you may need to substitute your Ubuntu partition’s  correct address for (hd0,1), and that the GRUB system of naming drives and their partitions is different to that of Linux. Whenever you want to switch between boot menu images, simply edit menu.lst again and replace the name before the .xpm.gz with that of the replacement picture.

Want to know how to go a step further? Create your own GRUB boot splash!

☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻

Did this information make your day? Did it rescue you from hours of headache? Then please consider making a donation via PayPal, to buy me a donut, beer, or some fish’n’chips for my time and effort! Many thanks!

Buy Ubuntu Genius a Beer to say Thanks!

Read Full Post »

Please note that this is for the “legacy” version of GRUB still widely in use, not the next-generation GRUB 2. If unsure, check out this guide on how to find out which version of GRUB you are using.

↔↔↔↔↔↔↔↔↔↔↔↔↔↔↔↔↔↔↔↔↔

You can quite simply change GRUB‘s preference for Ubuntu being the default operating system (the one it boots to after the countdown has finished) to that of whichever was used last. It will then boot to that when you press Enter or the countdown finishes. Simply open menu.lst for editing as superuser by pasting the following into a terminal:

sudo gedit /boot/grub/menu.lst

and when you see right near the top:

default 0

simply edit it to this:

default saved

Close and save menu.lst and GRUB will automatically boot the last used OS from then onwards. Note that you will still be able to choose other OSes from the boot menu, and that whenever you boot to another, it will become the new default (until you boot another).

↔↔↔↔↔↔↔↔↔↔↔↔↔↔↔↔↔↔↔↔↔

Related Guides:

Make GRUB (Legacy) Boot Into Your Windows System by Default Instead of Ubuntu

☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻

Did this information make your day? Did it rescue you from hours of headache? Then please consider making a donation via PayPal, to buy me a donut, beer, or some fish’n’chips for my time and effort! Many thanks!

Buy Ubuntu Genius a Beer to say Thanks!

Read Full Post »

Please note that this is for the “legacy” version of GRUB still widely in use, not the next-generation GRUB 2. If unsure, check out this guide on how to find out which version of GRUB you are using.

↔↔↔↔↔↔↔↔↔↔↔↔↔↔↔↔↔↔↔↔↔

You can make GRUB boot to an operating system other than Ubuntu, like Windows, by simply editing a bit of text. Open menu.lst for editing as superuser by pasting the following into a terminal:

sudo gedit /boot/grub/menu.lst

and near the top you should see:

default         0

You will need to change the “default” value from “0” (zero) to the number of the Windows entry, which should be near the bottom of the file and look like:

# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sda1
title        Windows XP Professional x64 Edition
root        (hd0,0)
savedefault
makeactive
chainloader    +1

Noting that the default entry (Ubuntu) is “0not “1”, simply count the entries at the bottom of menu.lst, and deduct 1 from the value of the Windows drive/partition.

In other words, if your GRUB menu has the four basic options (Ubuntu, Ubuntu Recovery Mode, Memtest+, and Windows), then your Windows drive is the fourth option, so the “default” value should be “3”. Obviously, if your boot menu has some earlier kernels still listed, and altogether there are 8 entries with Windows as the last, then the value would be “7“. As I said, simply count the entries at the bottom of menu.lst (they should all look similar to the Windows one) and deduct one from it (assuming Windows is the last entry, of course).

Close and save menu.lst and GRUB will automatically boot Windows from then onwards. You can of course still choose another OS like Ubuntu at the boot menu before the countdown finishes.

↔↔↔↔↔↔↔↔↔↔↔↔↔↔↔↔↔↔↔↔↔

Related Guides:

Make GRUB (Legacy) Automatically Boot to the Last Used Operating System

☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻

Did this information make your day? Did it rescue you from hours of headache? Then please consider making a donation via PayPal, to buy me a donut, beer, or some fish’n’chips for my time and effort! Many thanks!

Buy Ubuntu Genius a Beer to say Thanks!

Read Full Post »

Please note that this is for the next-generation GRUB 2, not the “legacy” version of GRUB still widely in use. If unsure, check out this guide on how to find out which version of GRUB you are using. For the legacy GRUB version of this guide, click here.

↔↔↔↔↔↔↔↔↔↔↔↔↔↔↔↔↔↔↔↔↔

GRUB 2 has a different system for naming drives than you’re used to in Linux, and you will need to understand this before proceeding with commands or customisisation that requires this specific information. Both the drive and the partition are numbers in GRUB 2, with the drive starting from 0 (zero) and the partition starting with 1 (this is unlike legacy GRUB where both start with zero).

This is different from the Linux convention of naming a drive a letter, and its partitions as numbers, starting with a and 1 respectively (eg: “a” in sda1 meaning first drive, with the “1” meaning the first partition on that drive). Also note that the drive and partition are separated with a , (comma) in the designations GRUB 2 uses.

So therefore the first partition on the first hard drive (sda1 or hda1 in Linux) is hd0,1 in GRUB 2. Similarly, your second hard drive (sdb or hdb) would actually be hd1, and if you were talking about the 7th partition on your 3rd drive (sdc7 or hdc7) it would be hd2,7.

↔↔↔↔↔↔↔↔↔↔↔↔↔↔↔↔↔↔↔↔↔

☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻

Did this information make your day? Did it rescue you from hours of headache? Then please consider making a donation via PayPal, to buy me a donut, beer, or some fish’n’chips for my time and effort! Many thanks!

Buy Ubuntu Genius a Beer to say Thanks!

Read Full Post »

Older Posts »