Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#684128: src:debian-installer: allow use of binary units in disk partitioner

57 views
Skip to first unread message

Ian Bruce

unread,
Aug 7, 2012, 5:40:02 AM8/7/12
to
Package: src:debian-installer
Severity: important
Tags: d-i

The version 6.0 installer invites users to specify the sizes of disk
partitions and volumes in units of "K", "M", "G", and "T". Only later do
they find out that what is meant by this is the politically-correct
decimal units 10^3, 10^6, 10^9, and 10^12, rather than the conventional
binary units of 2^10, 2^20, 2^30, and 2^40. One is only likely to
discover this when the installation is complete, and if that is not what
was wanted, it is then too late to do anything about it other than wipe
the disk and start all over again.

This is not a trivial problem. It is quite reasonable, for example, to
want to be able to say "this system has eight gigabytes of main memory"
and "this system has eight gigabytes of swap space", and have those two
values mean the same thing. The difference between a binary and decimal
"gigabyte" is over seven percent, not insignificant when allocating
filesystem storage.

Currently the only solution is to know in advance (probably by learning
the hard way) that decimal units are being used, and if binary units are
wanted, to write them out in full: 1024, 1048576, 1073741824, etc. This
is clearly not adequate.

Possible solutions:

1 - AT AN ABSOLUTE MINIMUM: at the point where the use of metric
suffixes is suggested, explain that these really are decimal, so that
people who want the binary values know that they need to write them out,
as above.

2 - Give the suffixes the same binary values that many people would
expect them to have, and explain this. There is no need to support the
hard disk manufacturers' deceptive marketing strategy. Flash drives are
not specified with decimal units. (Are they?)

3 - Let the user choose at the beginning of partitioning whether these
units will have binary or decimal meanings, both for specifying new
partitions and volumes, and reporting those that are already present, as
well as the sizes of physical media.

4 - The disk partitioner is presumably based on GNU parted, which allows
either binary ("KiB", "MiB", "GiB", "TiB") or decimal ("KB", "MB", "GB",
"TB") units to be used. Explain to the user that they may specify any of
these units, and pass them through to parted.

5 - Solution (4) leaves open the question of what units will be used to
report volume/partition/disk status. Parted provides the "unit" command
for this purpose, as well as that of solution (3). Perhaps this should
be made available as a menu option, or in some other way.

6 - Alternatively, if the size of some disk volume is an exact multiple
of 2^{10,20,30,40}, report it using the appropriate binary unit,
otherwise with a decimal unit.

http://www.gnu.org/software/parted/manual/html_node/unit.html

Hopefully something can be done about this problem before the next major
release.


-- System Information:
Debian Release: wheezy/sid
APT prefers testing
APT policy: (990, 'testing'), (500, 'stable-updates'), (500, 'unstable'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 3.2.0-3-amd64 (SMP w/1 CPU core)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/dash


--
To UNSUBSCRIBE, email to debian-bugs-...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org

Christian PERRIER

unread,
Aug 7, 2012, 8:10:02 AM8/7/12
to
reassign 684128 partman-partitioning
thanks
All of theseimply too invasive changes in the installer, particularly
in translatable material. This is zero chance that anything is done at
this point of the release.

This issue will have to be worked on for jessie, not for
wheezy. Hopefully someone will come with a patch (I somehow doubt it
as I think that only incredibly picky people really do care about
differencesbetween MB and MiB......but, who knows?).

Anyway, reassigning this to the package it belongs to.

signature.asc

Joey Hess

unread,
Aug 7, 2012, 11:20:03 AM8/7/12
to
Christian PERRIER wrote:
> This issue will have to be worked on for jessie, not for
> wheezy. Hopefully someone will come with a patch (I somehow doubt it
> as I think that only incredibly picky people really do care about
> differencesbetween MB and MiB......but, who knows?).

The difference between a TB and a TiB is 93 GiB (or 99 GB).

While I loathe the SI decimal units [1] displaying them is the right default,
sadly. But human2longint should certianly be extended to handle the "iB"
units.

--
see shy jo

[1] http://source.git-annex.branchable.com/?p=source.git;a=blob;f=Utility/DataUnits.hs
signature.asc

Jeff Norden

unread,
Aug 13, 2019, 2:10:03 PM8/13/19
to
Well, it's been 7 years since this bug was opened.

Sure, it's not killing anyone. And I assume that the partitioner
correctly handles alignment issues for current drives. But still, IMHO,
any time software does something other than what you expect it to do,
it's broken.

A simple suggestion: just have partman correctly parse KiB, MiB, GiB,
and TiB when someone manually enters a partition size. Currently, these
generate an error message. Also, on that page, include a short
explanation of the acceptable units and their meanings.

I'd say it's fine for partman to just always display partition sizes in
10^n units. The only folks likely to care about this are ones doing
manual partitioning. It's likely that any such person will understand
what's going on when they specify a 32GiB partition and then see 34.4GB
in the list of partitions.

It also might be handy to include fdisk on the net-install cd, for use
in a shell (or ctrl-alt-f2). But that might be a pain, given that fdisk
now has its own shared libs.

Just my 2c.
-Jeff

Thorsten Glaser

unread,
Jul 25, 2023, 4:30:05 PM7/25/23
to
found 684128 226
thanks

Hi,

why is this bug still unfixed?

In bookworm d-i, entering 512 MiB seems to be using something
entirely different, and 512 Mi gives an error “invalid size”.

This still makes d-i unsuitable for most partitioning.

bye,
//mirabilos
--
[...] if maybe ext3fs wasn't a better pick, or jfs, or maybe reiserfs, oh but
what about xfs, and if only i had waited until reiser4 was ready... in the be-
ginning, there was ffs, and in the middle, there was ffs, and at the end, there
was still ffs, and the sys admins knew it was good. :) -- Ted Unangst über *fs

Cyril Brulebois

unread,
Jul 25, 2023, 5:22:17 PM7/25/23
to
Control: notfound -1 226
Control: close -1 225

Hi,

Thorsten Glaser <t...@debian.org> (2023-07-25):
> why is this bug still unfixed?

https://www.debian.org/devel/debian-installer/News/2023/20230516.en.html
documents a fix for #913431, which is a duplicate of this bug report.

Closing this one accordingly.

> In bookworm d-i, entering 512 MiB seems to be using something
> entirely different, and 512 Mi gives an error “invalid size”.

“Something entirely different” compared to what?

The second syntax is indeed invalid.

> This still makes d-i unsuitable for most partitioning.

Feel free to use a different tool.


Cheers,
--
Cyril Brulebois (ki...@debian.org) <https://debamax.com/>
D-I release manager -- Release team member -- Freelance Consultant
signature.asc

Thorsten Glaser

unread,
Jul 25, 2023, 7:10:05 PM7/25/23
to
Cyril Brulebois dixit:

>https://www.debian.org/devel/debian-installer/News/2023/20230516.en.html
>documents a fix for #913431, which is a duplicate of this bug report.

Huh.

>> In bookworm d-i, entering 512 MiB seems to be using something
>> entirely different
>
>“Something entirely different” compared to what?

I was a few metres across the room, but I heard something around
twohundred-something, which was definitely no power of two either.

>The second syntax is indeed invalid.

OK, it was only tried as last resort anyway.

>> This still makes d-i unsuitable for most partitioning.
>
>Feel free to use a different tool.

Oh, I personally do, but not everyone is I.

bye,
//mirabilos
--
22:20⎜<asarch> The crazy that persists in his craziness becomes a master
22:21⎜<asarch> And the distance between the craziness and geniality is
only measured by the success 18:35⎜<asarch> "Psychotics are consistently
inconsistent. The essence of sanity is to be inconsistently inconsistent

Holger Wansing

unread,
Jul 26, 2023, 4:40:27 PM7/26/23
to

Thorsten Glaser <t...@debian.org> wrote (Tue, 25 Jul 2023 20:15:04 +0000 (UTC)):
> why is this bug still unfixed?
>
> In bookworm d-i, entering 512 MiB seems to be using something
> entirely different, and 512 Mi gives an error “invalid size”.
>
> This still makes d-i unsuitable for most partitioning.

With a 12.0 netinst image, creating a new partition with a size of 512 MiB
results in a parition of 536 MB, creating a partiton of 10 GiB results in
a partition of 10,7 GB.
So I guess it works as it should.

The (visual) output is still in MB / GB, apart from this a see no issue.


Holger

--
Holger Wansing <hwan...@mailbox.org>
PGP-Fingerprint: 496A C6E8 1442 4B34 8508 3529 59F1 87CA 156E B076

Thorsten Glaser

unread,
Jul 26, 2023, 5:30:05 PM7/26/23
to
reopen 684128
retitle 684128 src:debian-installer: show ISO/IEC 60027-2 units (as well); show valid suffixes
found 684128 226
thanks

Holger Wansing dixit:

>So I guess it works as it should.
>
>The (visual) output is still in MB / GB, apart from this a see no issue.

Hrm, the output being only in one format can be a problem, but it’s
not as critical. I would still love for *that* to be fixed, i.e. either
only ISO/IEC 60027-2 units or both those and decimal.

>With a 12.0 netinst image, creating a new partition with a size of 512 MiB
>results in a parition of 536 MB

OK, thanks for confirming. I heard twohundred-something across the room,
which would have been quite off, but didn’t have a chance to visually
inspect myself.

Could this information (valid unit sufficēs) be added to the dialogue
where the size is entered? Screen space should suffice.

I’ll repurpose this bug for that (both input and output changes).

Thanks,
//mirabilos
--
"Using Lynx is like wearing a really good pair of shades: cuts out
the glare and harmful UV (ultra-vanity), and you feel so-o-o COOL."
-- Henry Nelson, March 1999

Holger Wansing

unread,
Jul 28, 2023, 4:20:05 AM7/28/23
to
Hi,


Am 26. Juli 2023 23:19:31 MESZ schrieb Thorsten Glaser <t...@debian.org>:
>
>Could this information (valid unit sufficēs) be added to the dialogue
>where the size is entered? Screen space should suffice.

Yes, I already thought about if changing the template would make sense here.



That would require synchron changings in partman-partitioning and
partman-auto-lvm.


Patches attached as a proposal.
CC'ing debian-l10n-english for template review (three identical additions
in two packages).


Holger







partman-partitioning__mention-decimal-and-binary-units.diff
partman-auto-lvm__mention-decimal-and-binary-units.diff

Justin B Rye

unread,
Jul 28, 2023, 5:10:06 AM7/28/23
to
Holger Wansing wrote:
> Thorsten Glaser <t...@debian.org>:
>> Could this information (valid unit sufficēs) be added to the dialogue
>> where the size is entered? Screen space should suffice.
[...]
> CC'ing debian-l10n-english for template review (three identical additions
> in two packages).
[...]
> Hint: "max" can be used as a shortcut to specify the maximum size, or
> enter a percentage (e.g. "20%") to use that percentage of the maximum size.
> + You can specify partition sizes in decimal units (like MB or GB) as well as
> + in binary units (like GiB or TiB).

Looks good to me. Mind you, this makes the passive voice in the first
line a bit more of a stylistic and syntactic mismatch, so I might
suggest changing it to

Hint: you can use "max" as a shortcut to specify the maximum size, or

throughout...
--
JBR with qualifications in linguistics, experience as a Debian
sysadmin, and probably no clue about this particular package

Thorsten Glaser

unread,
Jul 28, 2023, 4:10:05 PM7/28/23
to
Holger Wansing dixit:

>>Could this information (valid unit sufficēs) be added to the dialogue
>>where the size is entered? Screen space should suffice.
>
>Yes, I already thought about if changing the template would make sense here.

Thanks!

Could we also get the size output in both formats? I realise that
will most likely not be a change as simple…

bye,
//mirabilos
--
15:41⎜<Lo-lan-do:#fusionforge> Somebody write a testsuite for helloworld :-)

Holger Wansing

unread,
Aug 12, 2023, 6:30:05 PM8/12/23
to
Hi,

Justin B Rye <justin....@gmail.com> wrote (Fri, 28 Jul 2023 10:04:09 +0100):
> Holger Wansing wrote:
> > Thorsten Glaser <t...@debian.org>:
> >> Could this information (valid unit sufficēs) be added to the dialogue
> >> where the size is entered? Screen space should suffice.
> [...]
> > CC'ing debian-l10n-english for template review (three identical additions
> > in two packages).

I found there is another template, which needs to be changed for this.

Patch attached (especially for review on l10n-english).
2_partman-lvm.diff

Richard Lewis

unread,
Aug 13, 2023, 5:30:06 AM8/13/23
to
Holger Wansing <hwan...@mailbox.org> writes:

> Justin B Rye <justin....@gmail.com> wrote (Fri, 28 Jul 2023 10:04:09 +0100):
>> Holger Wansing wrote:
>> > Thorsten Glaser <t...@debian.org>:
>> >> Could this information (valid unit sufficēs) be added to the dialogue
>> >> where the size is entered? Screen space should suffice.
>> [...]
>> > CC'ing debian-l10n-english for template review (three identical additions
>> > in two packages).
>
> I found there is another template, which needs to be changed for this.
>
> Patch attached (especially for review on l10n-english).

diff --git a/debian/partman-lvm.templates b/debian/partman-lvm.templates
index 509d9a7..63219c0 100644
--- a/debian/partman-lvm.templates
+++ b/debian/partman-lvm.templates
@@ -376,8 +376,9 @@ Type: string
# :sl3:
_Description: Logical volume size:
Please enter the size of the new logical volume. The size may be
entered in the following formats: 10KB (Kilobytes), 10KiB (Kibibytes), 10MB
(Megabytes), 10MiB (Mebibytes), 10GB (Gigabytes), 10GiB (Gibibytes), 10TB
(Terabytes), 10TiB (Tebibytes). The default unit is Megabytes.
^^^^^^^^^^

I wonder if this last word is a typo and should say Gigabytes? (if not
please consider changing the installer default - no-one is going to be
happy to have accidentally made a MB-sized partition!)

I reads OK as-is, but to avoid repetition of 'enter the size' you could
start the second sentence with something like "You can use the following
formats:"

Holger Wansing

unread,
Aug 13, 2023, 8:40:07 AM8/13/23
to
Hi,

Am 13. August 2023 10:46:50 MESZ schrieb Richard Lewis <richard.le...@googlemail.com>:
>Holger Wansing <hwan...@mailbox.org> writes:
>
> (Terabytes), 10TiB (Tebibytes). The default unit is Megabytes.
> ^^^^^^^^^^
>
>I wonder if this last word is a typo and should say Gigabytes? (if not
>please consider changing the installer default - no-one is going to be
>happy to have accidentally made a MB-sized partition!)

No, that's no typo. And the patch does not touch this.
So, it's just the current status quo.

But I will evaluate, if that should be changed.

>I reads OK as-is, but to avoid repetition of 'enter the size' you could
>start the second sentence with something like "You can use the following
>formats:"

LGTM, thanks


Holger

--
Sent from /e/ OS on Fairphone3

Holger Wansing

unread,
Aug 16, 2023, 1:50:04 PM8/16/23
to
Hi,

Thorsten Glaser <t...@debian.org> wrote (Fri, 28 Jul 2023 19:53:52 +0000 (UTC)):
> Holger Wansing dixit:
>
> >>Could this information (valid unit sufficēs) be added to the dialogue
> >>where the size is entered? Screen space should suffice.
> >
> >Yes, I already thought about if changing the template would make sense here.
>
> Thanks!

Just pushed (to partman-partitioning, partman-auto-lvm and partman-lvm).


> Could we also get the size output in both formats? I realise that
> will most likely not be a change as simple…


Holger Wansing

unread,
Aug 23, 2023, 4:00:05 AM8/23/23
to
Hi,

Holger Wansing <hwan...@mailbox.org> wrote (Wed, 16 Aug 2023 19:40:38 +0200):
> Hi,
>
> Thorsten Glaser <t...@debian.org> wrote (Fri, 28 Jul 2023 19:53:52 +0000 (UTC)):
> > Holger Wansing dixit:
> >
> > >>Could this information (valid unit sufficēs) be added to the dialogue
> > >>where the size is entered? Screen space should suffice.
> > >
> > >Yes, I already thought about if changing the template would make sense here.
> >
> > Thanks!
>
> Just pushed (to partman-partitioning, partman-auto-lvm and partman-lvm).

And uploaded:
- partman-partitioning 148
- partman-auto-lvm 92
- partman-lvm 147
0 new messages