Advertisement
Tritonio

cryptsetup cheat sheet

Oct 25th, 2021 (edited)
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. cryptsetup luksFormat --type=luks2 --integrity hmac-sha256 --sector-size 4096 /dev/sda1
  2. # For raspberry --cipher="xchacha20,aes-adiantum-plain64" --pbkdf pbkdf2
  3. # the first because it's fast without hardware AES, the second because the default would require a lot of memory to generate the key from the password. If you already created the key with the default you can convert with the following:
  4. cryptsetup luksConvertKey --pbkdf pbkdf2 /dev/sda1
  5.  
  6. cryptsetup open /dev/sda1 sda1_crypt
  7.  
  8. cryptsetup open /dev/sda1 sda1_crypt --allow-discards --persistent #alternative to make discards permanently enabled on this device at the LUKS level.
  9.  
  10. mkfs.ext4 -i 4M -O ^64bit -m 0 -L Label /dev/mapper/sda1_crypt
  11. # For flash -b 4096 -E stride=2,stripe-width=1024
  12. # -O ^has_journal to disable journal
  13.  
  14. cryptsetup close /dev/mapper/sda1_crypt
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement