Solved

abt hdparam - a doubt in tweaking harddisk

Posted on 2003-11-28
1
296 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

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…
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
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.

810 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