bug-parted
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

re: Need for a unique Linux GPT GUID type code (PATCH included)


From: Rod Smith
Subject: re: Need for a unique Linux GPT GUID type code (PATCH included)
Date: Thu, 23 Jun 2011 11:46:22 -0400
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110514 Lightning/1.0b3pre Thunderbird/3.1.10

jdd wrote:

Le 23/06/2011 06:38, Rod Smith a écrit :


    At the risk of jumping the gun, I'm attaching a patch to implement my
    suggestion in libparted.

did you test it with windows? Because in non GPT disk, Windows never acknoledge 
Linux drives, but always ask for formatting.

I have no GPT disk to try

Yes, that's the whole point. In Windows, using the same GUID type code for Linux partitions that Windows uses for NTFS and FAT results in Linux partitions appearing in the list of available disks. Using a unique type code for Linux partitions, however, hides those partitions from Windows. This is desirable because it's easy to accidentally trash a Linux partition in Windows by double-clicking it. (Windows DOES ask before formatting it, but a user who's confused, tired, distracted, etc., could easily make the wrong choice.) If you've got a lot of Linux partitions, they also just clutter up the list of available Windows devices.

With MBR disks, this problem doesn't occur, because Linux has its own unique partition type code (0x83), and Windows doesn't try to access partition types it doesn't understand. Thus, on MBR disks, Linux partitions don't normally appear in the Windows list of disks (in the "Computer" window, among other places). Using a unique GUID type code for Linux makes GPT disks work like MBR disks in this respect.

You can test this with a USB flash drive: Put a GPT disklabel on it, create a Linux partition with the standard version of parted, create any Linux filesystem on it (I've tried ext2/3/4, ReiserFS, XFS, JFS, and BtrFS), and move it over to a Windows box. It'll pop up a dialog box asking if you want to format the disk. Do the same thing with my patched version of parted and it won't do that; Windows know enough not to try to access a partition that's marked with a type code it doesn't understand. The "Format..." option is also grayed out in Disk Management when you use a non-Windows partition type code GUID.

--
Rod Smith
address@hidden
http://www.rodsbooks.com



reply via email to

[Prev in Thread] Current Thread [Next in Thread]