Tag Archives: grub

Ubuntu Hardy and Hibernate Issues

As I mentioned in my last post I had some minor problems with Ubuntu Hardy (8.04) and hibernation. It didn’t always work.

However it now seems like I might have overcome this problem. At first I thought it might had something to do with my docking station. Hibernating while docked, booting up while not and vice versa. The problem was that the machine would freeze during startup after being in hibernation. So to be able to actually see what was going on, I removed the splash screen, and afther this I haven’t had any problems with hibernate what so ever.

Come to think of it, this isn’t the only time the splash screen have caused problems. I had another machine where it refused to boot as long as the splash parameter was set. Luckily, with grub, we are able to edit the boot parameters at boot. Something that wasn’t possible with LILO in the good old days.

To remove the splash screen more permanently than editing grub at each boot. You can,would be to edit the file /boot/grub/menu.1st and remove the word ‘splash’ from the kernel parameters. Just remember that this will sneak its way in the next time you upgrade the kernel. Or rather, Ubuntu upgrades your kernel. as Stian said in the first comment, edit the line “# defoptions=quiet splash” to “#defopts=”quiet nosplash” in the file /boot/grub/menu.1st. Do not remove the leading #.

Please leave a comment if you found this useful.

Creating a Bootable USB Flash Drive

It’s always handy to have a bootable USB flash drive. Whether you would install a Linux distribution, or just run a memory test. Now days, less and less computers are delivered with floppy drives, and some don’t even have a CD drive. Like the IBM ThinkPad X-series. Of course you could buy an external one, but that’s not the point.

This is meant to help people who already know Linux, so don’t expect a world of information.

1. Prerequisite
You’ll need a USB flash drive and computer running Linux. The machine also needs Grub and support for FAT file system.

2. The Quick and Dirty Guide
First you must find out what block device your drive is identified by. This can be done by using “dmesg” right after you have plugged in the device.

dmesg | tail

Mine came up as sdb, so let’s go ahead and format it using the FAT file system.

mkfs.vfat /dev/sdb1

Then install Grub (the bootloader)

grub-install /dev/sdb

Pay attention to the output. It will tell you how Grub identifies /dev/sdb, we’ll need it later. In my case it’s hd1. If you get an error message about some BIOS stuff. Try this instead.

grub-install --recheck /deb/sdb

Now we can mount it and copy over the necessary files.

mount /dev/sdb1 /media/usb
mkdir -p /media/usb/boot/
cp -r /boot/grub/ /media/usb/boot/

We’re almost there.

grub
grub>root (hd1,0)
grub>setup (hd1)
quit

It’s bootable. Now you can throw in whatever image you please, like memtest86.

cp memtest86+.bin /media/usb/boot/

Memtest can be downloaded from Internet, or if you have Ubuntu it will already be in your /boot catalog. To make a boot menu, edit /media/usb/boot/grub/menu.1st to look like this.

default 0
timeout 10

title Memtest86
root (hd0,0)
kernel /boot/memtest86+.bin

I have also thrown in the Ubuntu network installation files.

cp linux initrd.gz /media/usb/boot

So now my menu looks like this.

default 0
timeout 10
color cyan/blue white/blue

title Memtest86
root (hd0,0)
kernel /boot/memtest86+.bin

title Ubuntu x86 Installation
root (hd0,0)
kernel /boot/linux root=/dev/ram
initrd /boot/initrd.gz

Please leave a comment if you found this useful.