Troubleshooting a failing hard drive
This is a wiki page. Be bold and improve it!
If you have any questions about the content on this page, don't hesitate to open a new ticket and we'll do our best to assist you.
External documentation
Wikibooks: Minimizing Hard Disk Drive Failure and Data Loss
http://en.wikibooks.org/wiki/Minimizing_Hard_Disk_Drive_Failure_and_Data...
Self-Monitoring, Analysis, and Reporting Technology, or S.M.A.R.T.:
http://en.wikipedia.org/wiki/S.M.A.R.T.
Filesystems and Mounting
http://members.iinet.net.au/~herman546/p10.html
Set up
Software to install and initial set up to do as soon as possible after installing your favourite Linux distribution.
Software to install
automatic check
If fstab's 6th column is 0, the mount count is not checked.
Palimpsest
Palimpsest Disk Utility (gnome-disk-utility)
http://en.wikipedia.org/wiki/Palimpsest_Disk_Utility
On Ubuntu, the package name is:
gnome-disk-utility
smartmontools
https://linux.overshoot.tv/wiki/smartmontools
Things to do regularly
... to prevent disaster.
troubleshooting
When things get bad...
Symptoms of a failing drive
Here are a few examples of input/output errors encountered by various programs when the disk starts to fail:
* Directory listing output is full of question marks:
ls: cannot access *** Input/output error
total 0
d????????? ? ? ? ? ? mydirectory
* Cannot remove files:
$ sudo rm -f image.JPG
rm: cannot remove `image.JPG': Input/output error
* Cannot write to file, nor perform any operation which requires write access to the failing drive.
* Get "Bus error" to every command:
https://linux.overshoot.tv/wiki/bus_error
First steps to take
Whatever the problem is, it is important to make sure to save as much data as possible.
First of all, use dd
to make an image of the drive.
See the following post for a detailed explanation of dd
's uses:
http://www.linuxquestions.org/questions/linux-newbie-8/learn-the-dd-comm...
In our case, something like the following command would do:
# dd if=/dev/sda of=/mnt/backup/failing_drive_image.iso bs=2048 conv=sync,notrunc
Checks to run
Make sure the partition to check is unmounted.
e2fsck /dev/sd??
Use fdisk -l
to find the device path (e.g. /dev/sda1).
Check man e2fsck for more information on options.
Recovery
Either boot from a "rescue" CD (or an installer and choose Rescue mode), or add the kernel boot option "forcefsck" along with the "ro" option (on both Debian and Red Hat systems).
data recovery:
https://help.ubuntu.com/community/DataRecovery
Issues related to this page:
Project | Summary | Status | Priority | Category | Last updated | Assigned to |
---|---|---|---|---|---|---|
Linux software | ls: cannot access *** Input/output error | active | normal | bug report | 11 years 41 weeks | |
Linux software | Best use of e2fsck | active | critical | task | 14 years 25 weeks | |
Linux hardware | Failing SSD drive: How to recover? | active | normal | support request | 12 years 2 days | |
Linux software | badblocks output doesn't show percentage done | active | normal | bug report | 13 years 12 weeks | |
Linux hardware | Checklist of things to keep in writting, in cas… | active | normal | feature request | 13 years 12 weeks |