GNOME Bugzilla – Bug 518439
Removal of msftres flag
Last modified: 2010-03-09 17:33:26 UTC
Please describe the problem: It is impossible to remove the "msftres" flag off an NTFS partition. parted /dev/device set 3 msftres off doesnt do the job. The flag is still on. The partition is inaccessible by OSs afterwards. Actually the FS type seems to have been changed from "Basic Data Partition EBD0A0A2-B9E5-4433-87C0-68B6B72699C7" to "Microsoft Reserved Partition E3C9E316-0B5C-4DB8-817D-F92DF00215AE" Steps to reproduce: 1. parted /dev/device set 3 msftres on 2. parted /dev/device set 3 msftres off 3. parted /dev/device show Actual results: Nothing Expected results: msftres flag to be off Does this happen every time? Yes Other information:
Another description of this problem and a possible work around is listed at: http://www.macosxhints.com/article.php?story=20080130022147512 The bug appears on the parted bug list at: http://parted.alioth.debian.org/cgi-bin/trac.cgi/ticket/186
The "msftres" flag bug in libparted is caused by the presence of 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; } Please correct this bug in the next version of GParted Live.
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
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.
*** Bug 588159 has been marked as a duplicate of this bug. ***
Thank you Keshav for this additional information. The Parted team appears to be active mostly on their mailing lists, and might not have seen the updated information in their bug tracking system on bug #186. http://parted.alioth.debian.org/cgi-bin/trac.cgi/ticket/186 Would you be able to post regarding this updated information on their mailing lists? My suggestion would be to post to the bug-parted@gnu.org mailing list.
A bug fix has been placed on the master branch of the parted git repository. http://lists.alioth.debian.org/pipermail/parted-devel/2009-September/003190.html
To update this bug, parted-1.9.0 will fail to disable the msftres flag on an NTFS partition with a GPT partition table. The BETA version of parted-2.0 will permit enabling and disabling of the msftres flag on an NTFS partition with a GPT partition table.
This problem has been fixed starting with parted-2.0. Testing has been successful with GParted Live 0.5.2-1 which includes the parted-2.2 package. Closing this bug.