Linux command
dosfslabel 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Display the label
dosfslabel [/dev/sdXN]
Set a new label
dosfslabel [/dev/sdXN] "[NEW_LABEL]"
Remove the filesystem label
dosfslabel -r [/dev/sdXN]
Display the volume ID
dosfslabel -i [/dev/sdXN]
Set a new volume ID
dosfslabel -i [/dev/sdXN] [12345678]
Use a specific codepage
dosfslabel -c [437] [/dev/sdXN] "[LABEL]"
说明
dosfslabel displays or changes the volume label or volume ID on MS-DOS FAT filesystems (FAT12, FAT16, FAT32). It is a compatibility symlink to fatlabel from the dosfstools package. If NEW is omitted, the current label or volume ID is printed to standard output. Labels cannot exceed 11 characters and should be uppercase for best compatibility. An empty string or whitespace-only label is not allowed. Volume IDs are specified as hexadecimal numbers (without 0x prefix) fitting in 32 bits. For historical reasons, FAT labels are stored in two locations: the boot sector and as a special entry in the root directory. Modern Windows systems read labels from the root directory. Since version 4.2, dosfslabel reads from root directory but writes to both locations.
参数
- -i, --volume-id
- Switch to volume ID mode instead of label mode.
- -r, --reset
- Remove label in label mode, or generate a new random ID in volume ID mode.
- -c _PAGE_, --codepage=_PAGE_
- Use DOS codepage PAGE to encode/decode label (default: 850).
- -h, --help
- Display help message and exit.
- -V, --version
- Show version number and exit.
FAQ
What is the dosfslabel command used for?
dosfslabel displays or changes the volume label or volume ID on MS-DOS FAT filesystems (FAT12, FAT16, FAT32). It is a compatibility symlink to fatlabel from the dosfstools package. If NEW is omitted, the current label or volume ID is printed to standard output. Labels cannot exceed 11 characters and should be uppercase for best compatibility. An empty string or whitespace-only label is not allowed. Volume IDs are specified as hexadecimal numbers (without 0x prefix) fitting in 32 bits. For historical reasons, FAT labels are stored in two locations: the boot sector and as a special entry in the root directory. Modern Windows systems read labels from the root directory. Since version 4.2, dosfslabel reads from root directory but writes to both locations.
How do I run a basic dosfslabel example?
Run `dosfslabel [/dev/sdXN]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -i, --volume-id do in dosfslabel?
Switch to volume ID mode instead of label mode.