Start using mkswap-initialized /dev/vgdata/lvswap on the running system.
Which command is appropriate?
swapon DEVICE activates an initialized swap area. Persistent use after reboot requires a configuration such as /etc/fstab.
Detailed explanation
swapon /dev/vgdata/lvswapCorrect. swapon activates the prepared swap area.
Correct. swapon activates the prepared swap area.
swapoff /dev/vgdata/lvswapIncorrect. swapoff disables an active swap area.
Incorrect. swapoff disables an active swap area.
mkswap /dev/vgdata/lvswapIncorrect. mkswap creates metadata but does not activate it.
Incorrect. mkswap creates metadata but does not activate it.
mount /dev/vgdata/lvswap /swapIncorrect. mount is for filesystems, not swap activation.
Incorrect. mount is for filesystems, not swap activation.
Try it yourself
An example you can run in a temporary verification environment.
swapon --help | sed -n '1,14p'Expected result
swapを有効化するswaponの使用法Key points
- swapon starts use
- swapoff stops use
- Persistence uses fstab
Notes
- Environment: util-linux swapon / ヘルプ表示のみ
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Read the scope first
Check whether the command acts on the current shell, a new process, an existing process, or a file.
Verify the observable result
Use the supplied command and compare the output with the expected result.