[LWN Logo]

Date:	Mon, 11 May 1998 22:00:58 +0200 (MET DST)
From:	Andries.Brouwer@cwi.nl
To:	pavel@elf.ucw.cz
Subject: Re: Fdisk bug --- can cause data corruption....

> What is so wrong with fdisk?

It uses (C,H,S) as basic unit, instead of absolute number
of sectors. Everywhere there are implicit assumptions
about C being at most 1023, S at most 63, etc.

For example, if I want to make a partition from
cylinder 1000 to cylinder 1099, fdisk refuses
because that crosses the 1024 cylinder barrier.
Any particular such flaw can be easily fixed, but
there are so many that rewriting everything is easier.
(And there are other problems as well.)

In fact, a few days after fdisk destroyed an ext2 filesystem
on a 9 GB disk of mine, I did rewrite everything, and that
resulted in the present sfdisk.  Unfortunately it is too
powerful, and too user-unfriendly, so as a replacement
of fdisk it is a failure. Still some people use it
when they have a need for an fdisk that can be called
from a shell script and is not conversational.

In the meantime I also fixed all flaws I knew about in cfdisk;
that was easy enough, because cfdisk was well-written.

So, the present situation is:
There is Disk Druid.  I used it once (installing RedHat 5.0)
and discovered a file-system destroying bug and a few minor flaws.
Probably it will soon get better, and be a good fdisk alternative.

There is fdisk. It kind of works, and is the only fdisk with
BSD disklabel support.

There is cfdisk. It works well, but does not know about
BSD disklabels or any other disk partitioning scheme.
It has support for volume labels.

There is sfdisk. For hackers only. If you know what you
are doing, it will enable you to make two chains of
extended partitions (say one for DOS and both for Linux),
and do lots of other nifty things.
If you do not know what you are doing, you can cause
yourself no end of trouble.

A somewhat long and detailed answer; this is the third time
this week that I answer this question. Maybe a cc to linux-kernel
will help.

All the best - Andries



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu