LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   View bad sectors or blocks on harddrive (https://www.linuxquestions.org/questions/linux-hardware-18/view-bad-sectors-or-blocks-on-harddrive-320671/)

gward 05-06-2005 06:02 AM

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

Kdr Kane 05-06-2005 10:54 PM

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.


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