[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

abt hdparam - a doubt in tweaking harddisk

Posted on 2003-11-28
1
Medium Priority
?
303 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 free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

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…
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
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.
Suggested Courses

649 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