Alistair Delva | beaee83 | 2021-02-24 11:27:23 -0800 | [diff] [blame] | 1 | '\" t |
Yi Kong | 39bbd96 | 2022-01-09 19:41:38 +0800 | [diff] [blame] | 2 | .TH mpartition 1 "08Jan22" mtools-4.0.37 |
Alistair Delva | beaee83 | 2021-02-24 11:27:23 -0800 | [diff] [blame] | 3 | .SH Name |
| 4 | mpartition - 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 |
| 17 | This manpage has been automatically generated from mtools's texinfo |
| 18 | documentation, and may not be entirely accurate or complete. See the |
| 19 | end of this man page for details. |
| 20 | .PP |
| 21 | .SH Description |
| 22 | .PP |
| 23 | The \fR\&\f(CWmpartition\fR command is used to create MS-DOS file systems as |
| 24 | partitions. This is intended to be used on non-Linux systems, |
| 25 | i.e. systems where fdisk and easy access to SCSI devices are not |
| 26 | available. This command only works on drives whose partition variable |
| 27 | is 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 |
| 44 | Mpartition supports the following operations: |
| 45 | .TP |
| 46 | \&\fR\&\f(CWp\fR\ |
| 47 | Prints a command line to recreate the partition for the drive. Nothing |
| 48 | is printed if the partition for the drive is not defined, or an |
| 49 | inconsistency has been detected. If verbose (\fR\&\f(CW-v\fR) is also set, |
| 50 | prints the current partition table. |
| 51 | .TP |
| 52 | \&\fR\&\f(CWr\fR\ |
| 53 | Removes the partition described by \fIdrive\fR. |
| 54 | .TP |
| 55 | \&\fR\&\f(CWI\fR\ |
| 56 | Initializes the partition table, and removes all partitions. |
| 57 | .TP |
| 58 | \&\fR\&\f(CWc\fR\ |
| 59 | Creates 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 |
| 63 | can be bootable at a time. |
| 64 | .TP |
| 65 | \&\fR\&\f(CWd\fR\ |
| 66 | "Deactivates" the partition, i.e. makes it unbootable. |
| 67 | .PP |
| 68 | If no operation is given, the current settings are printed. |
| 69 | .PP |
| 70 | For partition creations, the following options are available: |
| 71 | .TP |
| 72 | \&\fR\&\f(CWs\ \fIsectors\fR\&\f(CW\fR\ |
| 73 | The number of sectors per track of the partition (which is also the |
| 74 | number of sectors per track for the whole drive). |
| 75 | .TP |
| 76 | \&\fR\&\f(CWh\ \fIheads\fR\&\f(CW\fR\ |
| 77 | The number of heads of the partition (which is also the number of heads |
| 78 | for the whole drive). By default, the geometry information (number of |
| 79 | sectors and heads) is figured out from neighboring partition table |
| 80 | entries, or guessed from the size. |
| 81 | .TP |
| 82 | \&\fR\&\f(CWt\ \fIcylinders\fR\&\f(CW\fR\ |
| 83 | The number of cylinders of the partition (not the number of cylinders of |
| 84 | the whole drive. |
| 85 | .TP |
| 86 | \&\fR\&\f(CWb\ \fIbegin\fR\&\f(CW\fR\ |
| 87 | The starting offset of the partition, expressed in sectors. If begin |
| 88 | is not given, \fR\&\f(CWmpartition\fR lets the partition begin at the start |
| 89 | of the disk (partition number 1), or immediately after the end of the |
| 90 | previous partition. |
| 91 | .TP |
| 92 | \&\fR\&\f(CWl\ \fIlength\fR\&\f(CW\fR\ |
| 93 | The size (length) of the partition, expressed in sectors. If end is |
| 94 | not given, \fR\&\f(CWmpartition\fR figures out the size from the number of |
| 95 | sectors, heads and cylinders. If these are not given either, it gives |
| 96 | the partition the biggest possible size, considering disk size and |
| 97 | start of the next partition. |
| 98 | .PP |
| 99 | The following option is available for all operation which modify the |
| 100 | partition table: |
| 101 | .TP |
| 102 | \&\fR\&\f(CWf\fR\ |
| 103 | Usually, before writing back any changes to the partition, mpartition |
| 104 | performs certain consistency checks, such as checking for overlaps and |
| 105 | proper alignment of the partitions. If any of these checks fails, the |
| 106 | partition table is not changed. The \fR\&\f(CW-f\fR allows you to override |
| 107 | these safeguards. |
| 108 | .PP |
| 109 | The following options are available for all operations: |
| 110 | .TP |
| 111 | \&\fR\&\f(CWv\fR\ |
| 112 | Together with \fR\&\f(CW-p\fR prints the partition table as it is now (no |
| 113 | change operation), or as it is after it is modified. |
| 114 | .TP |
| 115 | \&\fR\&\f(CWvv\fR\ |
| 116 | If the verbosity flag is given twice, \fR\&\f(CWmpartition\fR will print out |
| 117 | a hexdump of the partition table when reading it from and writing it |
| 118 | to the device. |
| 119 | .PP |
| 120 | The following option is available for partition table initialization: |
| 121 | .TP |
| 122 | \&\fR\&\f(CWB\ \fIbootSector\fR\&\f(CW\fR\ |
| 123 | Reads the template master boot record from file \fIbootSector\fR. |
| 124 | .PP |
| 125 | .SH Choice\ of\ partition\ type |
| 126 | .PP |
| 127 | Mpartition proceeds as follows to pick a type for the partition: |
| 128 | .TP |
| 129 | -\ \ |
| 130 | FAT32 partitions are assigned type 0x0C (``\fR\&\f(CWWin95 FAT32, LBA\fR'') |
| 131 | .TP |
| 132 | -\ \ |
| 133 | For all others, if the partition fits entirely within the first 65536 |
| 134 | sectors of the disk, assign 0x01 (``\fR\&\f(CWDOS FAT12, CHS\fR'') for FAT12 |
| 135 | partition and 0x04 (``\fR\&\f(CWDOS FAT16, CHS\fR'') for FAT16 partitions |
| 136 | .TP |
| 137 | -\ \ |
| 138 | If 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 | -\ \ |
| 141 | All remaining cases get 0x0E (``\fR\&\f(CWWin95 BIG FAT16, LBA\fR'') |
| 142 | .PP |
| 143 | If number of fat bits is not known (not specified in drive's |
| 144 | definition), then FAT12 is assumed for all drives with less than 4096 |
| 145 | sectors, and FAT16 for those with more than 4096 sectors. |
| 146 | .PP |
| 147 | This corresponds more or less to the definitions outlined at \fR\&\f(CWhttps://en.wikipedia.org/wiki/Partition_type#List_of_partition_IDs\fR |
| 148 | and |
| 149 | \&\fR\&\f(CWhttps://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-2000-server/cc977219(v=technet.10)\fR, |
| 150 | with two notable differences: |
| 151 | .TP |
| 152 | -\ \ |
| 153 | If fat bits are unknown, the reference documents consider drives with |
| 154 | less than 32680 sectors to be FAT12. Mtools uses 4096 sectors as the |
| 155 | cutoff point, as older versions of DOS only support FAT12 on disks |
| 156 | with less than 4096 sectors (and these older versions are the ones |
| 157 | which would be most likely to use FAT12 in the first place). |
| 158 | .TP |
| 159 | -\ \ |
| 160 | The reference documents use a 8GB (wikipedia) or a 4GB (Microsoft) |
| 161 | cutoff between 0x06 (\fR\&\f(CWDOS BIG FAT16 CHS\fR) and 0x0E. Mtools uses |
| 162 | 1024 cylinders. This is because any partition beyond 1024 cylinders |
| 163 | must be LBA and cannot be CHS. 8GB works out to be the biggest |
| 164 | capacity which can be represented as CHS (63 sectors, 255 heads and |
| 165 | 1024 cylinders). 4GB is the capacity limit for windows 2000, so it |
| 166 | makes sense that a documentation for windows 2000 would specify this |
| 167 | as the upper limit for any partition type. |
| 168 | .PP |
| 169 | .SH See\ Also |
| 170 | Mtools' texinfo doc |
| 171 | .SH Viewing\ the\ texi\ doc |
| 172 | This manpage has been automatically generated from mtools's texinfo |
| 173 | documentation. However, this process is only approximative, and some |
| 174 | items, such as crossreferences, footnotes and indices are lost in this |
| 175 | translation process. Indeed, these items have no appropriate |
| 176 | representation in the manpage format. Moreover, not all information has |
| 177 | been translated into the manpage version. Thus I strongly advise you to |
| 178 | use the original texinfo doc. See the end of this manpage for |
| 179 | instructions how to view the texinfo doc. |
| 180 | .TP |
| 181 | * \ \ |
| 182 | To generate a printable copy from the texinfo doc, run the following |
| 183 | commands: |
| 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 | * \ \ |
| 197 | To 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 | * \ \ |
| 212 | To 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 |
| 225 | The texinfo doc looks most pretty when printed or as html. Indeed, in |
| 226 | the info version certain examples are difficult to read due to the |
| 227 | quoting conventions used in info. |
| 228 | .PP |