Basics: Can I use a Linux CD to Recover a Crashed Windows Machine?
Novell Cool Solutions: Feature
Digg This -
Posted: 11 Feb 2005
Question: Hello, I have a laptop whose OS - NT 2000 has crashed. I was wondering if I could use a live CD with Linux OS to run the machine again, my laptop does not have DVD drive, only a CD drive. If it is not possible could you please give me the other best option to make the machine work again. Thanks, Amit
Answer: For SUSE
Yes, you definitely can.
The SUSE Live CD should work, although it may be a bit resource hungry.
Another alternative is KNOPPIX the original live CD. This comes in two versions, one for lower powered machines.
There is also Damn Small Linux for those with even less resources.
One of the benefits of the last two CDs is that they include an option to install the system onto a pre formatted hard drive. You can use some command line tool to format the drive, but this may be beyond the average newbie.
Later on in this answer it shows you how format a single partition, but you really need two. One being a swap partition which is 2 to 4 times the size of your RAM.
Of course if you take the best option, which is to install Linux on your machine, you can probably get it going again and learn how to use this wonderful robust, secure, productive system.
If your hard drive is totally trashed, you can get a new one and install it yourself by following the technical support documentation for your machine. You can get this from their web site.
On the other hand, it might not be trashed, only the OS has crashed. You can possibly recover files from this drive using a live CD.
Follow these instruction to recover files from an unbootable windows partition, or to try and reformat an unrecoverable drive.
I'm going to use the SUSE live CD, and the KNOPPIX CD to show you the differences that you can get with different Linux distros. The easiest strategy for a newbie is to use the same live CD supplier as your desktop distro uses. Then you will have very little trouble practising and remembering the commands.
Start the machine and quickly insert the live CD into the CD-ROM drive.
The live SUSE screen looks like this:
In this shot I am opening a console terminal in Super User mode.
The KNOPPIX screen looks like this:
In this screen I click on the /dev/hda1 icon to try to access the drive. "/dev/hda1" denotes that this is a device (dev), it is a hard drive (hd), and it is the first hard drive (a), and it is the first partition on this drive(1). hda2 would be the second partition, hdb1 would be the second hard drive first partition and so on. Obviously hda and hdb denote the whole drive. You can see I've got a lot of drives and partitions.
If the drive is accessible, the file manager will open and you can drag files into your home directory. If you have a working Ethernet connection you can use Samba to transfer them to another windows machine, or NFS to another Linux box.
To set up Samba see my Samba howto at http://www.novell.com/coolsolutions/author/1211.html.
To set up NFS look for dumb answer on the subject soon.
The rest of this answer will use the Live SUSE CD, as I use SUSE on my desktop.
This is the terminal console screen:
You can see I tried to create a folder (directory) on the CD which didn't work. The home folder, however is in RAM so that worked OK.
I then mounted it (i.e. I attached it and any files it contained to the file system tree) with the command:
$ mount /dev/hda1 /home/linux/test
Actually, I typed a shortcut for /home/linux/test which says "use the last argument from the previous command", but you can type the whole thing out in full.
If that worked you can open the file manager by clicking on the Home icon in the desktop bar. That's the one that looks like a house.
Click on the "Window" menu item and choose "Split View Left/Right".
Click on any panel to make it active and click your new "test" directory.
Your screen should look like this:
You can see that my windows files are in the left hand pane and my linux home in the right.
I have dragged the folder WebCamNXPro from the left pane to the right, and when prompted selected "Copy".
This has placed all the files in this folder in my home directory. They are, of course stored in RAM, so will disappear as soon as I reboot. The only way of saving them is to use a CD burner, a USB RAM stick, or a networked drive on another computer. If you are going to any of these methods, I suggest you have all your connections in place when you boot from the live CD.
If the drive is not accessible you can try reformatting it using your live CD. You will have to use the command line tool "fdisk" in a super user terminal console to do this.
If you can't follow these instructions, the other alternative is to try loading a Linux distribution onto the drive. The Novell Linux Desktop is a good choice if you have at least 128MB of RAM. The installation process will try to format your drive. If that doesn't work, get a new or second hand drive for your machine, and try again.
At the command prompt type the following command and press the enter key.
$ fdisk /dev/hda
This brings up the following screen:
And when you type the letter "m", this one:
Type the letter "p" to view the current partition table.
Mine is going to be different from yours, as I've got lots of partitions.
You could get a message about the number of cylinders, which you ignore, or an error message about the start and end points not being correct. If nothing works try to write the table to disk and reboot the machine and go round again.
If it shows any partitions at all, type the letter "d" followed by the highest partition number in the table. In my case that would "6".
Do the same for each one shown until you have deleted them all. I'm not going to do this as I'd wipe out my system. Boo Hoo.
Press the letter "n" to create a new partition, followed by the letter "p" for primary and then "1" for the first partition.
Since this is only to test that the drive will format, press the enter key to accept the default start and end points. i.e. the whole drive.
Press the letter "p" again to verify the partition has been created.
Press the letter "w" to write the partition table to the disk.
This should quit you out of the "fdisk" tool.
Using the system menu, log off and reboot the machine back to the live CD. This is to ensure that the partition table is correctly written to the disk drive.
Open up the super user terminal console again. At the prompt type the command:
$ mkfs.ext3 /dev/hda1
See the dot between the s and the e. This command will make a file system on the partition. If it is successful, try mounting it with the commands:
$ mkdir /home/linux/testor
$ mount /dev/hda1 /home/linux/test
$ mount -t ext3 /dev/hda1 /home/linux/test
The "-t ext3" option explicitly gives the partition format type.
If that works try to copy some files to it. e.g.:
$ cp /sbin/* /home/linux/test
Next unmount the drive with the umount command:
$ umount /home/linux/test
Check the file system consistency with the command:
$ fsck -y /dev/hda1
The "-y" says fix all errors. If the drive is good, there shouldn't be any, as you have newly formatted it.
If you think the drive is good you can try installing SUSE 92 on it. You may have to tell it to delete your existing partition, but that is what you want.
Go to this page on the web: http://www.novell.com/documentation/suse92/index.html. Download the SUSE Linux 9.2 Administration Guide.
This guide is a step by step guide to installing SUSE 9.2.
If you are still having trouble, take your SUSE 9.2 distribution, a copy of the above guide, and $20 to $50, down to your local PC repair shop and ask them to install it for you. This way you will have somewhere to go in the future that supplies professional end user hardware support.
This Newbie answer has covered:
Novell Cool Solutions (corporate web communities) are produced by WebWise Solutions. www.webwiseone.com