duplicity incremental backup to virtual block device

55 views
Skip to first unread message

Doesnt Work

unread,
Jun 4, 2016, 12:42:23 PM6/4/16
to qubes...@googlegroups.com
Hello!

My basic problem:
I'd like to backup some of my files from AppVMs incrementally with
duplicity. Some of them (vault, ...) don't have network access. I
believe I don't have enough free HDD-space to keep the update within the
AppVM and copy every update to a network-enabled AppVM. (apart from
that, it would take quite long.

My current solution:
Plug in a Thumb-Drive, start first AppVM to be backuped, attach it to
the AppVM, run duplicity, detach thumbdrive, shutdown AppVM, rinse and
repeat with other AppVMs that need to be backuped.
In theory, this should be possible with a script in dom0, but currently
I do it manually. It works fine.
Finally, the thumbdrive is attached to an AppVM with network access and
the whole backup uploaded via sftp. (I want to have a local and off-site
backup anyway, so uploading a huge file isn't that big of a deal for me.)

What I want to achieve:
A virtual block device, which I can attach/detach programatically, so I
don't need to attach a regular thumbdrive.

I've tried to create a virtual blockdevice:

dd if=/dev/zero of=~/backup.img

losetup --find --partscan --show bakup.img

mkfs.fat /dev/loop19

but it doesn't show up in qvm-block -l.

So I don't know weather it's easier to tell qubes "This is a USB
device!" (how?) or tell qubes to attach this loop device to an AppVM.
(Again, how? I was thinking about creating a virtual PCI-device, though
I'd still have to google weather that's possible.)

Sincerely
GammaSQ

Marek Marczykowski-Górecki

unread,
Jun 4, 2016, 7:06:05 PM6/4/16
to Doesnt Work, qubes...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Take a look at qvm-block --attach-file (qvm-block -A).

- --
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQEcBAEBCAAGBQJXU17VAAoJENuP0xzK19csUnUIAJWyFvkwbLidBbfugAk951uR
Dsl8zu0Gj3hCdXIy+bu/c1O/RkWw6Dq8dHA+L9qLqKeq5NtiIjBemeG2uaXKrRv9
yjBH9Tqvbr+s19NbcQD5eUVTMdSr1djvPeSKTr5eoO3YxGh88aZIq9LMo6p3nzKc
zhBGHecOHG/enYuz43EPgnJFxA74MwN98Ymt5WEnVN8X+8rbNqR5e0vmnE0hEa+k
ZkPkGR333b4GO22hV5+TE333QgWKNRpQv6M7wnbOm1HIzZRbefFejvD+HXivBaSv
7+OBSlFTKKeXiLigSeKzeVell54f7Zag/b6S1HYGHPu53+Dzjmdyhvc/WSeV8sw=
=PiBh
-----END PGP SIGNATURE-----

Marek Marczykowski-Górecki

unread,
Jun 5, 2016, 7:35:00 AM6/5/16
to Doesnt Work, qubes-users
On Sun, Jun 05, 2016 at 10:51:35AM +0200, Doesnt Work wrote:
> Thank you, will try it!
> Would it be possible to document this behavior? The documentation only
> mentions -a, as does the man page:
> https://www.qubes-os.org/doc/dom0-tools/qvm-block/

It is in qvm-block --help, but indeed man page is outdated...
signature.asc

Marek Marczykowski-G�recki

unread,
Jun 5, 2016, 8:16:06 PM6/5/16
to Doesnt Work, qubes-users
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

On Mon, Jun 06, 2016 at 01:22:07AM +0200, Doesnt Work wrote:
> I've hit somewhat of a roadblock:
> To mount the device correctly within the vm, I need to know the
> vdev-drive (xvd[x]). So far, I didn't find a possibility to either look
> it up with qvm-block or specify it, so I dove into the madness of xl
> block-attach, since here I can specify the vdev-name.

Take a look at qvm-block --help...
There is --frontend option for this.
Also, when device is attached, qvm-block will show you at which vdev
name (for example "attached to 'testvm' as 'xvdi'").

Please keep mailing list in CC.

- --
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQEcBAEBCAAGBQJXVMC+AAoJENuP0xzK19csIN0H/23Kd1XhkJg3MtiKkeh8CEiN
wUAzs0UbwGiAUnXk4rln1jGVj96spQ/5hbF64zKMjJzdQmFoN2CYE/BpDrngvmwN
qBMapEPZrs7bWWoNdC/yJ0yeTBB3IAmLTNstSPCnIa7Ovs+r+zkSZR/rRbwNSKW0
DafKB/o08YQS/h5kqFYaI3u6SXP6gDXZ+fnnp/4HeKuhNNIW91H63x2803EUenUb
QTVwpVVNwZR6gnXAlXnFbosRL/ptTVM/UPuGEcZwOVFN9QTXtU7qQ6hibpUMIYNK
LtsG+VcjLvD5xUHbWEoox1onxYNDYIqyVQuYNx/nMtC1sgrbCyDHcMAsSjhggCY=
=RKK6
-----END PGP SIGNATURE-----

Doesnt Work

unread,
Jun 6, 2016, 3:46:32 AM6/6/16
to Marek Marczykowski-G�recki, qubes-users

> There is --frontend option for this.
That's weird. I actually tried that, but it failed, in retrospect
probably to this bug:
https://github.com/QubesOS/qubes-issues/issues/2047
However, when I tried it again just now, it worked without a hitch.

> Also, when device is attached, qvm-block will show you at which vdev
> name (for example "attached to 'testvm' as 'xvdi'").
I've found this to be untrue when you attach files:
[gammasq@dom0 ~]$ qvm-block
backup:loop0 /home/user/backup.img 9 GiB
[gammasq@dom0 ~]$
Again, quite weird behavior, since I have seen the "attached to ..."
message from time to time within the last days, though it's rare and I
can't seem to reproduce it reliably.

> Please keep mailing list in CC.
Sorry, used to mailinglists I subscribed to.

Sincerely
GammaSQ

signature.asc
Reply all
Reply to author
Forward
0 new messages