LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 03-20-2012, 09:49 AM   #1
_Lee_
LQ Newbie
 
Registered: Mar 2012
Posts: 2

Rep: Reputation: Disabled
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
 
Old 03-20-2012, 11:33 AM   #2
onebuck
Moderator
 
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: SlackwareŽ
Posts: 13,923
Blog Entries: 44

Rep: Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158
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!
 
1 members found this post helpful.
Old 03-20-2012, 04:16 PM   #3
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,974

Rep: Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623
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.
 
Old 03-20-2012, 04:24 PM   #4
HowieA
LQ Newbie
 
Registered: Mar 2012
Posts: 2

Rep: Reputation: Disabled
Quote:
Originally Posted by _Lee_ View Post
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.

Last edited by HowieA; 04-12-2012 at 03:46 PM.
 
Old 03-20-2012, 04:43 PM   #5
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
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?).
 
1 members found this post helpful.
Old 03-28-2012, 07:30 AM   #6
_Lee_
LQ Newbie
 
Registered: Mar 2012
Posts: 2

Original Poster
Rep: Reputation: Disabled
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.)

Last edited by _Lee_; 03-28-2012 at 07:31 AM.
 
Old 03-28-2012, 03:03 PM   #7
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,974

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


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Fedora 12 (Constantine) How to remap bad sectors of HDD? GodDethroned Linux - Newbie 7 04-12-2010 07:02 PM
HDD burn-in tester to locate bad sectors? Ulysses_ Linux - Server 2 04-01-2010 08:18 PM
[SOLVED] Bad Sectors In HDD Israfel2000 Linux - Hardware 17 02-08-2010 07:26 PM
My Conputer takes long to load/Bad sectors in HDD ..what to do ? sun_sun General 2 03-24-2008 07:52 AM
Bad sectors in RAID 5 HDD arunabh_biswas Linux - Software 2 06-16-2006 12:25 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 04:49 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration