srs5694 | e7b4ff9 | 2009-08-18 13:16:10 -0400 | [diff] [blame^] | 1 | GPT fdisk (aka gdisk) |
| 2 | by Roderick W. Smith, rodsmith@rodsbooks.com |
| 3 | |
| 4 | Introduction |
| 5 | ------------ |
| 6 | |
| 7 | This software is intended as a (somewhat) fdisk-workalike program for |
| 8 | GPT-partitioned disks. Although libparted and programs that use it (GNU |
| 9 | Parted, gparted, etc.) provide the ability to handle GPT disks, they have |
| 10 | certain limitations that gdisk overcomes. Specific advantages of gdisk |
| 11 | include: |
| 12 | |
| 13 | * The ability to convert MBR-partitioned disks in-place to GPT format, |
| 14 | without losing data |
| 15 | |
| 16 | * The ability to specify sector-exact partition sizes |
| 17 | |
| 18 | * More flexible specification of filesystem type code GUIDs, which |
| 19 | GNU Parted tends to corrupt (particularly for FAT partitions) |
| 20 | |
| 21 | * Clear identification of the number of unallocated sectors on a |
| 22 | disk |
| 23 | |
| 24 | * A user interface that's familiar to long-time users of Linux |
| 25 | fdisk |
| 26 | |
| 27 | * The MBR boot loader code is left alone (GNU Parted tends to |
| 28 | wipe it out with every change) |
| 29 | |
| 30 | Of course, gdisk isn't without its limitations. Most notably, it lacks the |
| 31 | filesystem awareness and filesystem-related features of GNU Parted. You |
| 32 | can't resize a partition's filesystem or create a partition with a |
| 33 | filesystem already in place with gdisk, for instance. There's no GUI |
| 34 | version of gdisk. |
| 35 | |
| 36 | Installing |
| 37 | ---------- |
| 38 | |
| 39 | To compile gdisk, you must have appropriate development tools installed, |
| 40 | most notably the GNU Compiler Collection (GCC) and its g++ compiler for |
| 41 | C++. uncompress the package and type "make" at the command prompt in the |
| 42 | resulting directory. The result should be a program file called gdisk. You |
| 43 | can use this in place or copy the file to a suitable directory, such as |
| 44 | /usr/local/sbin. You can copy the man page (gdisk.8) to /usr/local/man/man8 |
| 45 | to make it available. |
| 46 | |
| 47 | Caveats |
| 48 | ------- |
| 49 | |
| 50 | THIS SOFTWARE IS EARLY BETA SOFTWARE! IF IT WIPES OUT YOUR HARD DISK OR |
| 51 | EATS YOUR CAT, DON'T BLAME ME! To date, I've tested the software mainly on |
| 52 | two USB flash drives, 2 GiB and 8 GiB in size. I've also made a few minor |
| 53 | tweaks to a production system with a 500 GiB hard disk and made more |
| 54 | extensive changes to a handful of 80-160 GiB hard disks. I believe all |
| 55 | data-corruption bugs to be squashed, but I know full well that the odds of |
| 56 | my missing something are high. This is particularly true for large drives; |
| 57 | I have no way of testing the software with > 2TiB drives, which will test |
| 58 | the 64-bit sector pointer support. |
| 59 | |
| 60 | The MBR-to-GPT feature seems to work well for data drives, but it's largely |
| 61 | untested on boot drives. One attempt with Windows failed miserably, but I |
| 62 | believe that was because of Windows' inherent limitations with respect to |
| 63 | GPT. (The partitions themselves were intact.) |
| 64 | |
| 65 | My main development platform is a system running the 64-bit version of |
| 66 | Ubuntu. I've also tested on 64-bit OpenSuSE and 32-bit Fedora 10. Problems |
| 67 | relating to 64-bit integers on the 32-bit Linux have been common during |
| 68 | development and may crop up in the future. The Mac OS X support is new, |
| 69 | and has at least one bug/limitation: It seems to be impossible to write |
| 70 | a new partition table if any partitions from the disk are currently |
| 71 | mounted. |
| 72 | |
| 73 | Redistribution |
| 74 | -------------- |
| 75 | |
| 76 | This program is licensed under terms of the GNU GPL (see the file COPYING). |
| 77 | |
| 78 | Acknowledgements |
| 79 | ---------------- |
| 80 | |
| 81 | This code is mostly my own; however, I've used three functions from two |
| 82 | other GPLed programs: |
| 83 | |
| 84 | - The code used to generate CRCs is taken from the efone program by |
| 85 | Krzysztof Dabrowski and ElysiuM deeZine. (See the crc32.h and |
| 86 | crc32.cc source code files.) |
| 87 | |
| 88 | - A function to find the disk size is taken from Linux fdisk by |
| 89 | A. V. Le Blanc. |
| 90 | |
| 91 | Additional code contributors include: |
| 92 | |
| 93 | - Yves Blusseau (1otnwmz02@sneakemail.com) |
| 94 | |
| 95 | - One anonymous contributor |