home.social

Search

4 results for “atoponce”

  1. #!/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" luks

    mkfs.ext4 /dev/mapper/luks
    mount /dev/mapper/luks /mnt/
    rsync -aHAX --info=progress2 "$dir/" /mnt/

    umount /mnt/
    cryptsetup close luks

  2. It would be nice when creating LUKS-encrypted files on disk, I could dynamically grow them based on what gets copied into them.

Share on Mastodon

Enter the server where you have an account.