On 2019-09-04 08:46, Jorge Fernandez Monteagudo wrote:
Hi Austin!
What you want here is mkfs.btrfs with the `-r` and `--shrink` options.
So, for your specific example, replace the genisoimage command from your
first example with this and update the file names appropriately:
# mkfs.btrfs -r <dir_to_put_in_the_image> --shrink btrfs.img
Note that you don't need and shouldn't use a loop mount for the target
file for the `mkfs` command. It will generate the file at the
appropriate size automatically (and as a general rule, `mkfs` for any
filesystem works just fine without a loop mount, you just need to have a
file of the right size for most of them).
And is there someway to generate a crypted btrfs directly or is it better to do
it using cryptsetup as I'm doing in the example?
You'll have to do it like you're doing in the sample.