mlabel
Create or change an MS-DOS filesystem label
TLDR
Set a filesystem label
SYNOPSIS
mlabel [-v] [-n new_label] drive:
PARAMETERS
-v
Verbose mode. Increases verbosity.
-n new_label
Specifies the new label to assign to the filesystem. If not provided, the command will prompt you to enter a label.
drive:
Specifies the drive containing the MS-DOS filesystem to label. Typically 'a:' for the first floppy drive, 'b:' for the second, or a partition like 'c:'. This is the target drive that will be labeled.
DESCRIPTION
The mlabel command is used to create or modify the volume label of an MS-DOS filesystem. It allows you to assign a descriptive name to a floppy disk, hard drive partition, or other media formatted with a FAT filesystem. The command interacts directly with the filesystem's boot sector to update the volume label information. It is part of the `mtools` package, which provides utilities for accessing MS-DOS filesystems from Linux.
The assigned label can be up to 11 characters long and provides a means of identifying the disk when it is mounted or accessed. Without any option, the command shows the actual label. The command allows to set, modify or delete the label. The changes made through mlabel are persistent and will be reflected whenever the filesystem is accessed from any operating system that supports FAT filesystems.
CAVEATS
The drive specified must be accessible and contain a valid MS-DOS filesystem. Ensure that you have the correct permissions to modify the volume label. Incorrect usage can lead to filesystem corruption, although this is unlikely with just the label modification. mtools relies on a configuration file (usually /etc/mtools.conf) to determine drive mappings.
The label must not exceed 11 characters and must be valid for the MS-DOS filesystem.
CONFIGURATION
The behavior of `mlabel` can be influenced by the `/etc/mtools.conf` file, which defines the mappings between drive letters and device files. This allows you to specify the physical device associated with each drive letter used by `mlabel`.
EXAMPLES
To set label 'MY_DISK' to the floppy drive A, use: mlabel a: -n MY_DISK.
To view the existing label on drive C, use: mlabel c: (without the -n option).
HISTORY
The `mlabel` command, along with the rest of the `mtools` suite, was developed to facilitate interaction with MS-DOS formatted media from non-DOS environments. It became increasingly relevant with the adoption of Linux as a replacement for DOS in many scenarios where data needed to be exchanged on older media like floppies. The `mtools` suite aims to provide a way to easily manage DOS disk structures without the need of using a DOS installation. The command's original purpose has evolved with the introduction of removable media such as USB drives where the FAT filesystem is still used.