LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   Bad sectors on HDD (https://www.linuxquestions.org/questions/linux-hardware-18/bad-sectors-on-hdd-935480/)

_Lee_ 03-20-2012 09:49 AM

Bad sectors on HDD
 
Hello,
A laptop that I need to fix reports that it has 1 bad sector, and I thought that it would be possible to fix it from a linux live cd.
I have linux ubuntu 11.04, but I were not able to find a repair function (only the smart scan).

Any help would be appreciated

onebuck 03-20-2012 11:33 AM

Member response
 
Hi,

Welcome to LQ!

When you boot the livecd the system should be in single user mode. You can use 'fsck' from the cli;
Quote:

excerpt from 'man fsck';
fsck - check and repair a Linux file system

SYNOPSIS
fsck [-lsAVRTMNP] [-C [fd]] [-t fstype] [filesys...] [--] [fs-specific-options]

DESCRIPTION
fsck is used to check and optionally repair one or more Linux file systems. filesys can be a device name (e.g. /dev/hdc1, /dev/sdb2),
a mount point (e.g. /, /usr, /home), or an ext2 label or UUID specifier (e.g. UUID=8868abf6-88c5-4a83-98b8-bfc24057f7bd or
LABEL=root). Normally, the fsck program will try to handle filesystems on different physical disk drives in parallel to reduce the
total amount of time needed to check all of the filesystems.

If no filesystems are specified on the command line, and the -A option is not specified, fsck will default to checking filesystems in
/etc/fstab serially. This is equivalent to the -As options.

The exit code returned by fsck is the sum of the following conditions:
0 - No errors
1 - File system errors corrected
2 - System should be rebooted
4 - File system errors left uncorrected
8 - Operational error
16 - Usage or syntax error
32 - Fsck canceled by user request
128 - Shared library error
The exit code returned when multiple file systems are checked is the bit-wise OR of the exit codes for each file system that is checked.

In actuality, fsck is simply a front-end for the various file system checkers (fsck.fstype) available under Linux. The file system-spe-
cific checker is searched for in /sbin first, then in /etc/fs and /etc, and finally in the directories listed in the PATH environment
variable. Please see the file system-specific checker manual pages for further details.
Just a few links to aid you to gaining some understanding;



1 Linux Documentation Project
2 Rute Tutorial & Exposition
3 Linux Command Guide
4 Bash Beginners Guide
5 Bash Reference Manual
6 Advanced Bash-Scripting Guide
7 Linux Newbie Admin Guide
8 LinuxSelfHelp
9 Utimate Linux Newbie Guide
10 Linux Home Networking
11 Virtualization- Top 10

The above links and others can be found at 'Slackware-Links'. More than just SlackwareŽ links!

jefro 03-20-2012 04:16 PM

It may not be possible to "repair" it as such. An entire sector being marked bad is a bit odd. Personally, I'd run the hard drive's OEM diags first for more clues as to the state of the drive and maybe controller.

HowieA 03-20-2012 04:24 PM

Quote:

Originally Posted by _Lee_ (Post 4631616)
Hello,
A laptop that I need to fix reports that it has 1 bad sector, and I thought that it would be possible to fix it from a linux live cd.
I have linux ubuntu 11.04, but I were not able to find a repair function (only the smart scan).

Any help would be greatly appreciated and rewarded! :)

Is this an indication that the hard drive is failing? Or is there a good way to judge? I've had two hard drives fail and learned the hard way that it can happen, and sometimes without warning.

TobiSGD 03-20-2012 04:43 PM

If the system report a bad sector this almost any times means the the hard disks internal controller already has used up all the spare sectors for covering bad blocks. From my experience this is in 99% a sign for a dying disk. As jefro already suggested it is time to check the disk with the manufacturers diagnosis tool. And of course to back up all valuable data on that disk (which you do regularly anyways, don't you?).

_Lee_ 03-28-2012 07:30 AM

Whole story:
It was a friends hard drive I was supposed to fix, and I know that it's no good when a bad sector shows up...
But since there was only 1 bad sector I was unable to convince my friend that the disk might fail soon, but did give him a warning.

Anyway, I figured that It might be a soft error, since smart didn't show any other signs of old age or probable failure (the are two types soft and hard bad sectors for those who don't know) - these require formatting the disk to fix, but couldn't format the disk since it was full of data. Ubuntu CD was my first attempt, after I couldn't find a repair tool on it, I looked up Hiren's boot CD that had a program to fix bad sectors. (Just some info in case anyone encounters similar problems.)

jefro 03-28-2012 03:03 PM

You should have used the OEM disk to diag the hard drive. You can't out figure the factory diags.


All times are GMT -5. The time now is 04:56 PM.