From Windows to Ubuntu: The Saga

Wednesday · 19 Dec 07 · 10:50 AM IST | Posted by Karthik | Category: Tech

To make a long story short, I removed Windows XP from my computer on Sunday and installed Ubuntu Linux instead.

What follows in this (again, lengthy) post is a description of the circumstances that led me to do this.  Also, hopefully, you will find some tips here on these points —

  • Keeping a backup of your files
  • Using your system when your Windows installation refuses to boot
  • Recovering data from a non-bootable hard disk
  • Mounting an NTFS partition under Linux
  • Installing Ubuntu

With that said, first, let me talk about what happened on Saturday night to my computer, that led me to start on this path less travelled —

History Lesson

For a very long time, my laptop (running Windows XP with all updates installed) had been running very sluggishly.  At a certain point, it got to a stage where it would take half an hour or more to boot.  So, a couple of months back, I moved much of the data off the main hard disk into an external hard drive (from there, the data went off onto a few DVDs).  This improved the situation somewhat [refer this post].  Still, usability of the system was nowhere near what you'd expect on a 1.86 GHz computer with 512 MB RAM.  Anyway, I got by for some time like this.

Saturday night, we (me, Varun, parents) were leaving to watch I Am Legend, and before that I forcibly turned off my computer (normal shutdown wasn't working properly).  When we returned after the movie, and when I turned on my laptop, it refused to boot.  I'd get the opening Windows XP logo, and then after a minute or so, I would get a Blue Screen of Death reporting that I had an UNMOUNTABLE_BOOT_VOLUME.  This has happened a few times before, and usually, restarting in Safe Mode or whatever used to help.  But this time nothing worked.

Ubuntu Logo

An Edgy Rescue, and a Cunning Plan

Fortunately, one year ago, I had downloaded Ubuntu Linux 6.10 (Edgy Eft) [refer this post], and I had the Live CD with me.  I had only used it one time previously [refer this post] but had a very good experience with it.  So I put in the CD again and started the computer.  Like I expected, it started up, running the operating system from the CD itself.  I was able to use the system and had access to the internet too.  I could even connect my external USB hard drive to the computer, and it detected this without a hitch.  Now, my cunning plan was this: to somehow access the data from the non-booting hard disk, and transfer it off to my external hard drive.  Then I could do whatever I wanted with the hard drive on the laptop — reinstall Windows XP after formatting it, or experiment with using a Linux distribution as my primary OS.  This was a task which was left for the next day, though.

Wrong Turns

Let us say you have a Windows XP installation and the system doesn't boot.  There is one thing you can (and probably should) try first, which is described below.  I did, but it didn't work though.  If, in fact, the part of the hard disk responsible for booting has become corrupted, you can try and fix it using the Microsoft Recovery Console.  If the fault is a mechanical one, and there are weird whirring or clicking sounds coming out of the disk, then you've got a far more serious problem on your hands.  Anyway, here are some points on using the Microsoft Recovery Console —

  • Put in your Windows XP CD and boot the computer from that.
  • On the next screen, you will have an option that says "To repair an existing installation, press R".  Pressing R starts the Recovery Console, which allows you to execute some useful tools.
  • At the Recovery Console, I tried the command fixboot first, which did not rectify the problem.
  • So, before going to sleep on Saturday night, I started chkdsk /r and let it run.  It was supposed to identify bad areas on the disk and recover whatever was possible.
  • Unfortunately, the next morning, this was stuck at 51% (after running for some 5 hours) and did not move beyond that for an additional 2 hours.  So I restarted the computer.  And then I got a scary message that said SMART Failure Detected, and further told me that a hard drive failure was imminent, and that I should immediately back up data and replace the hard disk.
  • At this point I kind of gave up and decided that tinkering with Ubuntu and recovering data was the best possible option.  Had chkdsk run fully, I would have tried fixmbr next, which was supposed to fix a corrupted Master Boot Record.

Rescue Operations — Recovering Data from a Non-booting Hard Disk

Once I'd decided that extracting my data using Ubuntu was the best way to go, I proceeded to boot the computer again, with the Ubuntu Live CD.  The computer started and I had access to the internet.  I connected my external hard disk to the USB port and it immediately showed up in Ubuntu.  With great anticipation, I opened a Terminal window, and typed mount /dev/hda1 /mnt, to mount my Windows partition, so that I could access it in Linux.  I got back an error saying that only the root user could do that.  Oh yeah?  So next I retorted with sudo mount /dev/hda1 /mnt, and it mounted the partition successfully.

But, there was a problem now.  Though I was able to see my Windows folders, I was not able to open any of them, to copy stuff out!  I later learned that Ubuntu mounts NTFS partitions (that was what my Windows partition was) in a restricted-permissions mode.  A peek at this excellent article told me how to mount the Windows partition in a way that I could copy stuff from it.  I've given the steps I followed in sequence here though, for completeness sake (all these commands are issued at a Terminal Window) —

  • I first unmounted the partition: sudo umount /mnt
  • Created a mount point: cd /mnt and sudo mkdir windrive
  • This step was not really necessary I guess (if I'd messed up anything, I could simply reboot from CD), but I followed it anyway, and made a copy of my fstab file: sudo cp /etc/fstab /etc/fstab_back
  • Now, I opened up the file in a text editor: gedit /etc/fstab
  • To this file, I added the following line, which according to the article, would allow Ubuntu to read the NTFS partition: /dev/hda1 /mnt/windrive ntfs nls=utf8,umask=0222 0 0
  • I saved the file and then issued the command sudo mount -a, to remount the partitions.

Success!  I was able to browse my Windows folders nicely, and with great anticipation, copied one file.  Then, I navigated to my external hard disk, and tried pasting it there.  Damn!  My external hard drive was also formatted as NTFS!  So I couldn't paste the data there.  I didn't want to follow another complex procedure for mounting this one in read-write mode, so I went out and bought a 1.8 GB USB drive for Rs 750.  This was a FAT filesystem, so no problems.  I connected this drive and then started copying stuff off my Windows hard disk into it —

Recovering data from a non-booting Windows hard disk through Ubuntu

You can click the image above to see the full-size screenshot.  There were certain files that I couldn't copy, but I managed to get most of the important stuff off the Windows hard disk.  It took me almost the whole day to do this, but at the end of it all I'd copied off more than 3 GB of data, which I would have simply lost, were it not for Ubuntu.  This was transferred to my external hard disk on Varun's computer.

Installing Ubuntu

Now that my data was safe, I decided to take the plunge and install Ubuntu on my computer.  Note: Ubuntu had no problems with my hardware when I was running it from the CD, so I was confident that it would work well when installed.  If there had been problems running it from CD, then I would not have installed it permanently.  Installation is extremely simple.  There is an icon on the desktop that says "Install", and all you have to do is double-click that to start the installation process.

Beginning the Ubuntu Install

It opens up a dialog that asks you for the language to be used during the install (which is Step 1 of 6 — which means that it doesn't take far more than six clicks of the mouse button to install this OS!), then asks you to select your time zone.  You then need to provide your administrator password and such, and choose which partition you'll be installing the OS on.  Then comes a crucial step, choosing how you want Ubuntu to be installed.

Wiping my hard disk to install Ubuntu

I had a broken Windows install anyway, so I decided to simply wipe the hard disk clean and only install Ubuntu.  If I wanted to have a dual boot system, then I'd have had to resize partitions on the hard disk appropriately.  But that is a different story.  Anyway, once I selected this option, Ubuntu proceeded to format my hard disk with the ext3 filesystem, and then began installing the OS.

Ubuntu Install Progress

In just a little over 20 minutes, the OS was effortlessly installed.  Additionally, you must note that I had my USB drive connected during the install, and I was happily taking screenshots (which I've used in this post).

Ubuntu Installation Completed

I then got a helpful message which told me that I could still continue using the OS from the Live CD, or I could restart and use the freshly-installed Ubuntu!  I picked the latter option, and was surprised to have my computer boot up in under a minute (like I said at the beginning, I was used to 30-minute boot times!).  I've been using Ubuntu for a few days now and have had a very good experience.  Pretty much everything works right out of the box, and the system automatically downloaded updates.  With the Synaptic Package Manager, I later installed some commonly used applications (xmms media player, VLC media player, etc.).  All the screenshots you see with this post were processed with The GIMP, and I used gFTP to upload them.  Of course there is more exploration to be done, but for now, I am comfortable using this.

Some Concluding Points

I have no hard feelings against Windows — Windows has been practically the only OS I have used till date (started off with 95, then 98, then XP... for a short time at Chennai I even used Vista as they installed that on my office computer).  I did briefly have a dual boot system with Windows 98 and Red Hat Linux 6 for a short time though.  I find Windows XP to be the best of the Windows OSs I have used.  It ran well on my old Pentium II 333 MHz with 192 MB RAM.  And on my laptop I used that for more than 2 years, and had it not been for the hard disk error, I don't think I would have changed OSs.

I must consider myself extremely lucky in this situation.  I would have lost much more data than I did, had it not been for the fact that I'd moved off lots of data onto DVDs a couple of months ago.  Also, I am fortunate that I had the Ubuntu CD when I needed it.  I'd downloaded it one year back, and never thought I would be exclusively installing it on the computer one day.  Almost seems like the Shyamalan-type coincidence we saw in Signs!  It's also good that whatever hardware I had on my laptop was easily recognised under Ubuntu.

Well, that about wraps up this post.  The next thing I have to do is upgrade to the latest Ubuntu version.  Currently, I have Edgy Eft (6.10), which I need to first upgrade to Feisty Fawn (7.04) and then to the latest Gutsy Gibbon (7.10).  This can all be done easily through the Update Manager though.  Things have really come a long way since a few years ago, when if you wanted to install Linux you had to resize partitions and all through a text-mode installer (yes, I did that for Red Hat 5 many years ago).  I hope this post was educational in some way!  Please remember YMMV [Your Mileage May Vary] in such matters.  I was lucky that everything worked out the way it did.

14 comment(s) for this post.

Comments for this News Post

21 Dec 07 · 01:59 AM
Comment by user Pablo
i would not know what to do if i had been you. probably re-install windows and use a file recovery software. hopefully i would recover at least one or two files with any luck :)

and i agree that windows xp is much more stable than the others windows, but still gives problems. why is that? i sometimes read that people have the best time using these linux versions than windows, and they never have any problems! and fedora and ubuntu are free, not like windows thats created by a huge company. maybe microsoft should contact these dudes and create a whole new OS.

21 Dec 07 · 06:24 PM
Comment by user Karthik
Hmm. I guess that might work - reinstalling Windows once without formatting the disk... if that fails, format and then try a file recovery software.

The more I think about this, the more I prefer not having any important data on the main hard disk AT ALL. I'm trying as far as possible to save stuff on an external drive only and I'm nowadays transferring stuff to DVDs whenever any considerable amount of data accumulates. That way, you don't have to worry about wiping the hard disk clean :)

I wouldn't say that Linux isn't without problems, as I've read articles where people talked about certain hardware not working etc. It all comes down to a bit of luck I suppose :)
22 Dec 07 · 12:32 PM
Hey Karthik, If you use Gutsy (7.10), You need not edit your fstab to get ntfs mounted and it got excellent compiz eye-candy by default if you dont mind giving few cpu cycles for looks.

And, thanks a lot for the mail :-)
22 Dec 07 · 02:16 PM
Comment by user Varun
"I wouldn't say that Linux isn't without problems, as I've read articles where people talked about certain hardware not working etc. It all comes down to a bit of luck I suppose :)"

Exactly... Fedora 6 gave me lots of problems while installing. Also, couldn't get it to boot without turning ACPI off and removing the cable connected to my modem.

But yeah, Ubuntu seems nice :)
22 Dec 07 · 08:26 PM
Comment by user Karthik
Karteek - I upgraded to Feisty Fawn now, and tried out Compiz. Very interesting, though I've turned it off at the moment. Next I will update the installation to Gutsy :) About the mail, it's no problem at all :)

Varun - Hmmm, had a bad experience with Fedora, eh? :) Anyway, we should see how Ubuntu works.
23 Dec 07 · 01:22 AM
I've to accept that Ubuntu is damn good when compared to other linux distros. Everything on my laptop worked out of box (except unnecessary compiz, had to download non-free driver and enable)

I was very impressed to see my wireless working. It shows far more information about battery and life than windows.

Anyway, today I managed to install leopard on my desktop. Very impressive OS, though I dint get used to keyboard shortcuts yet. On windows, my safe bet is XP. Damn Good.

Btw, your captcha made me realise that I became math-illiterate
23 Dec 07 · 09:29 PM
Comment by user Karthik
Karteek - I saw the post on your blog about the three OSs :) Very nice.

You're right about the CAPTCHA as well, sometimes I make mistakes too while answering that :) But, the earlier version of the CAPTCHA was even tougher! You used to get 4-digit numbers as answers and all, because it used to give 2-digit numbers as the LHS and answer of the equation! So I later changed it to give single digit numbers only :)
24 Dec 07 · 03:21 AM
Comment by user Pablo
fedora didn't work that well for me either, at least, i couldn't figure out how to open a .run file so i could install the video drivers :) i guess for some it works, and others doesn't, like everything else.

26 Dec 07 · 07:38 PM
Comment by user Karthik
Karteek - Hey I've now upgraded to Gutsy! I didn't think things could get better over Feisty Fawn, but I was proved wrong! Gutsy Gibbon is awesome, I love the sleek and glossy desktop effects, the new programs (Pidgin replacing GAIM, etc.), and the NTFS stuff (I connected my external hard disk and I was able to copy-paste stuff within it effortlessly). Amazing.
8 Feb 15 · 04:54 PM
Pretty! This has been an extremely wonderful article.
Thank you for providing these details.
11 Feb 15 · 09:33 AM
Keep this going please, great job!
14 Feb 15 · 03:31 PM
Many people happen to be exposed to a family member or
loved one who has struggled with alcohol, and also over 13....
15 Feb 15 · 04:08 PM
I have been exploring for a bit for any high quality articles or weblog posts in this kind
of space . Exploring in Yahoo I eventually stumbled upon this web site.
Reading this information So i am glad to convey that I have a very just right uncanny
feeeling I found out just what I needed.I most indisputably will make sure to do not overlook this
web site and provides it a glance on a relentless basis.
15 Feb 15 · 09:05 PM
Hello are using Wordpress for your blog platform?
I'm new tto the blog world but I'm trying to get started and set up my own.
Do you require any coding knowledge to make your own blog?
Any help would be really appreciated!
Recent Comments
Recent Posts
Latest Doom Map
Dark Fate 2 — a Doom II map by Karthik Abhiram

Dark Fate 2 is a singleplayer level for Doom II, replacing MAP01.  It's a small-sized hellish level — and there's a walkthrough video as well.

Popular Videos
Other Destinations
Favourite Posts
Some Statistics
  • news posts two · 173
  • news posts one · 301
  • comments · 1168
  • drawings · 77
The Author

Karthik Abhiram

27-year old Taurean (birthday 15-May-82), Assistant Manager - HR at Tata Consultancy Services Ltd in Hyderabad, India.  Previously, did Post Graduate Diploma in Management from T A Pai Management Institute (2003-05) and before that, Computer Science Engineering from Sree Nidhi Institute of Science and Technology (1999-2003).

Email: karthik82 -AT- gmail -DOT- com
orkut profile
Facebook profile
YouTube channel
deviantART page
Google Reader Shared Items

Disclaimer: The views expressed on this site are purely my own.

Warning: This site occasionally contains profanity.

Creative Commons License