Page 1 of 1

Copying Veracrypt mounted container volume?

Posted: 2017-04-27 04:07
by bester69
Hi,

I was wondering how to this properly?:
I wanted to take some backups of a mounted volume container such as a mounted Veracrypt volume container without messing the integrity file.

Im not sure if we can do this without unmounting previously the Veracrypt volume, but i read something like COW (Copy-on-write), so i think we can do this task in btrfs system files. But im thinking that a previously snapshot is needed everytime we're about to take a backup of the Veracrypt mounted volume. Can you confirm this is correct?? :?:

Steps I would apply for Veracrypy container Backup in cloud:
0- Mount Veracrypt Volume Container (edit files)
1- In BTRFS: Take a snaphot
2- Backup Veracrypt container file in btrfs-snaphot. (duplicity + wevdav)

Re: Copying Veracrypt mounted container volume?

Posted: 2017-04-27 16:45
by bester69
I made the following script for making a backup of Truecrypt/Veracrypt's file container in Box cloud:
#!/bin/bash
#
export CLK=$(sudo ~/scripts/secrets.sh XXYY1)
export CLK2=$(sudo ~/scripts/secrets.sh XXYY4)
TRUEPATH="/LINUXDEBS/NOBACKUP/truecrypt/container.truecrypt"
TRUEBACK="/LINUXDEBS/NOBACKUP/truecrypt/"
bin="veracrypt"
#bin="truecrypt"

#Creating Veracrypt Snaphot-----------------
sudo mount -o subvolid=0 /dev/sda2 /mnt
sudo btrfs subvolume delete /mnt/snap/truecrypt
sudo btrfs subvolume snapshot /mnt/home /snap/truecrypt
sudo umount /mnt
#----------------------------------
# Cleaning Veracrypt Container (mount/umount)
mkdir ./xxBACKUP
$bin -t --dismount --force ./xxBACKUP
$bin -t --mount --non-interactive -p $CLK2 /snap/truecrypt$TRUEPATH ./xxBACKUP
sleep 5
$bin -t --dismount --force ./xxBACKUP
rmdir ./xxBACKUP
#----------------------------------
sleep 5
# Backing Up to Cloud Box
duplicity -v 4 --allow-source-mismatch --no-encryption --verbosity=6 --timeout=60 --progress --ssl-no-check-certificate /snap/truecrypt$TRUEBACK webdavs://cavachon@yahoo.es: "$CLK"@dav.box.com/dav/trures
duplicity remove-older-than 3M --force --allow-source-mismatch --timeout=60 --ssl-no-check-certificate webdavs://cavachon@yahoo.es: "$CLK"@dav.box.com/dav/trures
:o