Linux command
swaplabel 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Display
swaplabel [path/to/device]
Set
swaplabel -L [new_label] [path/to/device]
Set
swaplabel -U [new_uuid] [path/to/device]
说明
swaplabel prints or changes the label or UUID of a Linux swap area. The device can be a partition or a regular file configured as swap space. Labels and UUIDs are useful for identifying swap areas in /etc/fstab instead of using device paths, which may change between boots. Using UUIDs is particularly recommended for reliable identification.
参数
- -L, --label _label_
- Set the swap area label
- -U, --uuid _uuid_
- Set the swap area UUID (use uuidgen to create)
- -h, --help
- Display help information
- -V, --version
- Display version information
FAQ
What is the swaplabel command used for?
swaplabel prints or changes the label or UUID of a Linux swap area. The device can be a partition or a regular file configured as swap space. Labels and UUIDs are useful for identifying swap areas in /etc/fstab instead of using device paths, which may change between boots. Using UUIDs is particularly recommended for reliable identification.
How do I run a basic swaplabel example?
Run `swaplabel [path/to/device]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -L, --label _label_ do in swaplabel?
Set the swap area label