Solved

abt hdparam - a doubt in tweaking harddisk

Posted on 2003-11-28
1
294 Views
Last Modified: 2013-12-16
hello boss

 i just want to knw how to check the bad sector in hardisk manually
 
 i came to knw abt hdparam , but pls give me the correct syntax
 such that it can scan the disk and tell like chkdsk --

 
 - karthi
0
Comment
Question by:karthikeya
1 Comment
 
LVL 44

Accepted Solution

by:
Karl Heinz Kremer earned 75 total points
Comment Utility
As far as I know, the hdparm program does not allow you to scan for bad sectors. It only allows you to control if a hard disk does the bad sector management or not. This sounds dangerous, and I would not use ths manually.

The mke2fs command can check for bad sectors when you specify the -c parameter. If this parameter is found, it will start the backblocks command in the background (which is part of the programs that come with the ext2fs tools). You can run badblocks manually, but again, it has some dangerous parameters, so you should be very careful. If you for example specify the -w switch, the program will actually write to the sector in order to find out if it's bad. This of course will destroy what was in the sector before. So don't use this on an existing partition.

The command usually lives in the /sbin directory, which is not part of the search path of a normal user, and it's also not executable by a normal user. This means that you have to be root in order to run this program.
If you read the man page, it is however strongly suggested that you do not run this command in stand-alone mode. You may not even be able to tell what's wrong. The program was written as a companion application for mke2fs when used with the -c switch.

If you must run it, the following will most likely not damage your hard disk (but  I cannot giving you any guarantee!):

/sbin/badblocks -s -v /dev/hdaX

Just replace /dev/hdaX with the partition you want to check.
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now