"msftres" flag bug in GNU Parted while using GPT disk

Bug #397386 reported by Keshav Amburay
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
parted (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: parted

Please correct the "msftres" flag bug in libparted by deleting the following code from (parted-source-dir)/libparted/labels/gpt.c :-

if (strncmp (fs_type->name, "fat", 3) == 0
|| strcmp (fs_type->name, "ntfs") == 0) {
gpt_part_data->type = PARTITION_MSFT_RESERVED_GUID;
return 1;
}

The "Microsoft Reserved" Partition in GPT is needed only for conversion from a basic disk to dynamic disk in Windows. Otherwise it is not at all needed and according to Microsoft, any FAT(16,32 etc..) or NTFS partition(s) should be "Basic Data Partition" if they have to be accessible in Windows and Mac (Linux allows access even to a msftres partition).

Think of it like the 128 MB gap between partitions imposed by Mac OS X's Disk Utility in GPT disk for future usage which cannot be anticipated at present. Microsoft creates this partition for any future usage similar to the 128 MB gap.

The above mentioned code in libparted assumes that any FAT or NTFS partition must be marked as Microsoft Reserved (the same way any HFS partition must be marked Apple_HFS), but this is not correct.

This bug can be corrected by either deleting the above lines or by modifying them as follows :-

if (strncmp (fs_type->name, "fat", 3) == 0
|| strcmp (fs_type->name, "ntfs") == 0) {
gpt_part_data->type = PARTITION_BASIC_DATA_GUID;
return 1;
}

Related branches

description: updated
Revision history for this message
Keshav Amburay (keshava2015) wrote :

What is a Microsoft Reserved Partition?

The Microsoft Reserved Partition reserves space on each disk drive for subsequent use by operating system software. GUID Partition Table disks do not allow hidden sectors. Software components that formerly used hidden sectors now allocate portions of the Microsoft Reserved Partition for component-specific partitions. For example, converting a basic disk to a dynamic disk causes the Microsoft Reserved Partition on that disk to be reduced in size and a newly created partition holds the dynamic disk database.

Retrieved from http://support.microsoft.com/kb/302873 - FAQ about GPT Disk Architecture

Revision history for this message
Keshav Amburay (keshava2015) wrote :

Will end users see the Extensible Firmware Interface System Partition, Microsoft Reserved Partition, and OEM-specific partitions?

The user won't see these partitions exposed in Windows Explorer, nor is any recognized file system exposed to legacy programs such as Context Indexing. The Extensible Firmware Interface System Partition, OEM-specific, and other unrecognized partitions will be visible only in the Disk Management MMC snap-in.

What partitions are mounted by default by Windows?

Windows exposes only basic data partitions. Other partitions with FAT file systems may be mounted, but not exposed (only programmatically). Only basic data partitions are assigned drive letters or mount points.

The Microsoft Reserved Partition (and any partitions that are created from the Microsoft Reserved Partition) could have recognizable file systems; none are exposed.

What happens when a basic disk is converted to dynamic?

For a drive to be eligible for conversion to dynamic, all basic data partitions on the drive must be contiguous. If other unrecognized partitions separate basic data partitions, the disk cannot be converted. This is one of the reasons that the Microsoft Reserved Partition must be created before any basic data partitions.

The first step in conversion is to separate a portion of the Microsoft Reserved Partition to create the configuration database partition. All non-bootable basic partitions are then combined into a single data container partition. Boot partitions are retained as separate data container partitions. This is analogous to conversion of primary partitions.

Revision history for this message
Keshav Amburay (keshava2015) wrote :

This bug has been corrected in GNU Parted GIT repository
http://git.debian.org/?p=parted/parted.git (as on 25th September 2009).

Colin Watson (cjwatson)
Changed in parted (Ubuntu):
status: New → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package parted - 2.1-2ubuntu1

---------------
parted (2.1-2ubuntu1) lucid; urgency=low

  * Resynchronise with Debian experimental (LP: #511075). Remaining
    changes:
    - gptsync.dpatch: On Intel Mac systems, write a synced MBR rather than a
      protective MBR.
    - Add -fno-stack-protector on sparc.
    - sparc-new-label.dpatch: Fix sparc disk label generation. This is
      required for LDOM and parallel installations with Solaris 10.
    - loop-partitions.dpatch: Loop devices can only have one partition, so
      don't generate device names such as "/dev/loop0p1".
    - udevadm-settle.dpatch: Run 'udevadm settle' either side of rereading
      the partition table, to avoid a variety of races.
    - dmraid.dpatch: Ensure that device-mapper devices for dmraid arrays do
      not have extra nodes created needlessly, as well as making sure that
      partition nodes for dmraid devices are not probed.
  * Upstream fixes:
    - Supports non-512-byte logical sectors (LP: #505549).
    - Do not discard bootcode from extended partition on msdos label when
      some of the logical partitions are changed (LP: #445067).
    - Don't use msftres flag for FAT/NTFS partitions on GPT (LP: #397386).

parted (2.1-2) experimental; urgency=low

  * Build-depend on libblkid-dev, since otherwise we don't get
    minimum/optimum alignment handling on Linux.

parted (2.1-1) experimental; urgency=low

  * New upstream release

  [ Otavio Salvador ]
  * control.in: bump preferred soname for libreadline (closes: #553824).

  [ Colin Watson ]
  * control.in: Remove copy-and-paste error from libparted1.8-i18n
    description (closes: #497626).
  * copyright: Document parted.info's licence, namely GFDL 1.1 with no
    invariant sections, front-cover texts, or back-cover texts (closes:
    #500201).
  * rules: Cell partition tables are misdetected as pc98, so disable pc98
    support on powerpc (closes: #487833).
  * control.in: Don't build-depend on libdevmapper-dev on hurd-i386.
  * control.in: Build-depend on libdevmapper-dev (>= 1.02.33), for
    dm_task_set_major_minor.

  [ Xavier Oswald ]
  * debian/control.in:
    - Change my mail address
    - Bump Standards-Version to 3.8.3
    - Update Build-Depends on debhelper 7
  * debian/compat: update version to 7
  * Parted not informing the kernel of changes to the partition table
    (Closes: #557044), fixed upstream

  [ Otavio Salvador ]
  * debian/watch: fix URL to download
  * Switch to quilt to manage patches
    - unpartitioned-disks.dpatch, drop (merged upstream)
    - unblacklist-md.dpatch, drop (merged upstream)
    - amiga-raid-lvm-fix.dpatch, drop (not used for ages)
    - devfs.dpatch, drop (devfs is not used)
    - reiserfs-libname.dpatch, drop (referenced library is unavailable)

  [ Xavier Oswald, Colin Watson ]
  * Refresh update-ext4-code.patch

  [ Otavio Salvador ]
  * Fix parted-doc info files installation
  * Add lintian overrides for parted package
  * Use soname in libparted udeb name
 -- Colin Watson <email address hidden> Fri, 26 Feb 2010 14:27:21 +0000

Changed in parted (Ubuntu):
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.