The above works, both encrypted swap and /tmp are mounted at boot time. Also:
# # cryptsetup status ctmp
/dev/mapper/ctmp is active and is in use.
type: PLAIN
cipher: aes-cbc-essiv:sha256
keysize: 256 bits
device: /dev/vdb6
offset: 0 sectors
size: 258048 sectors
mode: read/write
Encrypted swap is mounted at boot time, /tmp doesn't. Also:
# grep ctmp /var/log/syslog
Oct 15 09:00:23 ubuntu-1604-home systemd[1]: Starting Cryptography Setup for ctmp...
Oct 15 09:00:23 ubuntu-1604-home systemd[1]: <email address hidden>: Main process exited, code=exited, status=1/FAILURE
Oct 15 09:00:23 ubuntu-1604-home systemd[1]: Failed to start Cryptography Setup for ctmp.
Oct 15 09:00:23 ubuntu-1604-home systemd[1]: Dependency failed for dev-mapper-ctmp.device.
Oct 15 09:00:23 ubuntu-1604-home systemd[1]: Dependency failed for File System Check on /dev/mapper/ctmp.
Oct 15 09:00:23 ubuntu-1604-home systemd[1]: <email address hidden>: Job <email address hidden>/start failed with result 'dependency'.
Oct 15 09:00:23 ubuntu-1604-home systemd[1]: dev-mapper-ctmp.device: Job dev-mapper-ctmp.device/start failed with result 'dependency'.
Oct 15 09:00:23 ubuntu-1604-home systemd[1]: <email address hidden>: Unit entered failed state.
Oct 15 09:00:23 ubuntu-1604-home systemd[1]: <email address hidden>: Failed with result 'exit-code'.
The boot process is stuck: the below question is printed on console:
"Please enter passphrase for disk ctmp on /tmp"
When Enter is entered (the above question appears twice), OS boots, encrypted swap is mounted, ctmp isn't initialized. Also:
# grep ctmp /var/log/syslog
Oct 15 09:09:43 ubuntu-1604-home systemd[1]: Starting Cryptography Setup for ctmp...
Oct 15 09:09:43 ubuntu-1604-home systemd[1]: <email address hidden>: Main process exited, code=exited, status=1/FAILURE
Oct 15 09:09:43 ubuntu-1604-home systemd[1]: Failed to start Cryptography Setup for ctmp.
Oct 15 09:09:43 ubuntu-1604-home systemd[1]: Dependency failed for dev-mapper-ctmp.device.
Oct 15 09:09:43 ubuntu-1604-home systemd[1]: Dependency failed for File System Check on /dev/mapper/ctmp.
Oct 15 09:09:43 ubuntu-1604-home systemd[1]: <email address hidden>: Job <email address hidden>/start failed with result 'dependency'.
Oct 15 09:09:43 ubuntu-1604-home systemd[1]: dev-mapper-ctmp.device: Job dev-mapper-ctmp.device/start failed with result 'dependency'.
Oct 15 09:09:43 ubuntu-1604-home systemd[1]: <email address hidden>: Unit entered failed state.
Oct 15 09:09:43 ubuntu-1604-home systemd[1]: <email address hidden>: Failed with result 'exit-code'.
Oct 15 09:09:43 ubuntu-1604-home systemd[1]: Starting Cryptography Setup for ctmp...
Oct 15 09:09:43 ubuntu-1604-home systemd[1]: <email address hidden>: Main process exited, code=exited, status=1/FAILURE
Oct 15 09:09:43 ubuntu-1604-home systemd[1]: Failed to start Cryptography Setup for ctmp.
Oct 15 09:09:43 ubuntu-1604-home systemd[1]: Dependency failed for dev-mapper-ctmp.device.
Oct 15 09:09:43 ubuntu-1604-home systemd[1]: Dependency failed for File System Check on /dev/mapper/ctmp.
Oct 15 09:09:43 ubuntu-1604-home systemd[1]: <email address hidden>: Job <email address hidden>/start failed with result 'dependency'.
Oct 15 09:09:43 ubuntu-1604-home systemd[1]: dev-mapper-ctmp.device: Job dev-mapper-ctmp.device/start failed with result 'dependency'.
Oct 15 09:09:43 ubuntu-1604-home systemd[1]: <email address hidden>: Unit entered failed state.
Oct 15 09:09:43 ubuntu-1604-home systemd[1]: <email address hidden>: Failed with result 'exit-code'.
Oct 15 09:09:43 ubuntu-1604-home systemd[1]: Starting Cryptography Setup for ctmp...
Question: are Test 2 and Test 3 setups expected to fail, according to cryptsetup manual reference?
Additional tests and results:
Test 1.
/etc/crypttab: bfcf-4d28- 917d-f9b4e2a488 30 /dev/urandom swap,offset= 1024,cipher= aes-xts- plain64
cryptswap1 UUID=ba7eaa11-
ctmp /dev/vdb6 /dev/urandom tmp
/etc/fstab: cryptswap1 none swap sw 0 0 noatime, nodiratime, nosuid, nofail 0 2
/dev/mapper/
/dev/mapper/ctmp /tmp ext4 defaults,
The above works, both encrypted swap and /tmp are mounted at boot time. Also:
# # cryptsetup status ctmp essiv:sha256
/dev/mapper/ctmp is active and is in use.
type: PLAIN
cipher: aes-cbc-
keysize: 256 bits
device: /dev/vdb6
offset: 0 sectors
size: 258048 sectors
mode: read/write
Test 2.
/etc/crypttab: bfcf-4d28- 917d-f9b4e2a488 30 /dev/urandom swap,offset= 1024,cipher= aes-xts- plain64
cryptswap1 UUID=ba7eaa11-
ctmp /dev/vdb6 /dev/urandom tmp=ext2
/etc/fstab: cryptswap1 none swap sw 0 0 noatime, nodiratime, nosuid, nofail 0 2
/dev/mapper/
/dev/mapper/ctmp /tmp ext2 defaults,
Encrypted swap is mounted at boot time, /tmp doesn't. Also:
# grep ctmp /var/log/syslog
Oct 15 09:00:23 ubuntu-1604-home systemd[1]: Starting Cryptography Setup for ctmp... ctmp.device. ctmp.device: Job dev-mapper- ctmp.device/ start failed with result 'dependency'.
Oct 15 09:00:23 ubuntu-1604-home systemd[1]: <email address hidden>: Main process exited, code=exited, status=1/FAILURE
Oct 15 09:00:23 ubuntu-1604-home systemd[1]: Failed to start Cryptography Setup for ctmp.
Oct 15 09:00:23 ubuntu-1604-home systemd[1]: Dependency failed for dev-mapper-
Oct 15 09:00:23 ubuntu-1604-home systemd[1]: Dependency failed for File System Check on /dev/mapper/ctmp.
Oct 15 09:00:23 ubuntu-1604-home systemd[1]: <email address hidden>: Job <email address hidden>/start failed with result 'dependency'.
Oct 15 09:00:23 ubuntu-1604-home systemd[1]: dev-mapper-
Oct 15 09:00:23 ubuntu-1604-home systemd[1]: <email address hidden>: Unit entered failed state.
Oct 15 09:00:23 ubuntu-1604-home systemd[1]: <email address hidden>: Failed with result 'exit-code'.
Test 3.
/etc/crypttab: bfcf-4d28- 917d-f9b4e2a488 30 /dev/urandom swap,offset= 1024,cipher= aes-xts- plain64 aes-cbc- essiv
cryptswap1 UUID=ba7eaa11-
ctmp /dev/vdb6 /dev/urandom tmp,cipher=
/etc/fstab: cryptswap1 none swap sw 0 0 noatime, nodiratime, nosuid, nofail 0 2
/dev/mapper/
/dev/mapper/ctmp /tmp ext4 defaults,
The boot process is stuck: the below question is printed on console:
"Please enter passphrase for disk ctmp on /tmp"
When Enter is entered (the above question appears twice), OS boots, encrypted swap is mounted, ctmp isn't initialized. Also:
# grep ctmp /var/log/syslog
Oct 15 09:09:43 ubuntu-1604-home systemd[1]: Starting Cryptography Setup for ctmp... ctmp.device. ctmp.device: Job dev-mapper- ctmp.device/ start failed with result 'dependency'. ctmp.device. ctmp.device: Job dev-mapper- ctmp.device/ start failed with result 'dependency'.
Oct 15 09:09:43 ubuntu-1604-home systemd[1]: <email address hidden>: Main process exited, code=exited, status=1/FAILURE
Oct 15 09:09:43 ubuntu-1604-home systemd[1]: Failed to start Cryptography Setup for ctmp.
Oct 15 09:09:43 ubuntu-1604-home systemd[1]: Dependency failed for dev-mapper-
Oct 15 09:09:43 ubuntu-1604-home systemd[1]: Dependency failed for File System Check on /dev/mapper/ctmp.
Oct 15 09:09:43 ubuntu-1604-home systemd[1]: <email address hidden>: Job <email address hidden>/start failed with result 'dependency'.
Oct 15 09:09:43 ubuntu-1604-home systemd[1]: dev-mapper-
Oct 15 09:09:43 ubuntu-1604-home systemd[1]: <email address hidden>: Unit entered failed state.
Oct 15 09:09:43 ubuntu-1604-home systemd[1]: <email address hidden>: Failed with result 'exit-code'.
Oct 15 09:09:43 ubuntu-1604-home systemd[1]: Starting Cryptography Setup for ctmp...
Oct 15 09:09:43 ubuntu-1604-home systemd[1]: <email address hidden>: Main process exited, code=exited, status=1/FAILURE
Oct 15 09:09:43 ubuntu-1604-home systemd[1]: Failed to start Cryptography Setup for ctmp.
Oct 15 09:09:43 ubuntu-1604-home systemd[1]: Dependency failed for dev-mapper-
Oct 15 09:09:43 ubuntu-1604-home systemd[1]: Dependency failed for File System Check on /dev/mapper/ctmp.
Oct 15 09:09:43 ubuntu-1604-home systemd[1]: <email address hidden>: Job <email address hidden>/start failed with result 'dependency'.
Oct 15 09:09:43 ubuntu-1604-home systemd[1]: dev-mapper-
Oct 15 09:09:43 ubuntu-1604-home systemd[1]: <email address hidden>: Unit entered failed state.
Oct 15 09:09:43 ubuntu-1604-home systemd[1]: <email address hidden>: Failed with result 'exit-code'.
Oct 15 09:09:43 ubuntu-1604-home systemd[1]: Starting Cryptography Setup for ctmp...
Question: are Test 2 and Test 3 setups expected to fail, according to cryptsetup manual reference?