Clear msftres and other GPT 'flags' set by GNU parted

Feb 06, '08 07:30:01AM

Contributed by: wm

This hint most likely only applies to people who have installed or used Linux on an Intel-based Mac. If this is not you, you may want to stop reading now.

Anyway, if you have tried to edit a GPT partition map using GNU parted, or a utility that uses libparted, and if you're not very good about following directions (like me), you may have accidentally set some of the partition "flags" that it exposes, such as msftres or boot. I put the term "flags" in quotes because it appears that parted actually changes the partition's type in the GPT from whatever it was before to -- in the case of msftres -- a "Microsoft Reserved" partition (GUID E3C9E316-0B5C-4DB8-817D-F92DF00215AE). These can have some unintended consequences -- as I found out, setting boot on any partition besides the EFI reserved one at the beginning of the disk will make any OS X installations on that disk unbootable.

Fortunately, boot can be easily unset the same way you set it (using parted). But, when you do so, at least using the version of parted that comes with Ubuntu Gutsy, the msftres flag is set, and parted won't let you unset it no matter how many times you try. The main problem this caused for me was that the partitions marked as msftres would no longer be mounted automatically by OS X, so they didn't show up in the Finder, and they were grayed out in Disk Utility. diskutil list indeed showed their type as "Microsoft Reserved Data" or something to that effect. (I don't remember exactly, and I didn't feel like changing the type back just to do testing for this hint.)

But -- and here's the hint -- it turns out that Disk Utility will still let you (try to) mount the partition, even though it's grayed out! Just select the partition and click Mount in the toolbar. If the filesystem is one that OS X recognizes (including FAT32 or NTFS), the volume will mount successfully and you can use it in OS X once again. What's more, as you can confirm using gpt or another utility, Disk Utility rewrites the partition map for you, back to the way it should be. (Although I don't know whether it does this on mount or when you later unmount the partition(s) in question, e.g. the next time you shut down OS X). At that point, everything is good as new.

I hope this helps someone out there; much anxious Googling didn't reveal anyone else who had figured out how to unset msftres.

Comments (13)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20080130022147512