"The Linux Gazette...making Linux just a little more fun!"

Manipulating Clusters on a Floppy ...

From Padma Kumar on Thu, 17 Dec 1998

Sir,

I'am basically want to write an application which needs to mark a
particular predefined cluster as bad, and also need to change
dynamically the value contained in the specific cluster. Is there any
way by which we can write some data into a cluster, mark that cluster as
bad, again i need to mark that bad cluster as usable and update the
data in the cluster and then mark it as bad again.

I would be greatful if you could help me out with this task or tell me
where i can find some information regarding this.

Thanking you for your consideration.
With Regards
Padma Kumar

This is a rather dubious request.

You'd have to write you're own custom programs to do this
(for each filesystem type that you wanted to support ---
since different filesystems have different mechanisms for
marking clusters as bad).

I've heard of MS-DOS virus writers, and some copy protection
schemes, that used similar techniques to covertly write
keying information on people's systems back when software
copy-protection seemed feasible. The demise of this
technique has two major dimensions:

There were chronic technical problems caused to
legitimate users (thus decreasing customer
satisfaction while increasing support costs).
(Problems resulting from restoration of user
programs and data after a hardware failure or
upgrade are one example). A moderately skilled
cracker could easily reverse engineer and bypass
these measures (often by "NOP-ing" out the portions
of code that performed the objectional hackery).

Many users/customer simply rejected the whole
adversarial stance of software companies employing
these techniques. We still see tacit acceptance
of "dongles" (hardware keys, typically attached to
parallel or serial ports which are queried by a
program to enable its operation, typically with
some sort of challenge response protocol). However,
those are only used for a small number of high end
packages.

To write your own code, just look at the examples in the
programs: badblocks, mke2fs, and e2fsck.
These all manipulate the badblocks lists on Linux' ext2 filesystems.

Naturally you can look at the sources for similar programs
for each other fs which you intend to support. Note that
most of these programs are under the GPL. While studying
them and writing your own code is probably a fair use,
if you intend to "cut and paste" code from them you must
read and respect their licenses (which would be in
conflict with any copy-protection applications which you
might have in mind).

I realize I'm reading a lot into your question. I don't
know of any other rational uses for bogus "bad blocks."

It clarifies things just fine. This is the Linux
Gazette. I answer questions that relate to Linux.

If you have programming questions that related to Win '95
and/or Delphi --- please go to Yahoo! and look for a
Win '95 or Delphi "Answer Guy" (or other support forum).

You paid money for that commercial software --- with the
stated or implied benefit of technical support. It's really
a pity that the companies that sold you these packages aren't
delivering on that promise.

As I said, you can look at the Linux sources for
many examples of manipulating many types of filesystems
(including MS-DOS/Win '95) -- those examples are mostly in
C.

Thanking you once more for ur consideration
Expecting a reply soon

Have you ever read any of my other answers?
How did you find my address without getting any indication
of the focus of my work? Is it just that using all that
vendorware has left you desparately seeking support from
anyone you can find?