November 4, 2009

A Linux Live CD to the Rescue!

A Linux Live CD To The Rescue!

A Linux Live CD to the Rescue!

By Scott Nesbitt – August 2, 2009

Computer hard drives. They're an essential component of your computing experience. While they're not as fragile as they were even 10 years ago, they're often one of the weak links in the chain of hardware that makes up a desktop computer or a laptop computer.

When something goes wrong with a hard drive, you can be in a lot of trouble. Especially if you haven't backed up your data recently. If you need that data – whether it's office documents, photos, videos, or all of the above – right now it can cost you. Professional data recovery can cost anywhere from a few hundred to a few thousand dollars. And there's no guarantee of success.

But before going that route, you might be able to do the job yourself if you're willing to get your hands dirty. How? All you need is a blank CD, a USB flash drive, and some Linux Live CD software.

More than just for a test drive

CDSAs discussed in a previous TechTip, Linux Live CDs are a great way to take Linux for a spin without installing it on your computer. But there are other Live CDs that perform special jobs.

What kinds of jobs? How about trying to fix a computer that's not playing nicely.

The situation

A few months ago, my wife's laptop (which ran Windows XP) wouldn't start properly. It would power up, then display a screen which informed her that the last shutdown wasn't completed properly. There were several boot options presented. But no matter which one my wife chose, Windows would try to start then the laptop would suddenly reboot. With the same message as before.

Nothing my wife or I tried worked. Instead of doing something drastic, like trying to reinstall Windows or Linux, or reformatting the hard drive, I tried starting the computer in safe mode, without the option to reboot automatically on an error. When I did this, the boot up stalled when XP was trying to load a driver called mup.sys. I did some research, and learned that mup.sys can get corrupted or infected with a virus. As it turned out, there was more to the problem than that.

I got the feeling that I might be able to salvage the hard drive. If nothing else, I figured I could get the most important files off that laptop.

To do that, I decided to turn to a Linux Live CD for help.

Getting the Live CD

In this case, the Live CD was actually a rescue CD. I looked at several, and on the recommendation of a couple of techie pals, I got my hands on one called SystemRescueCD.

SystemRescueCD comes with a number of utilities for analyzing and diagnosing problems with a hard drive or system memory, and for recovering from failures and errors. While SystemRescueCD comes with a very lightweight graphical user interface, most of the utilities are run from the command line.

If you need help with running the utilities, even if you are an experienced Linux user, then you should take the time to browse the documentation for SystemRescueCD.

It helps, believe me.

Burning the disk image

I downloaded an ISO image, which is literally a snapshot of the contents of a disk – in this case, a stripped-down Linux operating system and a bunch of utilities.

When you have an ISO image, you need to burn it to a blank CD as a disk image. In Windows, you can use a nifty freeware application called ISO Recorder. Just about every CD burning application for Linux allows you to burn an ISO image.

On Mac OS X, just select Applications > Utilities > Disk Utility, then choose Images > Burn.

Getting to work

Once I had the CD ready, I popped it into CD-ROM drive of my wife's laptop, and restarted it. Luckily, her laptop was set to boot from the CD-ROM drive. If this doesn't work for you, change this in your computer's BIOS settings. Depending on your computer, you do this by pressing F2 or ESC or DEL when the computer firsts starts up.

The first thing I did once the Live CD loaded was try to mount the Windows partition on the hard drive from the command line.

In Linux terms, mounting merely means getting access to a file system or drive. 

The command I used was:

mount -t ntfs /dev/sda2 /mnt/windows -o ro

This tells the command to access an NTFS file system (the default used by Windows) via the device /dev/sda2 (which is how the Live CD detected the hard drive), and to let me access the drive using the directory /mnt/windows.

That worked. So, I plugged in one of my 4 GB USB flash drives and mounted that with the following command:

mount /dev/sda1 /mnt/usb1

This allowed me to get access to the flash drive via the directory /mnt/usb1.

I ran the command cd /mnt/windows to change to the Windows drive, and then navigated my way to the folder where my wife kept her files. Using the Linux copy command (cp), I then transferred the files over to the flash drive. That took a while; there were about 3GB of files there.

A pair of funny things happened when copying the files. First, some files refused copy over. Second, many of the files had long names. When they were copied over to the flash drive, the names got truncated and the a good chunk of those names were replaced with a tilde (~).

Trying to save the hard drive

Hard DriveWhile I managed to salvage most of my wife's files, I wanted to see if I could also save the hard drive. SystemRescueCD comes with a powerful utility that can help determine this called testdisk. Testdisk can do diagnostics on and recover hard disks. It has a text-based interface. You don't have to type commands, but instead selection option by tabbing, using the up and down arrow keys, and pressing Enter. It's like many DOS programs of yore.

I ran the first check by selecting the Analyse option. For some reason the program stalled. After killing testdisk, I looked at the log file that it produced. In the log file was an error message stating that there was a problem with the number of disk sectors. That's not a good sign. Disk sectors store large lumps of data. If they're damaged, a hard drive is usually toast.

Next, I ran a check on the physical cylinders of the hard drive by selecting the Deeper Search option. Testdisk got through about 97% of the deeper search, and it stalled too. That indicated that there was a physical problem with the hard drive and that there was no way I was going to save it.


effects viagra /> Summing up

A Linux Live CD, especially one like SystemRescueCD, can be a good way of recovering your files if your computer starts acting up. A tool like SystemRescueCD is a bit geeky, and can be a tad difficult to use if you have no experience with backup software.

Permalink • Print • Comment

Leave a comment

You must be logged in to post a comment.

Made with WordPress and a search engine optimized WordPress theme • Sky Gold skin by Denis de Bernardy