Size of logical volume fedora_studentvm1/swap changed from8.00GiB(2048 extents) to 10.00GiB(2560 extents).
Logical volume fedora_studentvm1/swap successfully resized.
[root@studentvm1 ~]#
运行 mkswap 命令将整个 10GB 分区变成交换空间。
[root@studentvm1 ~]#mkswap/dev/mapper/fedora_studentvm1-swap
mkswap:/dev/mapper/fedora_studentvm1-swap: warning: wiping old swap signature.
Setting up swapspace version 1,size=10GiB(10737414144 bytes)
no label, UUID=3cc2bee0-e746-4b66-aa2d-1ea15ef1574a
[root@studentvm1 ~]#
重新启用交换空间。
[root@studentvm1 ~]#swapon-a
[root@studentvm1 ~]#
现在,使用 lsblk 命令验证新交换空间是否存在。同样,不需要重新启动机器。
[root@studentvm1 ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 60G 0 disk
|-sda1 8:1 0 1G 0 part /boot
`-sda2 8:2 0 59G 0 part
|-fedora_studentvm1-pool00_tmeta 253:0 0 4M 0 lvm
| `-fedora_studentvm1-pool00-tpool 253:2 0 2G 0lvm
| |-fedora_studentvm1-root 253:3 0 2G 0lvm /
| `-fedora_studentvm1-pool00 253:6 0 2G 0 lvm
|-fedora_studentvm1-pool00_tdata 253:1 0 2G 0 lvm
| `-fedora_studentvm1-pool00-tpool 253:2 0 2G 0lvm
| |-fedora_studentvm1-root 253:3 0 2G 0lvm /
| `-fedora_studentvm1-pool00 253:6 0 2G 0 lvm
|-fedora_studentvm1-swap 253:4 0 10G 0 lvm [SWAP]
|-fedora_studentvm1-usr 253:5 0 15G 0 lvm /usr
|-fedora_studentvm1-home 253:7 0 2G 0 lvm /home
|-fedora_studentvm1-var 253:8 0 10G 0 lvm /var