07.11.07

Lenovo X41 Recovery CDs not booting? Check the partitions

Posted in Error Messages, How To, Intermediate, Windows at 4:06 pm by Techie

I have a Lenovo X41 Tablet PC that I had installed Ubuntu onto. I recently decided to re-install the original Windows software, so I ordered the CDs from Lenovo and broke out an external CD drive. However, when I put in the Rescue and Recovery CD and booted the machine, I ended up with a blank black screen and nothing else. What gives? I updated the BIOS and the embedded controller firmwares, but to no avail. The computer would boot up the CD, a brief message about examining the setup would fly by, then a blank screen. I figured this was a problem with the recovery CDs, because my Ubuntu live CD booted right up.

As it turns out, Lenovo recovery CDs are very picky about their hard drive setup. They need to copy files to disk for a variety of tasks, so if you’re using up all the partitions, then the CDs will stop booting, but give you no other errors.

I had previously installed Linux on the machine, so my partition tables were in a state the machine didn’t really understand. What I needed to do was trash the existing partitions, and flush out the boot record.

Easy enough — I fired up the Ubuntu live CD, and launched the partition editor in System -> Administration. I had to turn off the swap space, by right-clicking on it in the partition editor, and selecting “swapoff”. By default, Ubuntu live CDs will scan your drives for partitions marked as swap space, and use it, so you have to turn off this usage to delete the partitions. I ran through and deleted all the partitions, and applied the changes.

I next had to clear out the master boot record, but I could do that right from the live CD. After doing that, I rebooted with the Lenovo Rescue and Recovery CD and said a little prayer.

Once I had done these steps, the recovery CD started right up. I’m surprised Lenovo doesn’t give more details on this in their support knowledge base.

07.10.07

Clearing out the master boot record with Linux

Posted in How To, Intermediate, Linux at 9:35 pm by Techie

In the old days, a techie might install Windows on a computer, then install Linux. Later, the techie might decide to trash the Linux partitions for some reason, but on reboot — oops! LILO was still there. These days, GRUB has taken the place of LILO, but the old problem is still there: how do you clear out the master boot record completely?

If you had a Windows 98 boot disk lying around, you probably remember the old magic of fdisk /mbr. This simple command did just what you wanted — flashed out the master boot record, and things worked like you expected.

However, in this day and age of Linux live CDs, there must be a way to do so without breaking out the floppies. As it turns out, there is, through a simple program known as dd.

The beginning of a hard drive is where you keep both the master boot record, as well as the partition table. What you want to do is write zeroes to the master boot record, but not the partition table. Many folks recommend writing zeroes to the first 512 bytes of the drive — this is wrong.

The truth is, the first 446 bytes of the drive are dedicated to the master boot record executable. The remaining 66 bytes are used to hold the partition table. Hence, what we need to do is read in a source of zeroes, and output it to the first 446 bytes of the drive. Simple! Let’s take a look at the command:

dd if=/dev/zero of=/dev/hda bs=446 count=1

This says to do just that — use as an input file the special device /dev/zero, an output file of the drive (substitute the drive identifier in question here!), with a block size of 446 bytes. Oh, and do it just once. No nonsense, quick, and effective. So, put away those MS DOS disks — that Linux live CD works just fine.

Bad Behavior has blocked 329 access attempts in the last 7 days.