blob: ce7ffb57df37d79377ed14a18b1d6255b3c09d1e [file] [log] [blame]
srs5694e7b4ff92009-08-18 13:16:10 -04001GPT fdisk (aka gdisk)
2by Roderick W. Smith, rodsmith@rodsbooks.com
3
4Introduction
5------------
6
7This software is intended as a (somewhat) fdisk-workalike program for
8GPT-partitioned disks. Although libparted and programs that use it (GNU
9Parted, gparted, etc.) provide the ability to handle GPT disks, they have
10certain limitations that gdisk overcomes. Specific advantages of gdisk
11include:
12
13* The ability to convert MBR-partitioned disks in-place to GPT format,
14 without losing data
15
srs5694221e0872009-08-29 15:00:31 -040016* The ability to convert BSD disklabels in-place to create GPT
17 partitions, without losing data
18
srs5694e7b4ff92009-08-18 13:16:10 -040019* The ability to specify sector-exact partition sizes
20
21* More flexible specification of filesystem type code GUIDs, which
22 GNU Parted tends to corrupt (particularly for FAT partitions)
23
24* Clear identification of the number of unallocated sectors on a
25 disk
26
27* A user interface that's familiar to long-time users of Linux
28 fdisk
29
30* The MBR boot loader code is left alone (GNU Parted tends to
31 wipe it out with every change)
32
srs5694221e0872009-08-29 15:00:31 -040033* The ability to create a hybrid MBR, which permits GPT-unaware
34 OSes to access up to three GPT partitions on the disk
35
srs5694e7b4ff92009-08-18 13:16:10 -040036Of course, gdisk isn't without its limitations. Most notably, it lacks the
37filesystem awareness and filesystem-related features of GNU Parted. You
38can't resize a partition's filesystem or create a partition with a
39filesystem already in place with gdisk, for instance. There's no GUI
40version of gdisk.
41
42Installing
43----------
44
45To compile gdisk, you must have appropriate development tools installed,
46most notably the GNU Compiler Collection (GCC) and its g++ compiler for
srs5694ba00fed2010-01-12 18:18:36 -050047C++. The sgdisk program also requires the popt library and its development
48files (headers). Most Linux distributions install popt by default, but you
49may need to install a package called popt-dev, popt-devel, or something
50similar to obtain the development libraries. Mac OS users can find a version
51of popt for Mac OS from http://popt.darwinports.com; however, you'll first
52need to install DarwinPorts (instructions exist on the preceding page).
53Alternatively, you can compile gdisk alone, without sgdisk; gdisk doesn't
54require popt.
55
56When all the necessary development tools and libraries are installed, you
57can uncompress the package and type "make" at the command prompt in the
58resulting directory. The result should be program files called gdisk and
59sgdisk. Typing "make gdisk" or "make sgdisk" will compile only the requested
60programs. You can use these programs in place or copy the files to a
61suitable directory, such as /usr/local/sbin. You can copy the man pages
62(gdisk.8 and sgdisk.8) to /usr/local/man/man8 to make them available.
srs5694e7b4ff92009-08-18 13:16:10 -040063
64Caveats
65-------
66
srs56945d58fe02010-01-03 20:57:08 -050067THIS SOFTWARE IS BETA SOFTWARE! IF IT WIPES OUT YOUR HARD DISK OR EATS YOUR
68CAT, DON'T BLAME ME! To date, I've tested the software on several USB flash
69drives, a handful of PATA and SATA hard disks, and several virtual disks in
70a QEMU environment. I believe all data-corruption bugs to be squashed, but
71I know full well that the odds of my missing something are high. This is
72particularly true for large drives; my only direct testing with such disks
73is with virtual QEMU disks. I've received user reports of success with
74RAID arrays over 2TiB in size, though.
srs5694e7b4ff92009-08-18 13:16:10 -040075
76My main development platform is a system running the 64-bit version of
srs56942a9f5da2009-08-26 00:48:01 -040077Ubuntu 8.04. I've also tested on 64-bit OpenSuSE, 32-bit Fedora 10, 32-bit
srs56945d58fe02010-01-03 20:57:08 -050078Fedora 11, 32-bit Ubuntu 6.10, 64-bit Ubunut 9.10, 64-bit Gentoo, 32-bit
79PowerPC Debian Linux, 32-bit Intel-based Mac OS X 10.5 and 10.6, and 64-bit
80FreeBSD 7.1. Problems relating to 64-bit integers on the 32-bit Linux have
81been common during development and may crop up in the future. The Mac OS X,
82FreeBSD, and big-endian (PowerPC) support are new.
srs5694e7b4ff92009-08-18 13:16:10 -040083
84Redistribution
85--------------
86
87This program is licensed under terms of the GNU GPL (see the file COPYING).
88
89Acknowledgements
90----------------
91
92This code is mostly my own; however, I've used three functions from two
93other GPLed programs:
94
95- The code used to generate CRCs is taken from the efone program by
96 Krzysztof Dabrowski and ElysiuM deeZine. (See the crc32.h and
97 crc32.cc source code files.)
98
99- A function to find the disk size is taken from Linux fdisk by
100 A. V. Le Blanc.
101
102Additional code contributors include:
103
104- Yves Blusseau (1otnwmz02@sneakemail.com)
105
srs56947f244ba2009-08-18 14:22:12 -0400106- David Hubbard (david.c.hubbard@gmail.com)