crypted btrfs in a file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all!

Is it possible to get a crypted btrfs in a file? Currently I'm doing this to get a crypted ISO filesystem in a file:

# genisoimage -R -J -iso-level 4 -o iso.img <dir_to_put_in_the_image>
# fallocate iso-crypted.img -l $(stat --printf="%s" iso.img)
# cryptsetup -d <key_to_crypt_iso> create test iso-crypted.img
# dd if=iso.img of=/dev/mapper/test bs=512
# sync
# cryptsetup remove test

Is it possible to do something similar in btrfs? Is there something similar to 'genisoimage' in btrfs ? Or, at least, given a directory, is it possible to know the outcome size of the filesystem to create an empty file with fallocate and create a btrfs in a loop device like:

# fallocate btrfs-crypted.img -l <btrfs_size_for_dir_to_put_in_the_image>
# losetup /dev/loop0 btrfs-crypted.img
# mkfs.btrfs /dev/loop0

then we can mount the loop0, copy the files, unmount and then crypt the btrfs-crypted.img like the ISO one.

Thanks!
Jorge








[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux