Home » Linux Command Reference » UNIX/LINUX Command – mformat

UNIX/LINUX Command – mformat

Last updated May 11, 2021


mformat—Add an MS-DOS filesystem to a low-level formatted disk


mformat [ -t tracks ] [ -h heads ] [ -s sectors ] [ -l volume label ] [ -S sizecode ] [ -2 sectors on track 0 ] [ -M software sector size ] [ -a ][-X ][-C ][-H hidden sectors ] drive:


mformat adds a minimal MS-DOS filesystem (boot sector, FAT, and root directory) to a disk that has already been formatted by a UNIX low-level format.

The follow options are supported: (The S, 2, 1, and M options may not exist if this copy of mtools has been compiled without the USE_2M option).

Options Description
t The number of tracks (not cylinders).
h The number of heads (sides).
s The number of sectors per track. If the 2m option is given, number of 512-byte sector equivalents on generic tracks (that is, not head 0 track). If the 2m option is not given, number of physical sectors per track (which may be bigger than 512 bytes).
l An optional volume label.
S The sizecode. The size of the sector is 2 ˆ (sizecode + 7).
2 2m format. The parameter to this option describes the number of sectors on track 0, head 0. This option is recommended for sectors bigger than normal.
1 Don’t use a 2m format, even if the current geometry of the disk is a 2m geometry.
M Software sector size. This parameter describes the sector size in bytes used by the MS-DOS filesystem. By default it is the physical sector size.
a If this option is given, an Atari-style serial number is generated. Ataris store their serial number in the OEM label.
X Formats the disk as an Xdf disk. Xdf disks are used by OS/2. This format can hold 1756Kb, and is faster than the equivalent 2m formats. The disk has first to be low-level formatted using the xdfcopy utility included in the fdutils package.
C Creates the disk image file to install the MS-DOS filesystem on it. Obviously, this is useless on physical devices such as floppies and hard disk partitions.
H Number of hidden sectors. This parameter is useful for formatting hard disk partitions, which are not aligned on track boundaries (in other words, first head of first track doesn’t belong to the partition, but contains a partition table). In that case the number of hidden sectors is in general the number of sectors per cylinder. This is untested.
n Serial number.

To format a disk at a density other than the default, you must supply (at least) those command-line parameters that are different from the default.
Mformat returns 0 on success or 1 on failure.

Related Posts

UNIX/LINUX Command – rsync

UNIX/LINUX Command – rsync

NAME rsync – a fast, versatile, remote (and local) file-copying tool rsync Command SYNOPSIS Local: rsync [OPTION…] SRC… [DEST] Access via remote shell:Pull: rsync [OPTION…] [USER@]HOST:SRC… [DEST]Push: rsync [OPTION…] SRC… [USER@]HOST:DEST Access via rsync...

UNIX/LINUX Command – strip

UNIX/LINUX Command – strip

NAME strip—Discard symbols from object files. SYNOPSIS strip [ -Fbfdname|–target=bfdname ] [ -Ibfdname|–input-target=bfdname ] [ -Obfdname|–output-target=bfdname ] [-Rsectionname|–remove-section=sectionname ] [ -s|–strip-all ] [-S|-g|–strip-debug ][-x|–discard-all...

UNIX/LINUX Command – expand

UNIX/LINUX Command – expand

NAME expand—Convert tabs to spaces SYNOPSIS expand [–tab1[,tab2[,…]]] [–t tab1[,tab2[,…]]] [–i] [—tabs=tab1[,tab2[,…]]] [–initial] [–help] [–version] [file…] DESCRIPTION This manual page documents the GNU version of expand. expand writes the contents of each given...

UNIX/LINUX Command – uuencode

UNIX/LINUX Command – uuencode

NAME uuencode—Encode a binary fileuudecode—Decode a file created by uuencode SYNOPSIS uuencode [-m] [ file ] nameuudecode [-o outfile] [ file ]… DESCRIPTION uuencode and uudecode are used to transmit binary files over transmission mediums that do not support other...

Follow Us

Our Communities

The Ultimate Managed Hosting Platform
Load WordPress Sites in as fast as 37ms!



Submit a Comment

Your email address will not be published. Required fields are marked *

15 + 11 =