https://wiki.archlinux.org/title/dm-crypt/Device_encryption # assume sdb as your removable media cryptsetup luksFormat /dev/sdb1 cryptsetup luksDump /dev/sdb1 cryptsetup open /dev/sdb1 root mount /dev/mapper/root /mnt/ mkfs.ext4 /dev/mapper/root mount /dev/mapper/root /mnt/ cp secret.txt /mnt/ sync umount /mnt/ cryptsetup close root udisksctl power-off -b /dev/sdb