meta data for this page
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
linux:fs:encrypted_swap [2025/03/23 08:41] – created niziak | linux:fs:encrypted_swap [2025/03/24 08:27] (current) – niziak | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== encrypted SWAP ====== | ====== encrypted SWAP ====== | ||
+ | <code bash> | ||
apt install cryptsetup | apt install cryptsetup | ||
- | <file / | + | </ |
- | swap / | + | |
+ | ===== auto create ===== | ||
+ | |||
+ | Auto create encrypted swap with random key for every boot. Problem is that given block device will be filled with random data when swap is created. | ||
+ | So label / UUID is lost for next reboot. Need to use direct device names or use symlinks like ''/ | ||
+ | |||
+ | Workaround: Put LABEL / UUID once on block device and leave small gap before real swap data to do not overwrite FS signature: | ||
+ | |||
+ | <code bash> | ||
+ | mkfs.ext2 -L cryptswap2 / | ||
+ | blkid / | ||
+ | dev/ | ||
+ | |||
+ | </ | ||
+ | |||
+ | Note: '' | ||
+ | |||
+ | < | ||
+ | swap2 LABEL=cryptswap2 | ||
</ | </ | ||
+ | |||
+ | Apply '' | ||
+ | <code bash> | ||
+ | systemctl daemon-reload | ||
+ | systemctl restart cryptsetup.target | ||
+ | |||
+ | </ | ||
+ | |||
+ | <file ini / | ||
+ | / | ||
+ | |||
+ | </ | ||
+ | |||
+ | NOTE: '' | ||
+ | |||
+ |