Wednesday, July 31, 2013
4:25 PM

BusyBox v1.18.5 (Ubuntu 1:1.18.5-1ubuntu4) built-in shell (ash) Enter 'help' for a list of built-in commands. (initramfs)

1. Boot from Ubuntu Alternate

As ext3 and ext4 are quite robust, it should be repaired quite easily with a tool like fsck run from a live CD. The main constraint is that the live CD should allow not to mount the root filesystem of the host computer.
After a quick search, I realised that Ubuntu Alternate allows to do that.
So, first step is to download Ubuntu Precise PC (Intel x86) alternate install CD and to :
  • either write the ISO file to a CD-ROM
  • or generate a USB key with unetbootin or startup disk boot creator under Ubuntu
Next step is to boot from your CD-ROM or USB Key on your computer with a corrupted filesystem.
From the main menu, select the last choice Rescue a broken system.

After selecting your keyboard, follow all the steps till the Filesystem Mount menu.
Select the last menu Do not use root file system.
Next, select the menu Execute a shell in the installer environment.
You will get a busybox prompt.
2. Repair Corrupted Root Filesystem
From the prompt, type :
# fdisk -l
Périphérique Amorce Début Fin Blocs Id Système
/dev/sda1 * 1 3647 29294496 83 Linux
/dev/sda2 3648 121601 947465505 5 Etendue
/dev/sdb3 120582 121601 8193150 82 Linux swap / Solaris
Here, the root filesystem is the first one : /dev/sda1. It is of Linux type.
To repair it, we just need to run fsck with the force option :
# fsck.ext3 -f /dev/sda1
At the end of the fdisk command, your filesystem should be repaired.
At this stage, you should already be able to succesfully reboot your computer.
3. Search your Hard Disk for Bad Sectors
Please note that this step is not compulsory at all.
In case you feel that your hard disk may be in an unhealty condition, you may want to search for bad sectors.
To search for bad sectors on your hard disk, you can need to run fdisk with the check option.
# fsck.ext3 -c /dev/sda1
This action may take a very long time to complete.

Once you root filesystem has been repaired, you just need to reboot ... and your Ubuntu system should be back to life !

0 comments:

Post a Comment