LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-08-2008, 12:55 PM   #1
crathm
LQ Newbie
 
Registered: Nov 2008
Posts: 13

Rep: Reputation: 0
Hard drive sector errors


Hello everyone,

I've noticed in my error logs that that I've been getting some bad sectors. This error seems to be spamming my log almost 30 times a day so it had been really catching my attention. Ive tried googling the error message but I really don't understand the solutions. I believe there might even be a previous post on this site about it. Either way, this is the message im getting.

Dec 8 13:46:48 LinuxServer smartd[7816]: Device: /dev/hda, 238 Offline uncorrectable sectors

I've read the man pages on both fsck and mkfs (using the -c argument, but that seems to only apply when creating a new file system) and am scared to fry my system experimenting with them.

Now what im curious is two things. Can I use a safe utility without unmounting devices to either fix or at least isolate those sectors so that the system can stop displaying that message?

Or should I just accept that message as a warning that my system is slowly on its way to hard drive heaven?


Thanks,

crathm
 
Old 12-08-2008, 01:15 PM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,634

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by crathm View Post
Or should I just accept that message as a warning that my system is slowly on its way to hard drive heaven?
Yes, your hard drive is dying. Ignoring/filtering the messages out is not a good fix.
 
Old 12-08-2008, 07:40 PM   #3
crathm
LQ Newbie
 
Registered: Nov 2008
Posts: 13

Original Poster
Rep: Reputation: 0
I figured, I was doing some research on the e2fsck command and (from what I understand) it is supposed to detect and possibly fix back blocks.
as root i tried running "e2fsck -pv /dev/hda" and it gives me:

"e2fsck: Device or resource busy while trying to open /dev/hda
Filesystem mounted or opened exclusively by another program?"

now reading the man page i noticed that if the command runs and i get an exit code of 2... that means the file system errors were corrected, should be restarted if the file system was mounted...doesnt that mean i can run this command on a mounted file system?

Either way, would this command help me band aid my situation until i can get myself a new hard drive?
 
Old 12-09-2008, 05:59 AM   #4
onebuck
Moderator
 
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: SlackwareŽ
Posts: 13,925
Blog Entries: 44

Rep: Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159
Hi,

Any 'fsck' maintenance should be performed on a unmounted filesystem as a 'single user' too prevent someone else from accessing the filesystem. You could use your install cd/dvd to boot or a LiveCD that will allow you to perform the filesystem maintenance. Don't mount the filesystem in question. From the cli;

Code:
~#fsck -y /dev/your_dev_File_partition  #filesystem too repair
Code:
excerpt from 'man fsck';
NAME
       fsck - check and repair a Linux file system

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

DESCRIPTION
       fsck is used to check and optionally repair one or more Linux file sys-
       tems.   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).  Nor-
       mally, 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.
Code:
excerpt from 'man e2fsck';

NAME
       e2fsck - check a Linux ext2/ext3 file system

SYNOPSIS
       e2fsck [ -pacnyrdfkvstDFSV ] [ -b superblock ] [ -B blocksize ] [ -l|-L
       bad_blocks_file  ]  [  -C  fd  ]  [  -j   external-journal   ]   [   -E
       extended_options ] device

DESCRIPTION
       e2fsck  is  used to check a Linux second extended file system (ext2fs).
       E2fsck also supports ext2 filesystems containing a journal,  which  are
       also sometimes known as ext3 filesystems, by first applying the journal
       to the filesystem before  continuing  with  normal  e2fsck  processing.
       After  the  journal  has  been  applied,  a filesystem will normally be
       marked as clean.  Hence, for ext3 filesystems, e2fsck will normally run
       the  journal  and  exit,  unless  its superblock indicates that further
       checking is required.

       device is  the  device  file  where  the  filesystem  is  stored  (e.g.
       /dev/hdc1).
Read the 'man fsck' and 'man e2fsck' to understand the commands.
 
  


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
hard drive errors slzckboy Linux - Hardware 8 04-29-2007 02:20 PM
scan for sector errors on hard disks psirek Linux - Software 1 04-19-2006 04:58 PM
Hard Drive errors on S3 wakeup slinky2004 Linux - Laptop and Netbook 1 11-19-2005 12:07 PM
Repair Hard drive bad sector jselby Linux - Hardware 4 10-25-2005 06:27 PM
Bad Sector Hard Drive tsigane Linux - Hardware 16 08-15-2004 03:07 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:15 PM.

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