LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 10-22-2010, 02:21 AM   #1
qlands
Member
 
Registered: Sep 2010
Posts: 65

Rep: Reputation: 0
Know if my hard-drive had bad sector


Hi,

My computer crashed yesterday and it seems that It was the hard-drive. Now I am installing linux again in the same computer. I use slackware and when I format the partition I can check for bad sector however, after installation, how can I know if it had bad sectors? Is there any command to list the current bad sectors in the hard-drive?

Thanks.
 
Old 10-22-2010, 02:36 AM   #2
neonsignal
Senior Member
 
Registered: Jan 2005
Location: Melbourne, Australia
Distribution: Debian Stretch (Fluxbox WM)
Posts: 1,389
Blog Entries: 52

Rep: Reputation: 355Reputation: 355Reputation: 355Reputation: 355
You can use dumpe2fs to list the blocks already marked as bad on an ext2/3/4 formatted filesystem, for example:
Code:
dumpe2fs -b /dev/sda1
To do a new scan of the partition, you can use e2fsck -c, which will use badblocks.

The SMART utilities smartmontools are also useful for examining the drive history of newer drives.

Last edited by neonsignal; 10-22-2010 at 02:43 AM.
 
1 members found this post helpful.
Old 10-22-2010, 02:39 AM   #3
prayag_pjs
Senior Member
 
Registered: Feb 2008
Location: Pune - India
Distribution: Fedora,RedHat,CentOS,Gentoo
Posts: 1,145
Blog Entries: 4

Rep: Reputation: 147Reputation: 147
badblocks - search a device for bad blocks

do man badblocks
 
Old 10-22-2010, 02:43 AM   #4
tailinlinux
Member
 
Registered: Oct 2010
Location: Paudpod, Botolan, Zambales, Philippines
Distribution: Mandriva, Ubuntu, Mint, Open Suse, Meego
Posts: 390
Blog Entries: 3

Rep: Reputation: 25
run as root
su
root password
init
entering run level 1
then type e2fsck

e2fsk -p
 
Old 10-22-2010, 03:41 AM   #5
qlands
Member
 
Registered: Sep 2010
Posts: 65

Original Poster
Rep: Reputation: 0
Cool. Thanks a lot
 
Old 10-22-2010, 04:30 AM   #6
aries_baluyot
Member
 
Registered: Oct 2010
Location: India
Distribution: Mandriva, Suse, Ubuntu, Centos, Maemo, Omnia Xp
Posts: 86

Rep: Reputation: -11
Quote:
Originally Posted by qlands View Post
Cool. Thanks a lot
ok if your problem has been solved mark it as solved..
thank you
 
Old 10-22-2010, 10:01 AM   #7
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: SlackwareŽ
Posts: 12,892
Blog Entries: 27

Rep: Reputation: 2182Reputation: 2182Reputation: 2182Reputation: 2182Reputation: 2182Reputation: 2182Reputation: 2182Reputation: 2182Reputation: 2182Reputation: 2182Reputation: 2182
Hi,

Welcome to LQ!

Quote:
Originally Posted by qlands View Post
Hi,

My computer crashed yesterday and it seems that It was the hard-drive. Now I am installing linux again in the same computer. I use slackware and when I format the partition I can check for bad sector however, after installation, how can I know if it had bad sectors? Is there any command to list the current bad sectors in the hard-drive?

Thanks.
Since most members have noted what should be done, I'll add that any filesystem or device diagnosis should be done as a 'single' user. You can use a LiveCD or the installCD/DVD to boot the machine. That way no user activity will be allowed thus causing issues from the possible multi-user access. Run the filesystem checks or whatever while in this mode to repair or check.

Just a few links to aid you to gaining some understanding;

SlackwareŽ Essentials
SlackwareŽ Basics
Linux Documentation Project
Rute Tutorial & Exposition
Linux Command Guide
Utimate Linux Newbie Guide
LinuxSelfHelp
Getting Started with Linux
Bash Beginners Guide
Bash Reference Manual
Advanced Bash-Scripting Guide
Linux Home Networking


The above links and others can be found at 'Slackware-Links'. More than just SlackwareŽ links!
 
Old 10-23-2010, 03:55 AM   #8
qlands
Member
 
Registered: Sep 2010
Posts: 65

Original Poster
Rep: Reputation: 0
No bad sector, no smart errors

Hi,

I run all kind of tests. The format did not return bad sectors, I also runned the smartmontools short and long tests and did not return errors.

So, what may have caused EXT4 to fail with many IO errors? I remember that After I restarted I got a lot of error and e2fck asked me to correct them, so it seem it did but I lost a lot of data. For example /opt disapeared after fixing..

Any ideas?
 
Old 10-23-2010, 02:25 PM   #9
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,397
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
Power bump, power supply failing, disk overheating, physical shock to the disk, software faults, cabling problems. There are certainly other possibilities.

--- rod.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 sector errors crathm Linux - Newbie 3 12-09-2008 06:59 AM
Removed bad hard drive from computer, now flash drive won't mount. checkmate3001 Linux - Hardware 6 08-15-2008 01:03 AM
hard disk bad sector detection arunka Linux - Hardware 2 02-15-2006 02:28 AM
Repair Hard drive bad sector jselby Linux - Hardware 4 10-25-2005 07:27 PM
Bad Sector Hard Drive tsigane Linux - Hardware 16 08-15-2004 04:07 AM

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

All times are GMT -5. The time now is 03:14 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration