srs5694 | 91544e1 | 2010-01-28 21:10:36 -0500 | [diff] [blame] | 1 | GPT fdisk (aka gdisk)
|
| 2 |
|
| 3 | by Roderick W. Smith, rodsmith@rodsbooks.com
|
| 4 |
|
| 5 | ******************************** IMPORTANT ********************************
|
| 6 | Most versions of Windows cannot boot from a GPT disk, and most varieties
|
| 7 | prior to Vista cannot read GPT disks. GPT fdisk is a partition editor for
|
| 8 | GPT disks, and it will *AUTOMATICALLY CONVERT* MBR disks to GPT form.
|
| 9 | Therefore, you should **NOT** use GPT fdisk on a Windows system unless you
|
| 10 | fully understand what you're doing! If you accidentally use GPT fdisk on
|
| 11 | your boot disk, or perhaps even on a data disk, you may find recovery to be
|
| 12 | very difficult!
|
| 13 | ***************************************************************************
|
| 14 |
|
| 15 | Read the main README file for general information on the program, and read
|
| 16 | the gdisk.html document (the Linux man page converted to HTML format) for
|
| 17 | detailed use information. My GPT fdisk Web page,
|
| 18 | http://www.rodsbooks.com/gdisk/, provides a more tutorial introduction to
|
| 19 | the software.
|
| 20 |
|
| 21 | Windows Use Notes
|
| 22 | -----------------
|
| 23 |
|
| 24 | The Windows version of GPT fdisk was added with version 0.6.2 of the
|
| 25 | package. The Windows binary package includes the gdisk.exe interactive
|
| 26 | text-mode program file but no equivalent to the sgdisk program that's
|
| 27 | available with Linux, FreeBSD, and OS X builds. In theory, an sgdisk.exe
|
| 28 | for Windows could be built if the popt library were installed. I've not
|
| 29 | attempted to do this myself, though. If you care to try, check
|
| 30 | http://gnuwin32.sourceforge.net/packages/popt.htm for information on popt
|
| 31 | for Windows.
|
| 32 |
|
| 33 | To install the program, copy the gdisk.exe program file to any directory on
|
| 34 | your path, such as C:\Windows. Alternatively, you can change to the
|
| 35 | program's directory or type its complete path whenever you use it.
|
| 36 |
|
| 37 | To use the program, first launch a Command Prompt as the Administrator. To
|
| 38 | do this, locate the Command Prompt program icon, right-click it, and select
|
| 39 | "Run as Administrator." If you use a non-Administrator Command Prompt, you
|
| 40 | won't be able to edit hard disk partition tables, although you will be able
|
| 41 | to edit raw disk image files.
|
| 42 |
|
| 43 | The program requires a hard disk identifier as an option. You can specify
|
| 44 | this in either of two forms. The first way is as a number followed by a
|
| 45 | colon, as in:
|
| 46 |
|
| 47 | gdisk 0:
|
| 48 |
|
| 49 | Disks are numbered starting from 0, so the preceding command launches gdisk
|
| 50 | on the first disk. The second way to specify a disk device is via a
|
| 51 | harder-to-remember name:
|
| 52 |
|
| 53 | gdisk \\.\physicaldrive0
|
| 54 |
|
| 55 | This command is equivalent to the earlier one -- it edits the partition
|
| 56 | table on the first physical disk. Change the number at the end of the
|
| 57 | device name to change the disk edited.
|
| 58 |
|
| 59 | If you pass the "-l" option in addition to the disk identifier, the program
|
| 60 | displays the current partition table information and then exits. This use
|
| 61 | entails no risk to MBR disks, since the program never writes data back to
|
| 62 | the disk when used in this way.
|
| 63 |
|
| 64 | As noted above, editing the first disk with GPT fdisk is usually a Bad
|
| 65 | Idea. An exception would be if your system uses an Extensible Firmware
|
| 66 | Interface (EFI) and already boots from a GPT disk. It's safer to edit
|
| 67 | non-boot disks, which usually have numbers of 1 and above, but only if you
|
| 68 | run a version of Windows with GPT support. For more information on Windows'
|
| 69 | support of GPT, see Microsoft's Web page on the topic:
|
| 70 |
|
| 71 | http://www.microsoft.com/whdc/device/storage/GPT_FAQ.mspx
|
| 72 |
|
srs5694 | 6699b01 | 2010-02-04 00:55:30 -0500 | [diff] [blame^] | 73 | The GUIDs generated by the program to uniquely identify disks and
|
| 74 | partitions aren't "proper" GUIDs; they're purely random numbers. In
|
| 75 | practice, this has caused me no problems; however, it's conceivable that
|
| 76 | some disk utility will complain. The Unix versions of GPT fdisk generate
|
| 77 | proper GUIDs, as of version 0.6.3. Note that this limitation applies ONLY
|
| 78 | to the unique GUIDs for disks and partitions, not to the GUIDs used to
|
| 79 | identify partition type codes; those are standardized and are handled
|
| 80 | correctly by all versions of GPT fdisk.
|
| 81 |
|
srs5694 | 91544e1 | 2010-01-28 21:10:36 -0500 | [diff] [blame] | 82 | Source Code and Compilation Issues
|
| 83 | ----------------------------------
|
| 84 |
|
| 85 | As of version 0.6.2, I haven't been able to get the code to detect the disk
|
| 86 | sector size to work under Windows, so the Windows binary always assumes a
|
| 87 | 512-byte sector size. If you use a disk with another sector size, you'll
|
| 88 | have to change this assumption in the source code (in diskio-windows.cc),
|
| 89 | use a version for another platform, or use a different partitioning tool
|
| 90 | altogether.
|
| 91 |
|
| 92 | I compiled gdisk.exe using MinGW (http://www.mingw.org), and in particular
|
| 93 | its Linux-hosted cross-compiler. I have not tested the compilability of the
|
| 94 | source code under more mainstream Windows compilers, or even on the
|
| 95 | Windows-hosted MinGW variant. MinGW was designed for porting Unix
|
| 96 | applications to Windows, so it's entirely possible that it will work where
|
| 97 | other compilers won't.
|
| 98 |
|
| 99 | Under Ubuntu Linux, the Makefile.mingw file enables compilation of the
|
| 100 | software. (Type "make -f Makefile.mingw" to compile the software.) If you
|
| 101 | try to compile using another compiler or even using MinGW under Windows or
|
| 102 | another Linux variety, you may need to adjust the Makefile.mingw options.
|
| 103 |
|
| 104 | If you modify GPT fdisk to get it to compile under another compiler, I
|
| 105 | welcome submission of patches.
|