Transfer files to external HDD encrypted by Veracrypt

bingsoo

Cadet
Joined
Jan 8, 2023
Messages
7
Hi. I have an external hard disk drive encrypted by Veracrypt that I would like to transfer files into.

Is it possible to do it directly within TrueNAS Scale (version: TrueNAS-SCALE-22.12.0)?

I understand that I can set up a SMB share with the dataset in question, mount it on a Windows computer -- where I'll also be able to unencrypt my HDD -- and perform the transfer there.

However, that's slower due to my slow internet connection. Would prefer to do it directly if possible.

Are there other ways besides the two I mentioned?

Any help/hints is appreciated. Thanks!
 

NugentS

MVP
Joined
Apr 16, 2020
Messages
2,947
Can't think of a way. Not that I have ever tried
 
Joined
Oct 22, 2019
Messages
3,641
Is this going to be a one-time thing? If not, then trying to intermix VeraCrypt + ZFS on an appliance is not a viable solution.

However, it's "theoretically" possible in an SSH session.

I'm assuming SCALE (Debian-based) has cryptsetup with LUKS2 and VeraCrypt support pre-installed.

The basic method is like so:
Code:
cryptsetup --type tcrypt --veracrypt open /dev/sdxN veracrypt1

(Replace sdxN with the drive/partition in question, such as /dev/sdf1)


You would then mount /dev/mapper/veracrypt1 to a temporary path, such as /mnt/veracrypt1
Code:
mkdir -p /mnt/veracrypt1
mount /dev/mapper/veracrypt1 /mnt/veracrypt1


Copy your files, unmount the container, and then re-lock ("close") the container using cryptsetup once again.
Code:
umount /mnt/veracrypt1
cryptsetup close veracrypt1
rmdir /mnt/veracrypt1


I do not know if this will cause unforeseen hiccups, since TrueNAS SCALE is an appliance, not a desktop Linux distro.
 
Last edited:

bingsoo

Cadet
Joined
Jan 8, 2023
Messages
7
Thanks both for your responses!

Thanks for that little write-up, @winnielinnie. Yes, this will be an occasional thing when I transfer files over to "cold" storage, which will be done in bulk. Can't respond to your suggestions right now, but I will refer back to them when the time comes!
 
Top