← 返回命令列表

Linux command

mlabel 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Set a volume label

mlabel -i [/dev/sda] ::"[new_label]"

Show current volume label

mlabel -s -i [/dev/sda] ::

Clear

mlabel -c -i [/dev/sda] ::

Example

mlabel -n -i [/dev/sda] ::

Example

mlabel -N [12345678] -i [/dev/sda] ::

说明

mlabel adds, displays, or removes volume labels on MS-DOS FAT and VFAT filesystems. When invoked without options, it displays the current label and prompts for a new one. Volume labels are limited to 11 single-byte characters. The tool validates and adjusts labels to ensure MS-DOS compatibility. An empty label input (pressing return at prompt) deletes the existing label. mlabel is part of the mtools package, which provides utilities for accessing MS-DOS filesystems from Unix/Linux without mounting.

参数

-c
Clear existing label without prompting
-s
Show existing label without prompting
-n
Assign new random serial number to disk
-N _serial_
Set specific serial number; 8-digit hexadecimal, no spaces
-v
Verbose mode; display new label if changed
-i _device_
Specify device directly instead of using drive letter

FAQ

What is the mlabel command used for?

mlabel adds, displays, or removes volume labels on MS-DOS FAT and VFAT filesystems. When invoked without options, it displays the current label and prompts for a new one. Volume labels are limited to 11 single-byte characters. The tool validates and adjusts labels to ensure MS-DOS compatibility. An empty label input (pressing return at prompt) deletes the existing label. mlabel is part of the mtools package, which provides utilities for accessing MS-DOS filesystems from Unix/Linux without mounting.

How do I run a basic mlabel example?

Run `mlabel -i [/dev/sda] ::"[new_label]"` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -c do in mlabel?

Clear existing label without prompting