Now our solution -> provided for *systemd* computers:
*/etc/fstab*
# LABEL=COMMON-SWAP none swap sw 0 0
uncomment swap-volume only!
*/etc/crypttab*
# <target name> <source device> <key file> <options> cryptswap1 LABEL=COMMON-SWAP /dev/urandom swap,cipher=aes-cbc-essiv:sha256,offset=8,noauto
Required are *offset=8* - otherwise the given basis (swap-volume) will be destroid! For testing purpose only the *LABEL* definition has been used.
*/etc/rc.local* (extension modul)
/sbin/cryptdisks_start cryptswap1 /bin/sleep 5 /sbin/swapon /dev/mapper/cryptswap1
Comments: -> */bin/sleep 5* -> t.b.d. - depends on volume / GiB to be crypted.
*/etc/rc.local* -> will be started from */lib/systemd/system/rc.local.service* and provides:
root@USB-GNOME:~# blkid | grep COMMON-SWAP /dev/sdb1: LABEL="COMMON-SWAP" UUID="c939105e-bae2-437e-9d0c-affac8e959ea" TYPE="swap" PARTUUID="2f299a37-e690-447e-91a3-917d2c0161c9" root@USB-GNOME:~# swapon -s Filename Type Size Used Priority /dev/dm-0 partition 8519672 0 -1
Now our solution -> provided for *systemd* computers:
*/etc/fstab*
# LABEL=COMMON-SWAP none swap sw 0 0
uncomment swap-volume only!
*/etc/crypttab*
# <target name> <source device> <key file> <options> aes-cbc- essiv:sha256, offset= 8,noauto
cryptswap1 LABEL=COMMON-SWAP /dev/urandom swap,cipher=
Required are *offset=8* - otherwise the given basis (swap-volume) will be destroid! For testing purpose only the *LABEL* definition has been used.
*/etc/rc.local* (extension modul)
/sbin/cryptdisk s_start cryptswap1 cryptswap1
/bin/sleep 5
/sbin/swapon /dev/mapper/
Comments: -> */bin/sleep 5* -> t.b.d. - depends on volume / GiB to be crypted.
*/etc/rc.local* -> will be started from */lib/systemd/ system/ rc.local. service* and provides:
root@USB-GNOME:~# blkid | grep COMMON-SWAP bae2-437e- 9d0c-affac8e959 ea" TYPE="swap" "2f299a37- e690-447e- 91a3-917d2c0161 c9"
/dev/sdb1: LABEL="COMMON-SWAP" UUID="c939105e-
PARTUUID=
root@USB-GNOME:~# swapon -s
Filename Type Size Used Priority
/dev/dm-0 partition 8519672 0 -1