resetting manifest requested domain to floor
[platform/upstream/gptfdisk.git] / fixparts.html
1 Content-type: text/html
2
3 <HTML><HEAD><TITLE>Manpage of FIXPARTS</TITLE>
4 </HEAD><BODY>
5 <H1>FIXPARTS</H1>
6 Section: FixParts Manual (8)<BR>Updated: 0.8.5<BR><A HREF="#index">Index</A>
7 <A HREF="http://localhost/cgi-bin/man/man2html">Return to Main Contents</A><HR>
8
9 <A NAME="lbAB">&nbsp;</A>
10 <H2>NAME</H2>
11
12 fixparts - MBR partition table repair utility
13 <A NAME="lbAC">&nbsp;</A>
14 <H2>SYNOPSIS</H2>
15
16 <B>fixparts </B>
17
18 <I>device</I>
19
20 <P>
21 <A NAME="lbAD">&nbsp;</A>
22 <H2>DESCRIPTION</H2>
23
24 <P>
25 FixParts (aka <B>fixparts</B>) is a text-mode menu-driven program for
26 repairing certain types of problems with Master Boot Record (MBR) partition
27 tables. The program has three design goals, although a few additional
28 features are supported, as well:
29 <P>
30 <DL COMPACT>
31 <DT><B>*</B>
32
33 <DD>
34 It can remove stray GUID Partition Table (GPT) data, which can be left
35 behind on a disk that was once used as a GPT disk but then incompletely
36 converted to the more common (as of 2011) MBR form.
37 <P>
38 <DT><B>*</B>
39
40 <DD>
41 It can repair mis-sized extended partitions -- either partitions that
42 extend beyond the physical end of the disk or that overlap with nearby
43 primary partitions. FixParts is designed in such a way that this type of
44 repair occurs automatically, so if it's the only problem with your disk,
45 you can launch the program and then immediately save the partition table,
46 making no manual changes, and the program will fix the problem.
47 <P>
48 <DT><B>*</B>
49
50 <DD>
51 You can change primary partitions into logical partitions or vice-versa,
52 within constraints imposed by the MBR data structures.
53 <P>
54 </DL>
55 <P>
56
57 <P>
58 Additional features include the ability to change partition type codes or
59 boot/active flags, to delete partitions, and to recompute CHS values. With
60 the possible exception of recomputing CHS values, these secondary features
61 are better performed with <B>fdisk</B>, because <B>fixpart</B>'s design means
62 that it's likely to alter partition numbering even when such changes are
63 not requested.
64 <P>
65 The <B>fixpart</B> program employs a user interface similar to that of
66 Linux's <B>fdisk</B>, but <B>fixpart</B> is much more specialized. Most
67 importantly, you can't create new partitions with <B>fixpart</B>, although
68 you can change primary/logical assignment.
69 <P>
70 In the MBR scheme, partitions come in three varieties:
71 <P>
72 <DL COMPACT>
73 <DT><B>primary</B>
74
75 <DD>
76 These partitions are defined in the first sector of the hard disk and
77 are limited in number to four. Some OSes, such as Windows and FreeBSD, must
78 boot from a primary partition.
79 <P>
80 <DT><B>extended</B>
81
82 <DD>
83 Extended partitions are specialized primary partitions. They serve as
84 holding areas for logical partitions.
85 <P>
86 <DT><B>logical</B>
87
88 <DD>
89 A disk can contain an arbitrary number of logical partitions
90 (<B>fixpart</B>, however, imposes a limit of 124 logical partitions). All
91 the logical partitions reside inside a single extended partition, and are
92 defined using a linked-list data structure. This fact means that every
93 logical partition be preceded by at least one sector of unallocated space
94 to hold its defining data structure (an Extended Boot Record, or EBR).
95 <P>
96 </DL>
97 <P>
98
99 <P>
100 These distinctions mean that primary and logical partitions cannot be
101 arbitrarily interspersed. A disk can contain one to three primary
102 partitions, a block of one or more logical partitions, and one to three
103 more primary partitions (for a total of three primary partitions, not
104 counting the extended partition). Primary partitions may not be sandwiched
105 between logical partitions, since this would mean placing a primary
106 partition within an extended partition (which is just a specific type of
107 primary partition).
108 <P>
109 Unlike most disk utilities, <B>fixpart</B>'s user interface ignores extended
110 partitions. Internally, the program discards the information on the
111 original extended partition and, when you tell it to save its changes, it
112 generates a new extended partition to contain the then-defined logical
113 partitions. This is done because most of the repairs and manipulations the
114 tool performs require generating a fresh extended partition, so keeping the
115 original in the user interface would only be a complication.
116 <P>
117 Another unusual feature of <B>fixpart</B>'s user interface is that partition
118 numbers do not necessarily correlate with primary/logical status. In most
119 utilities, partitions 1-4 correspond to primary partitions, whereas
120 partitions 5 and up are logical partitions. In <B>fixpart</B>, any partition
121 number may be assigned primary or logical status, so long as the rules for
122 layout described earlier are obeyed. When the partition table is saved,
123 partitions will be assigned appropriately and then tools such as the Linux
124 kernel and <B>fdisk</B> will give them conventional numbers.
125 <P>
126 When it first starts, <B>fixpart</B> performs a scan for GPT data. If the
127 disk looks like a conventional GPT disk, <B>fixpart</B> refuses to run. If
128 the disk appears to be a conventional MBR disk but GPT signatures are
129 present in the GPT primary or secondary header areas, <B>fixpart</B>
130 offers to delete this extraneous data. If you tell it to do so, the program
131 immediately wipes the GPT header or headers. (If only one header was found,
132 only that one header will be erased, to minimize the risk of damaging a
133 boot loader or other data that might have overwritten just one of the GPT
134 headers.)
135 <P>
136 With the exception of optionally erasing leftover GPT data when it first
137 starts, <B>fixpart</B> keeps all changes in memory until the user writes
138 changes with the <B>w</B> command. Thus, you can adjust your partitions in
139 the user interface and abort those changes by typing <B>q</B> to quit
140 without saving changes.
141 <P>
142 <A NAME="lbAE">&nbsp;</A>
143 <H2>OPTIONS</H2>
144
145 <P>
146 The <B>fixparts</B> utility supports no command-line options, except for
147 specification of the target device.
148 <P>
149 Most interactions with <B>fixparts</B> occur with its interactive text-mode
150 menu. Specific functions are:
151 <P>
152 <DL COMPACT>
153 <DT><B>a</B>
154
155 <DD>
156 Toggle the active/boot flag. This flag is required by some boot loaders and
157 OSes.
158 <P>
159 <P>
160 <DT><B>c</B>
161
162 <DD>
163 Recompute the cylinder/head/sector (CHS) values for all partitions. CHS
164 addressing mode is largely obsolete, but some OSes and utilities complain
165 if they don't like the CHS values. Note that <B>fixparts</B>' CHS values are
166 likely to be incorrect on disks smaller than about 8 GiB except on Linux.
167 <P>
168 <DT><B>l</B>
169
170 <DD>
171 Change a partition's status to logical. This option will only work if the
172 current partition layout supports such a change. Note that if changing a
173 partition's status in this way is not currently possible, making some other
174 change may make it possible. For instance, omitting a partition that
175 precedes the target partition may enable converting a partition to logical
176 form if there had been no free sectors between the two partitions.
177 <P>
178 <DT><B>o</B>
179
180 <DD>
181 Omit a partition. Once omitted, the partition will still appear in the
182 <B>fixpart</B> partition list, but it will be flagged as omitted. You can
183 subsequently convert it to primary or logical form with the <B>r</B> or
184 <B>l</B> commands, respectively. When you save your changes with <B>w</B>,
185 though, the partition will be lost.
186 <P>
187 <DT><B>p</B>
188
189 <DD>
190 Display basic partition summary data. This includes partition's number, the
191 boot/active flag's status, starting and ending sector numbers,
192 primary/logical/omitted status, whether or not the partition may be
193 converted to logical form, and the partition's MBR types code.
194 <P>
195 <DT><B>q</B>
196
197 <DD>
198 Quit from the program <I>without saving your changes</I>.
199 Use this option if you just wanted to view information or if you make a
200 mistake and want to back out of all your changes.
201 <P>
202 <DT><B>r</B>
203
204 <DD>
205 Change a partition's status to primary. This option will only work if the
206 current partition layout supports such a change. Note that every partition
207 can theoretically become a primary partition, although in some
208 configurations, making this change will require omitting some partitions.
209 If <B>fixparts</B> refuses to allow changing a partition to primary, you may
210 need to convert other partitions to logical form or omit them entirely.
211 <P>
212 <DT><B>s</B>
213
214 <DD>
215 Sort partition entries. This option orders partitions in the display to
216 match their on-disk positions, which can make understanding the disk layout
217 easier in some cases. This option has no effect on the ultimate ordering of
218 logical partitions, which are sorted before being saved. The order of
219 primary partitions in the final saved partition table may be affected by
220 this option. In both cases, as already noted, the partition numbers
221 displayed by <B>fixparts</B> may not be the same as those used by the kernel
222 or displayed by other partitioning tools.
223 <P>
224 <DT><B>t</B>
225
226 <DD>
227 Change a partition's type code. You enter the type code using a one-byte
228 hexadecimal number.
229 <P>
230 <DT><B>w</B>
231
232 <DD>
233 Write data. Use this command to save your changes and exit from the program.
234 <P>
235 <DT><B>?</B>
236
237 <DD>
238 Print the menu. Type this command (or any other unrecognized command) to
239 see a summary of available options.
240 <P>
241 </DL>
242 <P>
243
244 <P>
245 <A NAME="lbAF">&nbsp;</A>
246 <H2>BUGS</H2>
247
248 As of May 2012 (version 0.8.5), <B>fixparts</B>
249 should be considered beta software. Known bugs and limitations include:
250 <P>
251 <DL COMPACT>
252 <DT><B>*</B>
253
254 <DD>
255 The program compiles correctly only on Linux, FreeBSD, Mac OS X, and Windows.
256 Linux versions for x86-64 (64-bit), x86 (32-bit), and PowerPC (32-bit) have been
257 tested, with the x86-64 version having seen the most testing. Under FreeBSD,
258 32-bit (x86) and 64-bit (x86-64) versions have been tested. Only 32-bit
259 versions for Mac OS X and Windows have been tested.
260 <P>
261 <DT><B>*</B>
262
263 <DD>
264 The FreeBSD version of the program can't write changes to the partition
265 table to a disk when existing partitions on that disk are mounted. (The
266 same problem exists with many other FreeBSD utilities, such as
267 <B>gpt</B>, <B>fdisk</B>, and <B>dd</B>.) This limitation can be overcome
268 by typing <B>sysctl kern.geom.debugflags=16</B> at a shell prompt.
269 <P>
270 <DT><B>*</B>
271
272 <DD>
273 The program can load only up to 128 partitions (4 primary partitions and
274 124 logical partitions). This limit can be raised by changing the
275 <I>#define MAX_MBR_PARTS</I> line in the <I>basicmbr.h</I> source code file
276 and recompiling.
277 <P>
278 <DT><B>*</B>
279
280 <DD>
281 The program can read partitions only if the disk has correct LBA partition
282 descriptors. These descriptors should be present on any disk over 8 GiB in
283 size or on smaller disks partitioned with any but very ancient software.
284 <P>
285 <DT><B>*</B>
286
287 <DD>
288 The program makes no effort to preserve partition numbers. This can have
289 consequences for boot loaders and for mounting filesystems via
290 <B>/etc/fstab</B>. It may be necessary to edit configuration files or even
291 to re-install your boot loader.
292 <P>
293 <DT><B>*</B>
294
295 <DD>
296 <P>
297 The program may change the order of partitions in the partition table.
298 <P>
299 </DL>
300 <P>
301
302 <P>
303 <A NAME="lbAG">&nbsp;</A>
304 <H2>AUTHORS</H2>
305
306 Primary author: Roderick W. Smith (<A HREF="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</A>)
307 <P>
308 Contributors:
309 <P>
310 * Yves Blusseau (<A HREF="mailto:1otnwmz02@sneakemail.com">1otnwmz02@sneakemail.com</A>)
311 <P>
312 * David Hubbard (<A HREF="mailto:david.c.hubbard@gmail.com">david.c.hubbard@gmail.com</A>)
313 <P>
314 * Justin Maggard (<A HREF="mailto:justin.maggard@netgear.com">justin.maggard@netgear.com</A>)
315 <P>
316 * Dwight Schauer (<A HREF="mailto:dschauer@ti.com">dschauer@ti.com</A>)
317 <P>
318 * Florian Zumbiehl (<A HREF="mailto:florz@florz.de">florz@florz.de</A>)
319 <P>
320 <P>
321 <A NAME="lbAH">&nbsp;</A>
322 <H2>SEE ALSO</H2>
323
324 <B>cfdisk (8)</B>,
325 <B>cgdisk (8)</B>,
326 <B>fdisk (8)</B>,
327 <B>mkfs (8)</B>,
328 <B>parted (8)</B>,
329 <B>sfdisk (8)</B>
330 <B>gdisk (8)</B>
331 <B>sgdisk (8)</B>
332 <P>
333 <I><A HREF="http://en.wikipedia.org/wiki/Master_boot_record">http://en.wikipedia.org/wiki/Master_boot_record</A></I>
334 <P>
335 <I><A HREF="http://www.rodsbooks.com/fixparts/">http://www.rodsbooks.com/fixparts/</A></I>
336 <P>
337 <A NAME="lbAI">&nbsp;</A>
338 <H2>AVAILABILITY</H2>
339
340 The <B>fixparts</B> command is part of the <I>GPT fdisk</I> package and is
341 available from Rod Smith.
342 <P>
343
344 <HR>
345 <A NAME="index">&nbsp;</A><H2>Index</H2>
346 <DL>
347 <DT><A HREF="#lbAB">NAME</A><DD>
348 <DT><A HREF="#lbAC">SYNOPSIS</A><DD>
349 <DT><A HREF="#lbAD">DESCRIPTION</A><DD>
350 <DT><A HREF="#lbAE">OPTIONS</A><DD>
351 <DT><A HREF="#lbAF">BUGS</A><DD>
352 <DT><A HREF="#lbAG">AUTHORS</A><DD>
353 <DT><A HREF="#lbAH">SEE ALSO</A><DD>
354 <DT><A HREF="#lbAI">AVAILABILITY</A><DD>
355 </DL>
356 <HR>
357 This document was created by
358 <A HREF="http://localhost/cgi-bin/man/man2html">man2html</A>,
359 using the manual pages.<BR>
360 Time: 15:38:43 GMT, May 30, 2012
361 </BODY>
362 </HTML>