1FIXPARTS(8)                     FixParts Manual                    FIXPARTS(8)
2
3
4

NAME

6       fixparts - MBR partition table repair utility
7

SYNOPSIS

9       fixparts device
10
11

DESCRIPTION

13       FixParts  (aka fixparts) is a text-mode menu-driven program for repair‐
14       ing certain types of problems with Master Boot Record  (MBR)  partition
15       tables.  The  program has three design goals, although a few additional
16       features are supported, as well:
17
18
19       *      It can remove stray GUID Partition Table (GPT) data,  which  can
20              be  left  behind  on a disk that was once used as a GPT disk but
21              then incompletely converted to the more common (as of 2011)  MBR
22              form.
23
24
25       *      It can repair mis-sized extended partitions -- either partitions
26              that extend beyond the physical end of the disk or that  overlap
27              with  nearby  primary partitions. FixParts is designed in such a
28              way that this type of repair occurs automatically,  so  if  it's
29              the  only problem with your disk, you can launch the program and
30              then immediately save the  partition  table,  making  no  manual
31              changes, and the program will fix the problem.
32
33
34       *      You  can  change  primary  partitions into logical partitions or
35              vice-versa, within constraints imposed by the  MBR  data  struc‐
36              tures.
37
38
39       Additional  features include the ability to change partition type codes
40       or boot/active flags, to delete partitions, and to recompute  CHS  val‐
41       ues.  With the possible exception of recomputing CHS values, these sec‐
42       ondary features are better  performed  with  fdisk,  because  fixparts'
43       design  means  that  it's likely to alter partition numbering even when
44       such changes are not requested.
45
46       The fixparts program employs  a  user  interface  similar  to  that  of
47       Linux's fdisk, but fixparts is much more specialized. Most importantly,
48       you can't create new partitions with fixparts, although you can  change
49       primary/logical assignment.
50
51       In the MBR scheme, partitions come in three varieties:
52
53
54       primary
55              These  partitions  are  defined  in the first sector of the hard
56              disk and are limited in number to four. Some OSes, such as  Win‐
57              dows and FreeBSD, must boot from a primary partition.
58
59
60       extended
61              Extended  partitions  are  specialized  primary partitions. They
62              serve as holding areas for logical partitions.
63
64
65       logical
66              A disk can contain an arbitrary  number  of  logical  partitions
67              (fixparts,  however, imposes a limit of 124 logical partitions).
68              All the logical partitions reside inside a single extended  par‐
69              tition, and are defined using a linked-list data structure. This
70              fact means that every logical partition must be preceded  by  at
71              least  one sector of unallocated space to hold its defining data
72              structure (an Extended Boot Record, or EBR).
73
74
75       These distinctions mean that primary and logical partitions  cannot  be
76       arbitrarily  interspersed. A disk can contain one to three primary par‐
77       titions, a block of one or more logical partitions, and  one  to  three
78       more  primary  partitions (for a total of three primary partitions, not
79       counting the extended partition). Primary partitions may not  be  sand‐
80       wiched between logical partitions, since this would mean placing a pri‐
81       mary partition within an extended partition (which is just  a  specific
82       type of primary partition).
83
84       Unlike  most  disk utilities, fixparts' user interface ignores extended
85       partitions. Internally, the program discards  the  information  on  the
86       original  extended partition and, when you tell it to save its changes,
87       it generates a new extended partition to contain the then-defined logi‐
88       cal  partitions. This is done because most of the repairs and manipula‐
89       tions the tool performs require generating a fresh extended  partition,
90       so keeping the original in the user interface would only be a complica‐
91       tion.
92
93       Another unusual feature of fixparts' user interface is  that  partition
94       numbers  do  not  necessarily correlate with primary/logical status. In
95       most  utilities,  partitions  1-4  correspond  to  primary  partitions,
96       whereas  partitions  5  and up are logical partitions. In fixparts, any
97       partition number may be assigned primary or logical status, so long  as
98       the  rules  for layout described earlier are obeyed. When the partition
99       table is saved, partitions will  be  assigned  appropriately  and  then
100       tools  such  as  the Linux kernel and fdisk will give them conventional
101       numbers.
102
103       When it first starts, fixparts performs a scan for  GPT  data.  If  the
104       disk  looks  like  a conventional GPT disk, fixparts refuses to run. If
105       the disk appears to be a conventional MBR disk but GPT  signatures  are
106       present  in  the GPT primary or secondary header areas, fixparts offers
107       to delete this extraneous data. If you tell it to do  so,  the  program
108       immediately  wipes  the  GPT header or headers. (If only one header was
109       found, only that one header will be erased, to  minimize  the  risk  of
110       damaging  a  boot loader or other data that might have overwritten just
111       one of the GPT headers.)
112
113       With the exception of optionally erasing  leftover  GPT  data  when  it
114       first  starts,  fixparts  keeps  all  changes  in memory until the user
115       writes changes with the w command. Thus, you can adjust your partitions
116       in the user interface and abort those changes by typing q to quit with‐
117       out saving changes.
118
119

OPTIONS

121       The fixparts utility supports no command-line options, except for spec‐
122       ification of the target device.
123
124       Most  interactions  with  fixparts occur with its interactive text-mode
125       menu. Specific functions are:
126
127
128       a      Toggle the active/boot flag. This flag is required by some  boot
129              loaders and OSes.
130
131
132
133       c      Recompute  the  cylinder/head/sector (CHS) values for all parti‐
134              tions. CHS addressing mode is largely obsolete,  but  some  OSes
135              and  utilities  complain if they don't like the CHS values. Note
136              that fixparts' CHS values are likely to be  incorrect  on  disks
137              smaller than about 8 GiB except on Linux.
138
139
140       l      Change  a  partition's  status to logical. This option will only
141              work if the current partition layout  supports  such  a  change.
142              Note  that  if  changing a partition's status in this way is not
143              currently possible, making some other change may make it  possi‐
144              ble. For instance, omitting a partition that precedes the target
145              partition may enable converting a partition to logical  form  if
146              there had been no free sectors between the two partitions.
147
148
149       o      Omit  a partition. Once omitted, the partition will still appear
150              in the fixparts partition list, but it will be flagged as  omit‐
151              ted.  You can subsequently convert it to primary or logical form
152              with the r or l  commands,  respectively.  When  you  save  your
153              changes with w, though, the partition will be lost.
154
155
156       p      Display  basic partition summary data. This includes partition's
157              number, the boot/active flag's status, starting and ending  sec‐
158              tor  numbers, primary/logical/omitted status, whether or not the
159              partition may be converted to logical form, and the  partition's
160              MBR types code.
161
162
163       q      Quit  from  the  program  without saving your changes.  Use this
164              option if you just wanted to view information or if you  make  a
165              mistake and want to back out of all your changes.
166
167
168       r      Change  a  partition's  status to primary. This option will only
169              work if the current partition layout  supports  such  a  change.
170              Note  that  every  partition  can theoretically become a primary
171              partition, although in some configurations, making  this  change
172              will  require  omitting some partitions.  If fixparts refuses to
173              allow changing a partition to primary, you may need  to  convert
174              other partitions to logical form or omit them entirely.
175
176
177       s      Sort  partition  entries.  This  option orders partitions in the
178              display to match their on-disk positions, which can make  under‐
179              standing  the  disk layout easier in some cases. This option has
180              no effect on the ultimate ordering of logical partitions,  which
181              are  sorted  before being saved. The order of primary partitions
182              in the final saved partition  table  may  be  affected  by  this
183              option.  In  both cases, as already noted, the partition numbers
184              displayed by fixparts may not be the same as those used  by  the
185              kernel or displayed by other partitioning tools.
186
187
188       t      Change  a partition's type code. You enter the type code using a
189              one-byte hexadecimal number.
190
191
192       w      Write data. Use this command to save your changes and exit  from
193              the program.
194
195
196       ?      Print  the  menu.  Type  this command (or any other unrecognized
197              command) to see a summary of available options.
198
199

BUGS

201       Known bugs and limitations include:
202
203
204       *      The program compiles correctly only on Linux, FreeBSD, Mac OS X,
205              and  Windows.  Linux versions for x86-64 (64-bit), x86 (32-bit),
206              and PowerPC (32-bit) have been tested, with the  x86-64  version
207              having  seen  the  most testing. Under FreeBSD, 32-bit (x86) and
208              64-bit (x86-64) versions have been tested. Only 32-bit  versions
209              for Mac OS X and Windows have been tested.
210
211
212       *      The  FreeBSD  version  of the program can't write changes to the
213              partition table to a disk when existing partitions on that  disk
214              are  mounted.  (The  same problem exists with many other FreeBSD
215              utilities, such as gpt, fdisk, and dd.) This limitation  can  be
216              overcome  by  typing  sysctl  kern.geom.debugflags=16 at a shell
217              prompt.
218
219
220       *      The program can load only up to 128 partitions (4 primary parti‐
221              tions  and  124 logical partitions). This limit can be raised by
222              changing the #define MAX_MBR_PARTS line in the basicmbr.h source
223              code file and recompiling.
224
225
226       *      The program can read partitions only if the disk has correct LBA
227              partition descriptors. These descriptors should  be  present  on
228              any disk over 8 GiB in size or on smaller disks partitioned with
229              any but very ancient software.
230
231
232       *      The program makes no effort to preserve partition numbers.  This
233              can have consequences for boot loaders and for mounting filesys‐
234              tems via /etc/fstab. It may be necessary to  edit  configuration
235              files or even to re-install your boot loader.
236
237
238       *
239
240              The  program may change the order of partitions in the partition
241              table.
242
243

AUTHORS

245       Primary author: Roderick W. Smith (rodsmith@rodsbooks.com)
246
247       Contributors:
248
249       * Yves Blusseau (1otnwmz02@sneakemail.com)
250
251       * David Hubbard (david.c.hubbard@gmail.com)
252
253       * Justin Maggard (justin.maggard@netgear.com)
254
255       * Dwight Schauer (dschauer@gmail.com)
256
257       * Florian Zumbiehl (florz@florz.de)
258
259
260

SEE ALSO

262       cfdisk(8),  cgdisk(8),   fdisk(8),   mkfs(8),   parted(8),   sfdisk(8),
263       gdisk(8), sgdisk(8).
264
265       http://en.wikipedia.org/wiki/Master_boot_record
266
267       http://www.rodsbooks.com/fixparts/
268
269

AVAILABILITY

271       The  fixparts command is part of the GPT fdisk package and is available
272       from Rod Smith.
273
274
275
276Roderick W. Smith                    1.0.7                         FIXPARTS(8)
Impressum