我总是必须在启动后手动激活交换文件。怎么了?这是我的/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>
# / was on /dev/nvme0n1p3 during installation
UUID=65238893-d167-43fd-9c3d-489759c09f06 / btrfs defaults,subvol=@ 0 1
# /boot was on /dev/nvme0n1p2 during installation
UUID=4e5c83d5-a781-4af7-a205-f137974d998e /boot ext4 defaults 0 2
# /boot/efi was on /dev/nvme0n1p1 during installation
UUID=68C0-029E /boot/efi vfat umask=0077 0 1
# /home was on /dev/nvme0n1p3 during installation
UUID=65238893-d167-43fd-9c3d-489759c09f06 /home btrfs defaults,subvol=@home 0 2
UUID=65238893-d167-43fd-9c3d-489759c09f06 /swap btrfs defaults,noatime,subvol=swap 0 0
/swap/swapfile none swap sw 0 0
这是输出sudo btrfs sub list /; ls /swap
:
ID 256 gen 59227 top level 5 path home
ID 318 gen 62429 top level 5 path @
ID 319 gen 62429 top level 5 path @home
ID 330 gen 62180 top level 318 path swap
swapfile
我认为问题在于您
swap
的子卷和挂载到的目录具有相同的名称。我没有测试它,但
mount
可能会引发错误然后下一行也没有使用。
您
swapfile
不是在单独的子卷上创建的,而是在@
.