After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 711098 - Default partition table can not handle > 2 TiB disks
Default partition table can not handle > 2 TiB disks
Status: RESOLVED FIXED
Product: gparted
Classification: Other
Component: application
GIT HEAD
Other All
: Normal enhancement
: ---
Assigned To: gparted maintainers alias
gparted maintainers alias
Depends on:
Blocks:
 
 
Reported: 2013-10-29 19:33 UTC by Phillip Susi
Modified: 2014-02-19 17:50 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
0001-Default-to-GPT-on-2-TiB-disks-711098.patch (3.98 KB, patch)
2013-12-13 23:22 UTC, Phillip Susi
none Details | Review
Use GPT partition table for disks >= 2 TiB (v2) (6.96 KB, patch)
2014-01-03 15:58 UTC, Mike Fleetwood
none Details | Review
Use GPT partition table for disks >= 2 TiB (v3) (13.62 KB, patch)
2014-01-04 15:56 UTC, Mike Fleetwood
none Details | Review

Description Phillip Susi 2013-10-29 19:33:19 UTC
The default partition table is msdos, which does not work for > 2 TiB disks.  The default should change to gpt at least for such disks and I have worked up a patch to do so.  I wonder though, whether there is any reason to stick with msdos as the default for smaller disks or we should just change to gpt always.  What do you think Curtis?
Comment 1 Phillip Susi 2013-10-30 02:22:15 UTC
Changing the default based on disk size seems like it is going to be non trivial.  I can do it, but it would be much easier to just change the default full stop.  The more I think about it the more I think this makes sense.  It might have made sense in 2004 to stick with msdos as the default unless gpt is required, but these days, every currently supported OS supports gpt, so I don't see a reason to stick with msdos even when gpt isn't required.

What do you think?
Comment 2 Mike Fleetwood 2013-11-09 09:52:25 UTC
Hi Phillip,

Observations:
(1) Most portable external storage is still mostly < 2 TiB in size and
    comes pre-formatted with MSDOS partition table.

(2) Lots of devices such as media players, phones, etc. which can use
    portable external storage will probably only understand MSDOS
    partitioning for years to come.

(3) Fedora 19 installer still creates MSDOS partitioning if the machine
    booted used legacy BIOS (and GPT if it booted using EFI).  What does
    the current Debian and/or Ubuntu install do?

(4) Looking at the code it doesn't seem that hard to pass the current
    device object to GParted_Core::get_disklabeltypes() so that it can
    order the partition types appropriately; and add secondary wording
    in Dialog_Disklabel::Dialog_Disklabel() along the lines of:
        Default is to create a GPT (GUID Partition Table) for disks
        larger than 2 TiB


For reasons of backward compatibility and only changing when needed I
think it is best to use GPT only for drives > 2 TiB and continue to use
MSDOS partitioning for smaller drives.

Thanks,
Mike
Comment 3 Curtis Gedak 2013-11-11 17:16:55 UTC
> For reasons of backward compatibility and only changing when needed I
> think it is best to use GPT only for drives > 2 TiB and continue to use
> MSDOS partitioning for smaller drives.

My thoughts are that defaulting to MSDOS for drive < 2 TiB and to GPT for drives >= 2 TiB would provide our users with a better experience.

Since the default will toggle depending on drive size, I think it might help to get rid of the extra click for "> Advanced" on the "Create Partition Table" dialog, and show the drop down list of partition table types directly.

Curtis
Comment 4 Mike Fleetwood 2013-11-14 08:00:48 UTC
(In reply to comment #2)
> (3) Fedora 19 installer still creates MSDOS partitioning if the machine
>     booted used legacy BIOS (and GPT if it booted using EFI).  What does
>     the current Debian and/or Ubuntu install do?

To answer my own question; Ubuntu 13.10 installer creates MSDOS
partitioning (on a machine which boots using legacy BIOS).
Comment 5 Phillip Susi 2013-12-13 23:22:20 UTC
Created attachment 264176 [details] [review]
0001-Default-to-GPT-on-2-TiB-disks-711098.patch

Here we go... no more advanced expander, and defaults to gpt at 2 TiB.
Comment 6 Mike Fleetwood 2014-01-03 15:58:10 UTC
Created attachment 265226 [details] [review]
Use GPT partition table for disks >= 2 TiB (v2)

Hi Phillip and Curtis,

Here's v2 of Phillip's patch.  Tidied the code a little, updated the
commit message making it clear msdos is < 2 TiB and gpt is >= 2 TiB.
Added a commit to update the manual.

Passed testing on Fedora 19 using loopback devices of various sizes to
confirm the cutover is as documented.
  Sizes: 2T-512, 2T, 2T+512, 4T

(I think the cutover could have been msdos <= 2 TiB, rather than just
< 2 TiB, but fdisk includes a warning for msdos partition tables at
2 TiB so I though it was best to stick with that).
    fdisk: warn users about 2.2TB dos partition limit
    http://git.kernel.org/cgit/utils/util-linux/util-linux.git/commit/?id=ee5355e0052889792601c18cae2db0c17d68f61b

If there aren't any objections I'll be committing this next week.

Thanks,
Mike
Comment 7 Curtis Gedak 2014-01-03 17:22:05 UTC
Thank you Phillip and Mike for your work on this enhancement.

With the arrival of the new year I am once again focussing more time on GParted.

I have been testing on kubuntu 12.04 and the patch in comment #6 is working as expected.

One anomaly I noticed is that the drop-down list of partition table types is not sorted in alphabetical order.  Instead the default partition table is listed at the top and the remaining entries are in alphabetical order.

What are your thoughts on keeping the list of partition table types in order similar to how we handle this for file system types?

See:
https://git.gnome.org/browse/gparted/tree/src/Dialog_Partition_New.cc#n334

Curtis
Comment 8 Mike Fleetwood 2014-01-03 21:30:21 UTC
Hi Curtis,

(In reply to comment #7)
> One anomaly I noticed is that the drop-down list of partition table types is
> not sorted in alphabetical order.  Instead the default partition table is
> listed at the top and the remaining entries are in alphabetical order.
> 
> What are your thoughts on keeping the list of partition table types in order
> similar to how we handle this for file system types?
> 
> See:
> https://git.gnome.org/browse/gparted/tree/src/Dialog_Partition_New.cc#n334

Current order is what libparted returns when iterating through by
ped_disk_type_get_next() which is:
    aix, amiga, bsd, dvh, gpt, mac, msdos, pc98, sun, loop
with msdos or gpt moved to first place by get_disklabeltypes() to
make it the default.

Having them ordered seems reasonable.  I'm working on it.

One question: Do you want strict alphabetic order or just the order
returned by libparted, which is almost alphabetic except loop must
be last?

Libparted determines the order by the reverse of which they are
initialised in init_disk_types()
http://git.savannah.gnu.org/cgit/parted.git/tree/libparted/libparted.c#n79

Thanks,
Mike
Comment 9 Mike Fleetwood 2014-01-04 15:56:26 UTC
Created attachment 265307 [details] [review]
Use GPT partition table for disks >= 2 TiB (v3)

Hi Curtis,

Here's patch set v3.


Changes from v2 are:

1) Small change to patch number 1:
      Default to GPT on disks >= 2 TiB (#711098)
   Remove left behind expander_advanced member variable, and trivial
   commit message change.

2) Adds this patch:
      Display partition table types in order (#711098)
   Uses libparted's default order, alphabetic with "loop" last.

3) Trivial commit message change to patch number 3.


Tested on CentOS 5.x with small disk and on Fedora 19 with disks small
and large.


Thanks,
Mike
Comment 10 Curtis Gedak 2014-01-04 17:51:07 UTC
Hi Mike,

Wow, that was quick!  Thank you for the prompt response and new patch.

> One question: Do you want strict alphabetic order or just the order
> returned by libparted, which is almost alphabetic except loop must
> be last?

The order returned by libparted should be fine.  I haven't used "loop" myself and suspect that it is not widely used by GParted users.

I will test and report back with my findings.

Curtis
Comment 11 Phillip Susi 2014-01-04 17:59:24 UTC
It isn't used at all by gparted users since it is broken ;)

See the other bug for my patch to fix it.  Also requires patches to parted.
Comment 12 Curtis Gedak 2014-01-04 18:38:03 UTC
Thanks Phillip for the heads up about "loop".

Mike,

The patch set in comment #9 worked as expected in all my tests on kubuntu 12.04 with parted-2.3-8ubuntu5.1.  I tested with loopback devices with sizes: 2T-512, 2T, 2T+512, and 4T.

In comment #6 you mentioned that you would commit next week if there were no objections.  I am in favour of proceeding with committing the patch set in comment #9 to the git master branch.

Thanks,
Curtis
Comment 13 Mike Fleetwood 2014-01-06 10:56:22 UTC
Hi Phillip and Curtis,

Thanks for the code and review.  The following changes have been
committed to the GParted git repository:

Default to GPT on disks >= 2 TiB (#711098)
https://git.gnome.org/browse/gparted/commit/?id=07bd72ba805e74517e0d3dc97c5c4462095e8266

Display partition table types in order (#711098)
https://git.gnome.org/browse/gparted/commit/?id=7b43d527206d5d0761f9d07cffd0b178b6f7b4d2

Update manual with default to GPT on disks >= 2 TiB (#711098)
https://git.gnome.org/browse/gparted/commit/?id=433bde09222ff36f62f91e63d610728266453898

Thanks,
Mike
Comment 14 Curtis Gedak 2014-02-19 17:50:30 UTC
This enhancement was included in the GParted 0.18.0 release on February 19,
2014.