Thursday, November 11, 2010

Disk crash on Ubuntu: the rescue guide

Here is a geek post that will not deal with running.
My personal laptop is running on Ubuntu. I always used to be a Linux geek and I made the complete switch to gnu/Linux after trying to use Windows Vista on my brand new laptop: a nightmare. Nothing available by default to burn an ISO CD, to watch a DVD, etc. The transition had not been painful, Ubuntu is very impressive and can run all my hardware.

The hard part came when my hard drive began to get bad sectors a few weeks ago. I was not able to compact my Thunderbird Inbox, and neither to backup it to a usb drive. I was really upset. How will I fix my drive? Nothing seemed available in the system. So I decided to run it "old school" way, using the shell with the command line fsck.

This post is a comprehensive guide that aims to help people who are using Ubuntu and who do not have a deep knowledge of Linux.

Step 1: download a Ubuntu Live CD image, go to: http://www.ubuntu.com/desktop/get-ubuntu/download
Step 2: burn it using Brasero Disc Burner.
Step 3: reboot from the live CD.
Step 4: open the disk utility (Sytem / Administration / Disk Utility)
Step 5: find the path to your partition (e.g. /dev/sda3), do not mount it.
Step 6: open a shell (applications / accessories / terminal)
Step 7: get the root grant
type: sudo su -
Step 8: check & repair the partition
type: fsck -cf /dev/sda3
-c is looking for the bad blocks and add them to the bas blocks inode.
-f force the search & repair.
Step 9: answer yes to all the questions (by typing "y")
Step 10: reboot
Step 11: backup immediately your data (it was not possible before, due to the bad blocks)
Step 12: enjoy a safe computer.

No comments:

Post a Comment