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