[pbs-devel] [RFC 0/2] Implement 'map' subcommand to access raw backup images

Stefan Reiter s.reiter at proxmox.com
Mon Aug 17 16:13:37 CEST 2020


NOTE: The two patches in this series are mutually exclusive, they cannot be
applied at the same time. Both versions do almost exactly the same thing from a
user perspective, but implemented differently.

The first one is a v2 of my previous work[0] using FUSE and a loop device, the
second one achieves the same thing via an NBD server.

In comparison to the FUSE version, the NBD one
 * requires less code
 * gets away without the complex async stuff needed for concurrent loopdev/FUSE
but
 * adds a new dependency, nbd-async[1]
 * AFAICT does not have a way to mark the block device as read-only (i.e. can
   only discard writes, but not set the flag), leading to some weird error
   messages when using the device from user space tools (e.g. mount without
   explicit "-o ro[,noload]")
 * requires the user the choose which /dev/nbdX to assign to manually
 * needs a kernel module which is typically not auto-loaded
 * uses NBD, which I personally don't really like ;)

Performance wise both are exactly the same (on my machine).


[0] https://lists.proxmox.com/pipermail/pbs-devel/2020-August/000307.html
[1] nbd-async needs to be modified slightly, since
     a) it uses [profile.release.build-override] which debcargo doesn't seem to
        like
     b) it depends on "nix 0.17" in upstream, while only 0.16 is packaged for
        debian - it does appear to work with 0.16 just as well though, which is
        how I tested it


proxmox-backup: Stefan Reiter (1):
  client: implement map/unmap commands for .img backups

 src/bin/proxmox-backup-client.rs       |   2 +
 src/bin/proxmox_backup_client/mount.rs | 175 ++++++++++++++---
 src/tools.rs                           |   2 +
 src/tools/fuse_loop.rs                 | 258 +++++++++++++++++++++++++
 src/tools/loopdev.rs                   |  93 +++++++++
 5 files changed, 506 insertions(+), 24 deletions(-)
 create mode 100644 src/tools/fuse_loop.rs
 create mode 100644 src/tools/loopdev.rs

-- 
2.20.1





More information about the pbs-devel mailing list