blob: a87ee772f1f05ca08aa514bd5889c776e46afe6a [file] [log] [blame]
Alistair Delvabeaee832021-02-24 11:27:23 -08001'\" t
Yi Kong39bbd962022-01-09 19:41:38 +08002.TH mpartition 1 "08Jan22" mtools-4.0.37
Alistair Delvabeaee832021-02-24 11:27:23 -08003.SH Name
4mpartition - partition an MSDOS hard disk
5'\" t
6.de TQ
7.br
8.ns
9.TP \\$1
10..
11
12.tr \(is'
13.tr \(if`
14.tr \(pd"
15
16.SH Note\ of\ warning
17This manpage has been automatically generated from mtools's texinfo
18documentation, and may not be entirely accurate or complete. See the
19end of this man page for details.
20.PP
21.SH Description
22.PP
23The \fR\&\f(CWmpartition\fR command is used to create MS-DOS file systems as
24partitions. This is intended to be used on non-Linux systems,
25i.e. systems where fdisk and easy access to SCSI devices are not
26available. This command only works on drives whose partition variable
27is set.
28.PP
29.ft I
30.nf
31\&\fR\&\f(CWmpartition\fR \fR\&\f(CW-p\fR \fIdrive\fR
32\&\fR\&\f(CWmpartition\fR \fR\&\f(CW-r\fR \fIdrive\fR
33\&\fR\&\f(CWmpartition\fR \fR\&\f(CW-I\fR [\fR\&\f(CW-B\fR \fIbootSector\fR] \fIdrive\fR
34\&\fR\&\f(CWmpartition\fR \fR\&\f(CW-a\fR \fIdrive\fR
35\&\fR\&\f(CWmpartition\fR \fR\&\f(CW-d\fR \fIdrive\fR
36\&\fR\&\f(CWmpartition\fR \fR\&\f(CW-c\fR [\fR\&\f(CW-s\fR \fIsectors\fR] [\fR\&\f(CW-h\fR \fIheads\fR]
37[\fR\&\f(CW-t\fR \fIcylinders\fR] [\fR\&\f(CW-v\fR [\fR\&\f(CW-T\fR \fItype\fR] [\fR\&\f(CW-b\fR
38\&\fIbegin\fR] [\fR\&\f(CW-l\fR length] [\fR\&\f(CW-f\fR]
39\&\&
40.fi
41.ft R
42
43.PP
44Mpartition supports the following operations:
45.TP
46\&\fR\&\f(CWp\fR\
47Prints a command line to recreate the partition for the drive. Nothing
48is printed if the partition for the drive is not defined, or an
49inconsistency has been detected. If verbose (\fR\&\f(CW-v\fR) is also set,
50prints the current partition table.
51.TP
52\&\fR\&\f(CWr\fR\
53Removes the partition described by \fIdrive\fR.
54.TP
55\&\fR\&\f(CWI\fR\
56Initializes the partition table, and removes all partitions.
57.TP
58\&\fR\&\f(CWc\fR\
59Creates the partition described by \fIdrive\fR.
60.TP
61\&\fR\&\f(CWa\fR\
62"Activates" the partition, i.e. makes it bootable. Only one partition
63can be bootable at a time.
64.TP
65\&\fR\&\f(CWd\fR\
66"Deactivates" the partition, i.e. makes it unbootable.
67.PP
68If no operation is given, the current settings are printed.
69.PP
70For partition creations, the following options are available:
71.TP
72\&\fR\&\f(CWs\ \fIsectors\fR\&\f(CW\fR\
73The number of sectors per track of the partition (which is also the
74number of sectors per track for the whole drive).
75.TP
76\&\fR\&\f(CWh\ \fIheads\fR\&\f(CW\fR\
77The number of heads of the partition (which is also the number of heads
78for the whole drive). By default, the geometry information (number of
79sectors and heads) is figured out from neighboring partition table
80entries, or guessed from the size.
81.TP
82\&\fR\&\f(CWt\ \fIcylinders\fR\&\f(CW\fR\
83The number of cylinders of the partition (not the number of cylinders of
84the whole drive.
85.TP
86\&\fR\&\f(CWb\ \fIbegin\fR\&\f(CW\fR\
87The starting offset of the partition, expressed in sectors. If begin
88is not given, \fR\&\f(CWmpartition\fR lets the partition begin at the start
89of the disk (partition number 1), or immediately after the end of the
90previous partition.
91.TP
92\&\fR\&\f(CWl\ \fIlength\fR\&\f(CW\fR\
93The size (length) of the partition, expressed in sectors. If end is
94not given, \fR\&\f(CWmpartition\fR figures out the size from the number of
95sectors, heads and cylinders. If these are not given either, it gives
96the partition the biggest possible size, considering disk size and
97start of the next partition.
98.PP
99The following option is available for all operation which modify the
100partition table:
101.TP
102\&\fR\&\f(CWf\fR\
103Usually, before writing back any changes to the partition, mpartition
104performs certain consistency checks, such as checking for overlaps and
105proper alignment of the partitions. If any of these checks fails, the
106partition table is not changed. The \fR\&\f(CW-f\fR allows you to override
107these safeguards.
108.PP
109The following options are available for all operations:
110.TP
111\&\fR\&\f(CWv\fR\
112Together with \fR\&\f(CW-p\fR prints the partition table as it is now (no
113change operation), or as it is after it is modified.
114.TP
115\&\fR\&\f(CWvv\fR\
116If the verbosity flag is given twice, \fR\&\f(CWmpartition\fR will print out
117a hexdump of the partition table when reading it from and writing it
118to the device.
119.PP
120The following option is available for partition table initialization:
121.TP
122\&\fR\&\f(CWB\ \fIbootSector\fR\&\f(CW\fR\
123Reads the template master boot record from file \fIbootSector\fR.
124.PP
125.SH Choice\ of\ partition\ type
126.PP
127Mpartition proceeds as follows to pick a type for the partition:
128.TP
129-\ \
130FAT32 partitions are assigned type 0x0C (``\fR\&\f(CWWin95 FAT32, LBA\fR'')
131.TP
132-\ \
133For all others, if the partition fits entirely within the first 65536
134sectors of the disk, assign 0x01 (``\fR\&\f(CWDOS FAT12, CHS\fR'') for FAT12
135partition and 0x04 (``\fR\&\f(CWDOS FAT16, CHS\fR'') for FAT16 partitions
136.TP
137-\ \
138If not covered by the above, assign 0x06 (``\fR\&\f(CWDOS BIG FAT16 CHS\fR'') if partition fits entirely within the first 1024 cylinders (CHS mode)
139.TP
140-\ \
141All remaining cases get 0x0E (``\fR\&\f(CWWin95 BIG FAT16, LBA\fR'')
142.PP
143If number of fat bits is not known (not specified in drive's
144definition), then FAT12 is assumed for all drives with less than 4096
145sectors, and FAT16 for those with more than 4096 sectors.
146.PP
147This corresponds more or less to the definitions outlined at \fR\&\f(CWhttps://en.wikipedia.org/wiki/Partition_type#List_of_partition_IDs\fR
148and
149\&\fR\&\f(CWhttps://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-2000-server/cc977219(v=technet.10)\fR,
150with two notable differences:
151.TP
152-\ \
153If fat bits are unknown, the reference documents consider drives with
154less than 32680 sectors to be FAT12. Mtools uses 4096 sectors as the
155cutoff point, as older versions of DOS only support FAT12 on disks
156with less than 4096 sectors (and these older versions are the ones
157which would be most likely to use FAT12 in the first place).
158.TP
159-\ \
160The reference documents use a 8GB (wikipedia) or a 4GB (Microsoft)
161cutoff between 0x06 (\fR\&\f(CWDOS BIG FAT16 CHS\fR) and 0x0E. Mtools uses
1621024 cylinders. This is because any partition beyond 1024 cylinders
163must be LBA and cannot be CHS. 8GB works out to be the biggest
164capacity which can be represented as CHS (63 sectors, 255 heads and
1651024 cylinders). 4GB is the capacity limit for windows 2000, so it
166makes sense that a documentation for windows 2000 would specify this
167as the upper limit for any partition type.
168.PP
169.SH See\ Also
170Mtools' texinfo doc
171.SH Viewing\ the\ texi\ doc
172This manpage has been automatically generated from mtools's texinfo
173documentation. However, this process is only approximative, and some
174items, such as crossreferences, footnotes and indices are lost in this
175translation process. Indeed, these items have no appropriate
176representation in the manpage format. Moreover, not all information has
177been translated into the manpage version. Thus I strongly advise you to
178use the original texinfo doc. See the end of this manpage for
179instructions how to view the texinfo doc.
180.TP
181* \ \
182To generate a printable copy from the texinfo doc, run the following
183commands:
184
185.nf
186.ft 3
187.in +0.3i
188 ./configure; make dvi; dvips mtools.dvi
189.fi
190.in -0.3i
191.ft R
192.PP
193
194\&\fR
195.TP
196* \ \
197To generate a html copy, run:
198
199.nf
200.ft 3
201.in +0.3i
202 ./configure; make html
203.fi
204.in -0.3i
205.ft R
206.PP
207
208\&\fRA premade html can be found at
209\&\fR\&\f(CW\(ifhttp://www.gnu.org/software/mtools/manual/mtools.html\(is\fR
210.TP
211* \ \
212To generate an info copy (browsable using emacs' info mode), run:
213
214.nf
215.ft 3
216.in +0.3i
217 ./configure; make info
218.fi
219.in -0.3i
220.ft R
221.PP
222
223\&\fR
224.PP
225The texinfo doc looks most pretty when printed or as html. Indeed, in
226the info version certain examples are difficult to read due to the
227quoting conventions used in info.
228.PP