The end of #Deno #JavaScript
Search
4 results for “atoponce”
-
-
#!/bin/zsh
zmodload zsh/mathfunc
dir=/dir/of/files/to/encrypt/
data=$(du -sB1 $dir | cut -f1)
size=$(( int(ceil(data * 1.05 + 16*1024*1024)) ))fallocate -l "$size" "$dir.luks"
cryptsetup luksFormat --type luks2 "$dir.luks"
cryptsetup open "$dir.luks" luksmkfs.ext4 /dev/mapper/luks
mount /dev/mapper/luks /mnt/
rsync -aHAX --info=progress2 "$dir/" /mnt/umount /mnt/
cryptsetup close luks -
It would be nice when creating LUKS-encrypted files on disk, I could dynamically grow them based on what gets copied into them.