加密的 /tmp 在启动时不会挂载

加密的 /tmp 在启动时不会挂载

操作系统:Ubuntu 16.04.3,64 位。cryptsetup 版本 1.6.6

/etc/crypttab 的内容(替换了 UUID 以节省空间):

cryptswap1 UUID=XXXX /dev/urandom swap,offset=1024,cipher=aes-xts-plain64
crypttmp1 UUID=YYYY /dev/urandom precheck=/bin/true,tmp=ext3,cipher=aes-xts-plain64

在 /etc/fstab 中

/dev/mapper/crypttmp1 /tmp ext3 defaults,noatime 0 2

在启动过程中,加密交换已初始化、挂载和使用,没有任何问题。但是,/tmp 没有,dmesg(和 /var/log/syslog )中出现以下内容:

Sep 19 11:15:51 computer systemd[1]: Starting Cryptography Setup for crypttmp1...
Sep 19 11:15:51 computer systemd[1]: Starting Cryptography Setup for cryptswap1...
Sep 19 11:15:51 computer systemd-cryptsetup[817]: Encountered unknown /etc/crypttab option 'precheck=/bin/true', ignoring.
Sep 19 11:15:51 computer systemd-cryptsetup[817]: Encountered unknown /etc/crypttab option 'tmp=ext3', ignoring.
Sep 19 11:15:51 computer systemd-cryptsetup[818]: Set cipher aes, mode xts-plain64, key size 256 bits for device /dev/disk/by-uuid/XXXX.
Sep 19 11:15:51 computer systemd-cryptsetup[817]: crypt_load() failed on device /dev/disk/by-uuid/YYYY.
Sep 19 11:15:51 computer systemd-cryptsetup[817]: Failed to activate: Invalid argument
Sep 19 11:15:51 computer systemd[1]: [email protected]: Main process exited, code=exited, status=1/FAILURE

更多细节:

  • 删除“tmp=ext3”或使用显式 ext4 没有帮助
  • 删除 'precheck=/bin/true' 没有帮助
  • 如果我从 /etc/fstab 中删除或注释掉相应的行,并在启动操作系统并登录后使用命令

    sudo cryptdisks_start crypttmp1
    sudo mount -t ext3 /dev/mapper/crypttmp1 /tmp

然后加密的 /tmp 被创建并正常挂载。

我希望能够得到有关导致上述分区在启动过程中无法正常挂载的提示。

相关内容