我正在尝试在20.04安装后加密交换文件(我成功地进行了家庭dir加密)。我用UUID创建了一个交换文件,这些是我的
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/sda3 during installation
UUID=3b76b7a1-8e02-439b-982f-39f8954c4e6e / ext4 errors=remount-ro 0 1
# /boot/efi was on /dev/sda1 during installation
UUID=FEFC-8940 /boot/efi vfat umask=0077 0 1
UUID=684f3c6e-907a-4a35-95b4-7b6cde21440b none swap sw 0 0密码(开始前):
# <target name> <source device> <key file> <options>/dev/mapper只是控制
金发女郎:
dev/sda3: UUID="3b76b7a1-8e02-439b-982f-39f8954c4e6e" TYPE="ext4" PARTUUID="6a8896ab-92bb-4bd7-a405-7650cca8d9e6"
/dev/loop0: TYPE="squashfs"
/dev/loop1: TYPE="squashfs"
/dev/loop2: TYPE="squashfs"
/dev/loop3: TYPE="squashfs"
/dev/loop4: TYPE="squashfs"
/dev/loop5: TYPE="squashfs"
/dev/loop6: TYPE="squashfs"
/dev/loop7: TYPE="squashfs"
/dev/sda1: UUID="FEFC-8940" TYPE="vfat" PARTLABEL="EFI System Partition" PARTUUID="305bb9b1-cde6-4fa5-9702-491a4dcd71f4"
/dev/loop8: TYPE="squashfs"
/dev/loop9: TYPE="squashfs"
/swapfile: UUID="684f3c6e-907a-4a35-95b4-7b6cde21440b" TYPE="swap"运行以下命令:
sudo swapoff -a
sudo /etc/init.d/cryptdisks start
sudo swapon -a
sudo swapon -s产出:
/swapfile file 16777212 0 -2/dev/mapper仍然只是控制。现在让我们来加密: sudo,氪lets -设置-交换!
产出:
WARNING:
An encrypted swap is required to help ensure that encrypted files are not leaked to disk in an unencrypted format.
HOWEVER, THE SWAP ENCRYPTION CONFIGURATION PRODUCED BY THIS PROGRAM WILL BREAK HIBERNATE/RESUME ON THIS SYSTEM!
NOTE: Your suspend/resume capabilities will not be affected.
Do you want to proceed with encrypting your swap? [y/N]: y
INFO: Setting up swap: [/swapfile]
WARNING: Commented out your unencrypted swap from /etc/fstab
A dependency job for cryptsetup.target failed. See 'journalctl -xe' for details.-日志-xe日志--
新的密码技术是:
cryptswap1 /swapfile /dev/urandom swap,offset=1024,cipher=aes-xts-plain64而新的fstab是:
#UUID=684f3c6e-907a-4a35-95b4-7b6cde21440b none swap sw 0 0
/dev/mapper/cryptswap1 none swap sw 0 0日志中只有一个红色错误,并且它自己重复:
-- The unit UNIT has successfully entered the 'dead' state.
Mai 23 20:51:32 icbosk-X556UV systemd[1]: dev-disk-by\x2duuid-684f3c6e\x2d907a\x2d4a35\x2d95b4\x2d7b6cde21440b.device: Job dev-disk-by\x2duui>
Mai 23 20:51:32 icbosk-X556UV systemd[1]: Timed out waiting for device /dev/disk/by-uuid/684f3c6e-907a-4a35-95b4-7b6cde21440b.
-- Subject: A start job for unit dev-disk-by\x2duuid-684f3c6e\x2d907a\x2d4a35\x2d95b4\x2d7b6cde21440b.device has failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- A start job for unit dev-disk-by\x2duuid-684f3c6e\x2d907a\x2d4a35\x2d95b4\x2d7b6cde21440b.device has finished with a failure.
--
-- The job identifier is 1992 and the job result is timeout.发布于 2020-05-24 14:11:10
当一切都有序地配置时,运行sudo cryptdisks_start cryptswap1很容易解决这个问题。请记住,如果您不广泛使用加密交换,则可以。如果要将其用作常规交换,则需要更多的CPU功率。
https://askubuntu.com/questions/1242913
复制相似问题