Saturday, February 9, 2013

Power failure drive hangs repair (Linux)

Okay so you had a power outage and now your drive has booted ready only mode.


At some point your system will crash and you need to perform a manual repair of your file system. A typical situation would be power loss while you are working on the system. You reboot and the system stops and indicates you must perform a manual repair of the system using fsck command.



You need to use a command fsck against the drive to repair it. But you have a few options.


First don't attempt to fix it while it's using the system that would cause corruption.

Option #1
  Boot into recovery mode from the Grub menu.

Option #2
  Boot usb / cd using linux recovery distro.

Option #3
  Run


Okay I'm using option #2 since booting from grub was not working it's still trying to access the drive from the power failure and hanging on boot.

I downloaded unetbootin and ubuntu rescue mix distro and created a linux usb repair distro.


Note: You need to be "root" to use any of the below mentioned command or use "sudo" before all commands.


Now I need to run
sudo fdisk -l

This lists out the drives and partitions

I see mine as /dev/sda1

I can now run
sudo fsck -y /dev/sda1

Using -y will prevent constant asking you if you are sure.

Let this run and hope your power doesn't go out while you do this, do not shut off the machine while it runs let it run and finish. Go get some coffee while it runs.

If you still need help then see this extensive list of fsck help


fsck (file system consistency check) is a command used to check filesystem for consistency errors and repair them on Linux filesystems. This tool is important for maintaining data integrity so should be run regularly, especially after an unforeseen reboot (crash, power-outage).

Usage: fsck [-sACVRTNP] [-t fs-optlist] [filesystem] [fs-specific-options]

Filesystem can be either a device's name (e.g. /dev/hda) or its mount point. fsck run with no options will check all devices in /etc/fstab. It might be neccesary to run fsck from single-user mode





No comments:

Post a Comment

Got a Suggestion please let us know