LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   Find Hard Disk Information (https://www.linuxquestions.org/questions/linux-hardware-18/find-hard-disk-information-413377/)

Jayaraghavendran 02-09-2006 06:01 AM

Find Hard Disk Information
 
Hi,

Is there a command(other than "badblocks") to find the number of bad sectors in the hard disk in Unix??

I tried badblocks. But it is too time consuming. I need something which will tell me the already scanned result.

Or Is there a file in which hard disk related information is stored which also includes the bad sector count??

Thanks in advance!!

Regards,
Jay

marozsas 02-09-2006 07:04 AM

The current list of badblocks could be extracted from a ext2/ext3 system by using the command "dumpe2fs -b /dev/yourblockdevicehere"

e2fsck [-l|-L] could be used to add/set news bad blocks on a partition.

Jayaraghavendran 02-09-2006 11:34 PM

Regarding Hard Disk Information..
 
Hi,

Thanks for the reply.

But,

"#dumpe2fs -b /dev/hda"

gives the following :

dumpe2fs 1.28 (31-Aug-2002)
dumpe2fs: Bad magic number in super-block while trying to open /dev/hda
Couldn't find valid filesystem superblock.


And.....

"#dumpe2fs -b /dev/hda1"

gave the following :

dumpe2fs 1.28 (31-Aug-2002)


Running "badblocks" command directly on /dev/hda1 reported
two badblocks. In that case, why the same is not being reflected on
dumpe2fs??

Also, do the number of "Bad blocks" map directly to the number of "Bad Sectors" in hard disk?? If "badblocks" command reports 2 bad blocks.. does that mean there are two bad sectors on my hard disk??

I am unable to make out.. Please help..

Thanks in Advance!!

Regards,
Jay

marozsas 02-13-2006 05:01 AM

As I noted, this works only for ext2/ext3 filesystems.
Are you sure /dev/hda1 is a ext2 or ext3 filesytem ? Type:
# mount | grep /dev/hda1

see'ya,


All times are GMT -5. The time now is 06:26 PM.