The <spec> parameter: 可以指定UUID,设备路径,文件路径 -L <label> synonym for LABEL=<label> -U <uuid> synonym for UUID=<uuid> LABEL=<label> specifies device by swap area label UUID=<uuid> specifies device by swap area UUID PARTLABEL=<label> specifies device by partition label PARTUUID=<uuid> specifies device by partition UUID <device> name of device to be used <file> name of file to be used
注意
无
示例
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
# 默认为查看swap分区 $ swapon NAME TYPE SIZE USED PRIO /dev/dm-1 partition 2G 0B -2 $ swapon -s Filename Type Size Used Priority /dev/dm-1 partition 2097148 0 -2 # -a开启/etc/fstab中所有的swap分区配置 $ swapon -a $ swapon NAME TYPE SIZE USED PRIO /dev/dm-1 partition 2G 0B -2 /swapfile file 1000M 0B -3 $ more /proc/swaps Filename Type Size Used Priority /dev/dm-1 partition 2097148 0 -2 /swapfile file 1023996 0 -3