// // Copyright (c) 2008-2011, Kenneth Bell // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. // namespace DiscUtils.Partitions { using System; /// /// Convenient access to well known GPT partition types. /// public static class GuidPartitionTypes { /// /// EFI system partition. /// public static readonly Guid EfiSystem = new Guid("C12A7328-F81F-11D2-BA4B-00A0C93EC93B"); /// /// BIOS boot partition. /// public static readonly Guid BiosBoot = new Guid("21686148-6449-6E6F-744E-656564454649"); /// /// Microsoft reserved partition. /// public static readonly Guid MicrosoftReserved = new Guid("E3C9E316-0B5C-4DB8-817D-F92DF00215AE"); /// /// Windows basic data partition. /// public static readonly Guid WindowsBasicData = new Guid("EBD0A0A2-B9E5-4433-87C0-68B6B72699C7"); /// /// Linux LVM partition. /// public static readonly Guid LinuxLvm = new Guid("E6D6D379-F507-44C2-A23C-238F2A3DF928"); /// /// Linux swap partition. /// public static readonly Guid LinuxSwap = new Guid("0657FD6D-A4AB-43C4-84E5-0933C84B4F4F"); /// /// Windows Logical Disk Manager metadata. /// public static readonly Guid WindowsLdmMetadata = new Guid("5808C8AA-7E8F-42E0-85D2-E1E90434CFB3"); /// /// Windows Logical Disk Manager data. /// public static readonly Guid WindowsLdmData = new Guid("AF9B60A0-1431-4F62-BC68-3311714A69AD"); /// /// Converts a well known partition type to a Guid. /// /// The value to convert. /// The GUID value. internal static Guid Convert(WellKnownPartitionType wellKnown) { switch (wellKnown) { case WellKnownPartitionType.Linux: case WellKnownPartitionType.WindowsFat: case WellKnownPartitionType.WindowsNtfs: return WindowsBasicData; case WellKnownPartitionType.LinuxLvm: return LinuxLvm; case WellKnownPartitionType.LinuxSwap: return LinuxSwap; default: throw new ArgumentException("Unknown partition type"); } } } }