LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 05-06-2005, 06:02 AM   #1
gward
LQ Newbie
 
Registered: May 2005
Distribution: Red Hat 7.2
Posts: 1

Rep: Reputation: 0
View bad sectors or blocks on harddrive


Hi,

this will be a simple question for the more experienced Linux user, however I have only been experimenting with the OS for a little over 2 weeks.

I have since learned how to use commands such as badblocks, mke2fs etc. and these appear to work just fine (have succesfuly partitioned and formated a couple of hard disks already.) However, I have several older hard drives ranging from 1.2G up to 10Gig which are perfect for my "Linux experimentation machine". I realize that the command 'badblocks' detects and marks bad blocks, however I would appreciate a visual representation of exactly how many (if any) bad sectors or blocks there are on a drive.

badblocks gives you no indication, merely tells you that each pattern read-write is 'done' and finishes. I have tried using the -o file suffix, and although it creates the file, it appears to be blank (tried to view it using VIM and the 'more' command)

I am not trying to see an elaborate graphical representation of where each bad block is, only a simple break down of how many bad blocks exist on a given harddisk. Such a command was available in the days of DOS called chkdsk. The idea is to go through my stack of small hard drives and only use the ones that are error free. As I am very new to the art of Linux, the last thing I want is to lose data or vital system files on a corrupt disk !

I have searched for many hours on the net and tried a number of commands and alternatives without success. The closest I have come is a program called SMART. Have not tried it yet, as I am sure that there must be a native linux command for performing such a simple request! Am using Red Hat Linux version 7.2 (for now!)

Your assistance would be most appreciated.

Regards,

Graham
 
Old 05-06-2005, 10:54 PM   #2
Kdr Kane
Member
 
Registered: Jan 2005
Distribution: SUSE, LFS
Posts: 357

Rep: Reputation: 30
Quote:
I have searched for many hours on the net and tried a number of commands and alternatives without success. The closest I have come is a program called SMART. Have not tried it yet, as I am sure that there must be a native linux command for performing such a simple request! Am using Red Hat Linux version 7.2 (for now!)
Every vendor drive is going to be different and you will need to rely on their software (if available) to get the information you're seeking.

Please realize that in the old days before IDE drives, you could see the bad blocks. But nowadays, this information is hidden by the hard drive internal BIOS whether the drive is IDE, SATA or SCSI. You have to use SMART commands (which is an industry standard) to ask the BIOS about the drive's health.
 
  


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
Bad sectors tuxombie Linux - Hardware 3 01-29-2005 01:05 PM
bad sectors on harddrive Lindquist Linux - Hardware 1 01-28-2004 04:41 PM
fixing bad blocks/sectors warheros Linux - Software 3 07-19-2003 10:01 PM
searching 4 bad sectors zeky Linux - Software 1 12-12-2002 08:49 AM
Bad sectors blystovski Linux - Software 1 10-17-2001 12:18 PM

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

All times are GMT -5. The time now is 03:07 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