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