Discussion:
hdparm
(too old to reply)
philo
2024-06-30 22:18:33 UTC
Permalink
I have a drive with a few bad sectors that I have no intention of using
for anything important. I'm always testing operating systems and often
will load and delete several a day...so this drive would be fine for that.

I zeroed it out using "dd" but before I did so, I looked at all the
options in hdparm .

One option was to deliberately create a bad sector.

I imagine this is for some type of testing purposes..

Just curious as to why someone would want to do that.
Mike Easter
2024-07-01 04:02:39 UTC
Permalink
Post by philo
Just curious as to why someone would want to do that.
It is hard to say all of what man hdparm has to say about
--make-bad-sector in just a few words, but if you are curious you should
read that, incl the EXCEPTIONALLY DANGEROUS. DO NOT USE THIS OPTION!!
part. I think it isn't a good idea for us novices to mess around w/
things like low level hdd 'treachery'. However, I do think that hdparm
might be something you could try to use to fix your current bad sector
problem if you are so inclined. I don't think I would bother w/ the
idea of creating your own bad sector for the 'fun' (or experience) of it.
--
Mike Easter
Paul
2024-07-01 05:49:44 UTC
Permalink
Post by philo
Just curious as to why someone would want to do that.
It is hard to say all of what man hdparm has to say about --make-bad-sector in just a few words, but if you are curious you should read that, incl the EXCEPTIONALLY  DANGEROUS. DO NOT USE THIS OPTION!! part.  I think it isn't a good idea for us novices to mess around w/ things like low level hdd 'treachery'.  However, I do think that hdparm might be something you could try to use to fix your current bad sector problem if you are so inclined.  I don't think I would bother w/ the idea of creating your own bad sector for the 'fun' (or experience) of it.
It's possible it would show up in a bad block scan.
As a CRC error.

The error might be resolved by writing to the sector.
If you know the sector number, using "dd", using seek and skip,
using bs=512 and so on, you should be able to target the
bad block and write it. If the write succeeds, it won't get
spared out. If the write fails, it might substitute a good
sector for the "fake bad" one.

Naturally, you would not "aim" at a sector containing valued data.
You'd also have to be careful of not hitting metadata in the
file system. In some cases, on a "hot" file system, it can be
difficult to be sure you're parked on white space if you are
trying to do this.

But where is the fun if the drive does not have data on it :-)

Paul
philo
2024-07-01 10:22:20 UTC
Permalink
The only thing I could think it could be used for would be to test data
recovery software or low-level formatting software on a drive that was
otherwise good.

Anyway, though I like to experiment...I see no use in trying that
option.
philo
2024-07-01 10:15:39 UTC
Permalink
The drive I was using I have no intention of using for anything other
than experimenting.

I literally have boxes of old spare drives.
Marco Moock
2024-07-01 10:36:44 UTC
Permalink
Post by philo
One option was to deliberately create a bad sector.
I imagine this is for some type of testing purposes..
Just curious as to why someone would want to do that.
Testing SMART monitoring tools, RAID and such stuff.
If you operate high-availability infrastructure, such disks are mostly
replaced.

You can use that to see if the monitoring and maybe the
automatic rebuild on a spare disk works.
--
kind regards
Marco

Send spam to ***@cartoonies.org
Philo
2024-07-01 11:37:35 UTC
Permalink
Post by Marco Moock
Post by philo
One option was to deliberately create a bad sector.
I imagine this is for some type of testing purposes..
Just curious as to why someone would want to do that.
Testing SMART monitoring tools, RAID and such stuff.
If you operate high-availability infrastructure, such disks are mostly
replaced.
You can use that to see if the monitoring and maybe the
automatic rebuild on a spare disk works.
Thanks

That makes sense
Philo
2024-07-01 12:52:43 UTC
Permalink
Post by philo
I have a drive with a few bad sectors that I have no intention of using
for anything important. I'm always testing operating systems and often
will load and delete several a day...so this drive would be fine for that.
I zeroed it out using "dd" but before I did so, I looked at all the
options in hdparm .
One option was to deliberately create a bad sector.
I imagine this is for some type of testing purposes..
Just curious as to why someone would want to do that.
Interesting point as to my "credentials" and the use of terminology.

For the past 25 years, I've been repairing computers.
At one time I was constantly busy and often had three on the bench at once.

Because I worked out of my house...I was just an amateur but because I
got paid, I could be considered a professional.

For nine years however, I did volunteer work for an NPO , so wanted to
be sure everything I did was legit...so got "certified" and became an MAR.

Though this type of work would qualify me as a professional, because I
was a volunteer...I did not get paid. Anyway...all the computers I
refurbished were legal and by the book. No way did I want to get the
organization in trouble.

Kind of interesting though hoe some of their providers "ripped off" this
very good, non-profit agency.

A local outfit, to be nice, provided them with a free server...but still
charged them a monthly fee (I think $200). They did absolutely nothing.

One day their entire system came almost to a halt and their provider
said it would be a few weeks before they could get there, I was asked to
take a look.

Every machine in the organization was on the server...at least 25 units.
Only 12 were actually used for work.
The rest of them I took off the server.

They were mostly Linux machines I had setup for the members to browse ,
etc. ( They required no maintenance other than occasionally having to
delete all the .exe malware piled up on the desktop)

Anyway, with only 12 machines on the server...it was smooth sailing.

I did return on the weekend to perform all the updates which were never
applied and update to unapproved drivers to the correct ones.
I also told the director to fire the IT firm, which she did.

They found another who would only bill them for work done.

Additionally they were paying $100 a month on a maintenance contract for
there video surveillance system. One day it failed and they were called
in. The whole thing was running off a Win2k machine..which the company
said was unsupported and they did nothing.

I repaired the computer and told the director to fire the company, which
she did. I then had them purchase an entirely new security system for
the total price of $200.

It was considerably better than what they had.

Loading...