LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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 08-10-2010, 10:02 AM   #1
fahadaziz
LQ Newbie
 
Registered: Aug 2008
Posts: 27

Rep: Reputation: 15
Question badblocks utility reliability


Hello every one ,

I just want to know that whether badblocks utility for checking hard disks bad sectors is reliable or not because it happens one time that it said no errors about one hard disk but there were still some issues with that hard disk. so with what parameters it will be reliable to use to check hard disk issues.


Thanks,
fahadaziz.
 
Old 08-10-2010, 03:01 PM   #2
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Arch + Xfce
Posts: 6,852

Rep: Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037
I think if it were particularly unreliable you'd probably find lots of comments about it on the net. I don't see anything of that sort.

You don't specify what your "issues" were, but you do realize that bad sectors are not the only problem that a hard drive can have, don't you? Have you tried running smartctl (part of the smartmontools) on the drive, for example?
 
Old 08-11-2010, 04:59 AM   #3
fahadaziz
LQ Newbie
 
Registered: Aug 2008
Posts: 27

Original Poster
Rep: Reputation: 15
@ David the H,

Thank you for your reply, The issue which I wanted to mention was that one of my colleague ran badblocks utility on one of our server's hard drive and badblocks reported that there is no issue in that hard drive but the problem was that there were still some issues such as its RAID was broken.

Now I am checking a lot of hard disks for further re usability and the steps which I am taking are as follows

1: fdisk -l
2: smartctl -a /dev/sdb
3: badblocks -wvs /dev/sdb.

In order to run some tests and to check its health so that we can re use these hard drives for further uses.

Thanks and regards,

Fahad Aziz.
 
Old 08-11-2010, 01:59 PM   #4
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,289

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
I would make that

3. fsck -fcvy /dev/whatsit.

The 'c' calls badblocks as part of a filesystem check. Don't try and run two of these together - run them in line.
 
Old 08-12-2010, 11:45 AM   #5
Soadyheid
Senior Member
 
Registered: Aug 2010
Location: Near Edinburgh, Scotland
Distribution: Cinnamon Mint 20.1 (Laptop) and 20.2 (Desktop)
Posts: 1,672

Rep: Reputation: 486Reputation: 486Reputation: 486Reputation: 486Reputation: 486
Quote:
The issue which I wanted to mention was that one of my colleague ran badblocks utility on one of our server's hard drive and badblocks reported that there is no issue in that hard drive but the problem was that there were still some issues such as its RAID was broken.
You mention that the disk's RAID was "broken"? Is the disk you are trying to check bad blocks on a physical disk or a volume made from a number of disks. Servers usually access disks through hardware RAID cards with a RAID setup utility available during POST. This is true of HP.Compaq Proliant servers, I assume DELL and others are similar.
You wouldn't run a bad block utility on a disk volume as the RAID card manages bad blocks, RAID rebuilds, etc, transparently, i.e. the operating system is unaware of the rebuild though there is an access overhead due to the extra work the RAID card is doing. You can adjust the rebuild priority when you set up the RAID. HP hot swap disks also log bad block info so that when a specific threshold is passed the disk is marked as "Degraded" and a warning led flashes on the disk, you can replace it then or, when it goes solid indicating a failed disk - you just pull it and replace it with a new one at this point... The RAID card rebuilds the data onto the new disk.
What? It's a software RAID? OK, forget all that, it's irrelevant!

bad blocks? Sorry, I just can't help becoming anal! disks have a hidden bad block file which is used to map any bad areas on the main surface of the disk. There are usually two spare cylinders within the disk geometry which are used to provide good storage. During a seek, the bad block file intercepts the address of a bad block and re-vectors the head to a block within the spare cylinder area. When you run a bad block utility the data is read from each block, known data is then written to the block and then verified by reading back, if it doesn't match, the block is marked as bad and the original data is written to one an area within the two spare cylinders. It's location is marked in the bad block file along with the original address so it can be accessed as if it hadn't been moved. If the block verify was good, the data is written back to the original block. Aren't you glad I told you all that? Er.. No, I thought you may have just given up and gone to the pub instead!
Oh! once the bad block utility has fixed the bad blocks, hopefully, if you were to re-run it it would be clean. Run it again a couple of days later, still clean? you may be lucky. If there are more blocks re-vectored I'd get a backup run as it looks like the disk may be on the way out!

Thats, my... er...


Play Bonny!

Last edited by Soadyheid; 08-12-2010 at 06:24 PM. Reason: Missing last paragraph!
 
  


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
Many or few badblocks? brgsousa Linux - Software 4 10-09-2008 09:18 AM
badblocks rotty Slackware 2 10-21-2006 07:30 AM
badblocks time linuxhippy Slackware 20 07-16-2005 10:48 PM
Badblocks odd Linux - Software 1 06-03-2004 01:54 PM
Badblocks and using dd? sthemage Linux - General 1 12-26-2003 02:52 PM

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

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

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