On Sat, Nov 23, 2002 at 10:08:14AM +0100, Szakacsits Szabolcs wrote:
>
> Hi Andries,
>
> Thanks for your quick answer. I CC: my reply to some potentially
> interested parties.
>
> On Fri, 22 Nov 2002 And...@cw... wrote:
>
> > > Unfortunately the issue doesn't look very good :(
> > The truth is k=10^3, M=10^6, G=10^9.
>
> Yes, as I pointed out on http://physics.nist.gov/cuu/Units/binary.html
>
> > Slowly, old programs that use binary units are converted
> > to decimal ones. But there may be backwards compatibility
> > reasons to leave things.
>
> Here is a summary how different tools uses, k, M, G prefixes
> (please correct me if some entry is wrong, I made the list very
> quickly, some by just remembering).
>
> k M G
> fdisk 2^10 2^20 10^3*2^20
> cfdisk 10^3 10^6 10^9
> sfdisk 2^10 2^20
> parted 2^10 2^20
> resize_reiserfs 2^10 2^20 2^30
> ntfsresize 2^10 2^20 2^30
> fdisk (Windows) 2^10 2^20
>
> resize_reiserfs seems especially unlucky since it uses binary units
> but recommends cfdisk that uses decimal one. If one shrinks a reiserfs
> and gives the same or even a bit bigger units for resizing the given
> partition then he has a great chance the partition table, filesystem
> and/or his data will be destroyed sooner or later (a new partition can
> start in the middle of the resized filesystem).
Just thought I'd comment on the situation with Parted.
If you resize a file system that Parted supports directly, then
obviously the constraint solver will make sure everything fits :)
(It's one of the arguments in favour of coupling a fs interface with
a partition one)
If you resize a file system externally, then you have two options
for changing the partition table:
(1) rm and mkpart. If you get the numbers wrong, you're screwed.
(2) rm and rescue. Rescue works like gpart. (Looks at
signatures/superblocks, and figures out where everything should be)
In Parted, I plan to change the interface to allow arbitary
units to be expressed. I plan to change the default unit at
the same time... I'd rather not confuse users in the mean time.
Do you think I should?
(Maybe I should just hurry up and do units... it's not hard!)
Cheers,
Andrew
|