[Tails-dev] Feature #5301 - Clone or Backup Persistent Volum…

Borrar esta mensaxe

Responder a esta mensaxe
Autor: Andrew Gallagher
Data:  
Para: tails-dev
Asunto: [Tails-dev] Feature #5301 - Clone or Backup Persistent Volume
Hi, all.

I've written a tool to clone the contents of a mounted persistent volume
(or any other given directory tree) to a fresh or existing persistent
volume on another tails drive. It was done as part of a pet project, but
this functionality really belongs in tails itself.

It consists of two parts: a perl wrapper that handles user prompts for
passphrases etc. and a small setuid helper that performs the actual
work. The setuid helper will create a partition/filesystem if necessary
and then mounts, rsyncs and unmounts - this requires the passphrase to
be entered multiple times, so the perl wrapper prompts for one itself
and uses expect to supply it to the helper.

There are currently two main caveats. Firstly, the size of the tails
primary partition is hardcoded in the helper. It should be possible to
extract this instead from the output of parted, and is probably just a
matter of spending an hour or two on it. The other one is that the
wrapper depends on Term::Choose, which isn't packaged in either tails or
debian. I solved this by aliening a perl-term-choose deb but don't want
to be responsible for it, so the user interface really should be rebuilt
(suggestions welcome!). Of course it would probably be best if it could
be integrated into the tails installer instead... ;-)

You can find the code here:

https://github.com/andrewgdotcom/frith/tree/master/src/tcp-helper.c
https://github.com/andrewgdotcom/frith/tree/master/bin/tails-clone-persistent

perl-term-choose can be found here:

https://andrewg.com/debian/pool/main/p/perl-term-choose/perl-term-choose_1.202.0-2-abg2_all.deb

Let me know if you think it is useful.

Andrew.