parted should create Linux filesystem partitions with Linux-specific type code

Bug #936661 reported by Rod Smith
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
parted (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Description of problem:

When creating GPT partitions for Linux filesystems, libparted uses the Microsoft Basic Data partition type code GUID (EBD0A0A2-B9E5-4433-87C0-68B6B72699C7). This is fine as far as Linux is concerned, since Linux ignores partition type codes for the most part; but the result is that the Windows file manager shows Linux filesystem partitions as being unformatted but accessible disks. Attempting to access such partitions results in a prompt to format them. (See attached screen shot.) This behavior is potentially dangerous; a simple user error can easily result in trashing the Linux installation.

Note that libparted creates partitions with appropriate Linux-specific type codes when creating swap, LVM, or Linux RAID partitions. It also creates Linux-specific type codes on MBR ("msdos") disks; it's ONLY Linux filesystems on GPT disks that are affected.

I created a patch for this problem almost eight months (see below), but the libparted developers have been slow to add it to libparted. I recommend it be added as a bug fix in Ubuntu.

This problem is likely to become increasingly important as UEFI-based systems become more common, since UEFI installations of Windows necessarily use GPT rather than MBR, which is more common on BIOS-based computers.

Version-Release number of selected component (if applicable):

3.0 and earlier.

How reproducible:

Always

Steps to Reproduce:
1. Launch parted (or any other libparted-using tool, including the Ubuntu installer) on a GPT disk.
2. Create a new partition with a Linux filesystem (ext#fs, ReiserFS, XFS, JFS, etc.).

Actual results:

The partition uses the Microsoft Basic Data type code.

Expected results:

The partition should use the Linux Filesystem Data type code (EBD0A0A2-B9E5-4433-87C0-68B6B72699C7)

Additional info:

I submitted a patch for this problem to the libparted developers in June of 2011, and they agreed to incorporate it into the mainstream libparted, but have yet to do so. The patch is available on the bug-parted mailing list or at http://www.rodsbooks.com/linux-fs-code/index.html.

ProblemType: Bug
DistroRelease: Ubuntu 11.10
Package: parted 2.3-6ubuntu3
ProcVersionSignature: Ubuntu 3.0.0-12.20-generic 3.0.4
Uname: Linux 3.0.0-12-generic x86_64
ApportVersion: 1.23-0ubuntu4
Architecture: amd64
Date: Sun Feb 19 20:37:23 2012
InstallationMedia: Ubuntu 11.10 "Oneiric Ocelot" - Release amd64 (20111012)
ProcEnviron:
 PATH=(custom, no user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: parted
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Rod Smith (rodsmith) wrote :
Revision history for this message
Rod Smith (rodsmith) wrote :

Here's the patch to fix the problem....

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "The patch against parted 3.0 to fix this problem" of this bug report has been identified as being a patch. The ubuntu-reviewers team has been subscribed to the bug report so that they can review the patch. In the event that this is in fact not a patch you can resolve this situation by removing the tag 'patch' from the bug report and editing the attachment so that it is not flagged as a patch. Additionally, if you are member of the ubuntu-reviewers team please also unsubscribe the team from this bug report.

[This is an automated message performed by a Launchpad user owned by Brian Murray. Please contact him regarding any issues with the action taken in this bug report.]

tags: added: patch
Revision history for this message
Phillip Susi (psusi) wrote :

This was fixed in saucy:

  * debian/patches/linux-specific-gpt-type.patch: Backport upstream
    changes to use a linux specific partition type code instead of
    Microsoft's, which causes Windows to offer to format the partition.

Changed in parted (Ubuntu):
status: New → Fix Committed
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.