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.
swapoff /dev/vgdata/lvswapIncorrect. swapoff disables an active swap area.
mkswap /dev/vgdata/lvswapIncorrect. mkswap creates metadata but does not activate it.
mount /dev/vgdata/lvswap /swapIncorrect. 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 / ヘルプ表示のみ
- Prefer help or version output and a disposable device when testing storage commands.
- Formatting, repair, and mount changes can affect data or availability.
Foundation review
Place the operation
mkswap creates the format; swapon and swapoff control runtime use.
Check the side effect
Check active pages and available alternate swap before disabling an area.