?
Solved

abt hdparam - a doubt in tweaking harddisk

Posted on 2003-11-28
1
Medium Priority
?
302 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 44

Accepted Solution

by:
Karl Heinz Kremer earned 300 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

Get MySQL database support online, now!

At Percona’s web store you can order your MySQL database support needs in minutes. No hassles, no fuss, just pick and click. Pay online with a credit card.

Question has a verified solution.

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

How many times have you wanted to quickly do the same thing to a list but found yourself typing it again and again? I first figured out a small time saver with the up arrow to recall the last command but that can only get you so far if you have a bi…
Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
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.:
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Suggested Courses
Course of the Month10 days, 4 hours left to enroll

762 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