mpartition(1)
πΎ mpartition β partition an MSDOS hard disk π
okay so bestie, welcome to mpartition(1), living in the General Commands Manual section of your friendly neighbourhood man pages. let's get into it β¨
π¨ Note of warning (read this first, fr) π¨
This manpage has been automatically generated from mtools's texinfo documentation, and it may not be entirely accurate or complete. π See the end of this man page for details. (yes, really, there's a whole section about it, we'll get there π«Ά)
πΈ Description πΈ
The mpartition command is used to create MS-DOS file systems as partitions. It's intended to be used on non-Linux systems, i.e. systems where fdisk and easy access to SCSI devices are not available. π
no cap: this command only works on drives whose partition variable is set. if it's not set, it's giving nothing. π
Here's the whole vibe, verbatim:
mpartition -p drive
mpartition -r drive
mpartition -I [-B bootSector] drive
mpartition -a drive
mpartition -d drive
mpartition -c [-s sectors] [-h heads]
[-t cylinders] [-v [-T type] [-b
begin] [-l length] [-f]
Mpartition supports the following operations π
pβ Prints a command line to recreate the partition for the drive. Nothing is printed if the partition for the drive is not defined, or an inconsistency has been detected. And if verbose (-v) is also set, it prints the current partition table. two-for-one slay β¨rβ Removes the partition described by drive. bye bestie πIβ Initializes the partition table, and removes all partitions. it's giving factory reset πcβ Creates the partition described by drive. main character energy πaβ "Activates" the partition, i.e. makes it bootable. Only one partition can be bootable at a time. there can only be one πdβ "Deactivates" the partition, i.e. makes it unbootable.
If no operation is given, the current settings are printed. (so it's never not yapping, we love that π)
π οΈ For partition creations, the following options are available π οΈ
ssectors β The number of sectors per track of the partition (which is also the number of sectors per track for the whole drive). πhheads β The number of heads of the partition (which is also the number of heads for the whole drive). By default, the geometry information (number of sectors and heads) is figured out from neighboring partition table entries, or guessed from the size. she's a guesser, she contains multitudes π§tcylinders β The number of cylinders of the partition (not the number of cylinders of the whole drive. πbbegin β The starting offset of the partition, expressed in sectors. If begin is not given,mpartitionlets the partition begin at the start of the disk (partition number 1), or immediately after the end of the previous partition.llength β The size (length) of the partition, expressed in sectors. If end is not given,mpartitionfigures out the size from the number of sectors, heads and cylinders. If these are not given either, it gives the partition the biggest possible size, considering disk size and start of the next partition. go big or go home β¨
π‘οΈ The following option is available for all operation which modify the partition table π‘οΈ
fβ Usually, before writing back any changes to the partition,mpartitionperforms certain consistency checks, such as checking for overlaps and proper alignment of the partitions. If any of these checks fails, the partition table is not changed. The-fallows you to override these safeguards.
β οΈ bestie the -f is literally the "ignore the safety rails" flag. the checks exist for a reason. know what you're doing before you send it. π
π The following options are available for all operations π
vβ Together with-pprints the partition table as it is now (no change operation), or as it is after it is modified. β¨vvβ If the verbosity flag is given twice,mpartitionwill print out a hexdump of the partition table when reading it from and writing it to the device. it's giving hacker mode π»π₯
π± The following option is available for partition table initialization π±
BbootSector β Reads the template master boot record from file bootSector. π
π Choice of partition type π
Mpartition proceeds as follows to pick a type for the partition:
- FAT32 partitions are assigned type
0x0C(``Win95 FAT32, LBA'') - For all others, if the partition fits entirely within the first 65536 sectors of the disk, assign
0x01(DOS FAT12, CHS'') for FAT12 partition and `0x04` (DOS FAT16, CHS'') for FAT16 partitions - If not covered by the above, assign
0x06(``DOS BIG FAT16 CHS'') if partition fits entirely within the first 1024 cylinders (CHS mode) - All remaining cases get
0x0E(``Win95 BIG FAT16, LBA'')
If number of fat bits is not known (not specified in drive's definition), then FAT12 is assumed for all drives with less than 4096 sectors, and FAT16 for those with more than 4096 sectors.
This corresponds more or less to the definitions outlined at https://en.wikipedia.org/wiki/Partition_type#List_of_partition_IDs and https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-2000-server/cc977219(v=technet.10), with two notable differences π
- If fat bits are unknown, the reference documents consider drives with less than 32680 sectors to be FAT12. Mtools uses 4096 sectors as the cutoff point, as older versions of DOS only support FAT12 on disks with less than 4096 sectors (and these older versions are the ones which would be most likely to use FAT12 in the first place). history lesson bestie π
- The reference documents use a 8GB (wikipedia) or a 4GB (Microsoft) cutoff between
0x06(DOS BIG FAT16 CHS) and0x0E. Mtools uses 1024 cylinders. This is because any partition beyond 1024 cylinders must be LBA and cannot be CHS. 8GB works out to be the biggest capacity which can be represented as CHS (63 sectors, 255 heads and 1024 cylinders). 4GB is the capacity limit for windows 2000, so it makes sense that a documentation for windows 2000 would specify this as the upper limit for any partition type. π§ β¨
π See Also π
Mtools' texinfo doc. that's the whole list, go look at it π«Ά
π Viewing the texi doc π
This manpage has been automatically generated from mtools's texinfo documentation. However, this process is only approximative, and some items, such as crossreferences, footnotes and indices are lost in this translation process. Indeed, these items have no appropriate representation in the manpage format. Moreover, not all information has been translated into the manpage version. Thus I strongly advise you to use the original texinfo doc. See the end of this manpage for instructions how to view the texinfo doc. π
- To generate a printable copy from the texinfo doc, run the following commands:
./configure; make dvi; dvips mtools.dvi
- To generate a html copy, run:
./configure; make html
A premade html can be found at http://www.gnu.org/software/mtools/manual/mtools.html
- To generate an info copy (browsable using emacs' info mode), run:
./configure; make info
The texinfo doc looks most pretty when printed or as html. Indeed, in the info version certain examples are difficult to read due to the quoting conventions used in info. π
and that's the whole page, bestie!! this gem came to you from mtools-4.0.49, dated 14Jun25, and it lives in section 1 of the manual. mwah π go partition something responsibly π¦πβ¨
π¦ where this page comes from
- alpine 3.23: mtools-doc 4.0.49-r0 Β· GPL-3.0-or-later
- alpine 3.24: mtools-doc 4.0.49-r0 Β· GPL-3.0-or-later
- fedora 43: mtools 4.0.49-2.fc43 Β· GPL-3.0-or-later
- fedora 44: mtools 4.0.49-3.fc44 Β· GPL-3.0-or-later
- nixos 26.05: mtools 4.0.49
- nixpkgs unstable: mtools 4.0.49
- ubuntu resolute: mtools 4.0.49-1 Β· GPL-3.0-only
- ubuntu stonking: mtools 4.0.49-1 Β· GPL-3.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms