Solved

abt hdparam - a doubt in tweaking harddisk

Posted on 2003-11-28
1
295 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
ID: 9837310
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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
change time in cron 4 65
nagios alerts 3 32
Exchange 2010 unable to mount DB due to corruption 11 69
wipe a usb using python 5 26
Daily system administration tasks often require administrators to connect remote systems. But allowing these remote systems to accept passwords makes these systems vulnerable to the risk of brute-force password guessing attacks. Furthermore there ar…
Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

911 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

23 Experts available now in Live!

Get 1:1 Help Now