在 /etc/fstab 中:
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
/dev/mapper/ubuntu--vg-root / ext4 errors=remount-ro 0 1
# /boot was on /dev/sda1 during installation
UUID=778f64ee-2798-4207-af19-3aab682d29ec /boot ext2 defaults 0 2
/dev/mapper/ubuntu--vg-swap_1 none swap sw 0 0
blkid 输出:
B490:~$ sudo blkid
/dev/sda1: UUID="778f64ee-2798-4207-af19-3aab682d29ec" TYPE="ext2" PARTUUID="e91b4e1d-01"
/dev/sda5: UUID="I0wfRt-pO1S-uxdR-URMd-42ol-NG0F-Nz8qUI" TYPE="LVM2_member" PARTUUID="e91b4e1d-05"
/dev/mapper/ubuntu--vg-root: UUID="2bef7c39-c39d-4367-af0d-ce11f3a0da51" TYPE="ext4"
/dev/mapper/ubuntu--vg-swap_1: UUID="8d4582b9-1a67-403d-8c72-d0fd6023aa74" TYPE="swap"
我是 Ububtu 新手,不确定分区是否正确...请帮忙...
谢谢
答案1
执行斯瓦彭命令。我有一个交换文件,我得到的结果如下:
$ swapon
NAME TYPE SIZE USED PRIO
/swapfile file 10G 0B -1
对于具有交换分区的另一个系统:
$ swapon
NAME TYPE SIZE USED PRIO
/dev/sda3 partition 3.9G 0B -1
请注意,您不需要是 root 或使用 sudo
答案2
尝试:swapon /dev/mapper/ubuntu--vg-swap_1
答案3
从https://unix.stackexchange.com/questions/204413/dev-mapper-in-fdisk#204438,您有逻辑卷或可能加密的磁盘。阅读引用的链接。但是,它看起来不错。如果您不想这样,请在未分配的空间中创建一个交换分区或创建一个交换文件(用于文件交换)并使用 swapon/swapoff 更改交换位置并编辑您的 fstab 以使其永久生效。