From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 1775C612B1 for ; Mon, 17 Aug 2020 16:14:00 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 095A5B71A for ; Mon, 17 Aug 2020 16:14:00 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [212.186.127.180]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id B8102B702 for ; Mon, 17 Aug 2020 16:13:58 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 819004463C for ; Mon, 17 Aug 2020 16:13:58 +0200 (CEST) From: Stefan Reiter To: pbs-devel@lists.proxmox.com Date: Mon, 17 Aug 2020 16:13:37 +0200 Message-Id: <20200817141339.16115-1-s.reiter@proxmox.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL -0.055 Adjusted score from AWL reputation of From: address KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pbs-devel] [RFC 0/2] Implement 'map' subcommand to access raw backup images X-BeenThere: pbs-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Backup Server development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Aug 2020 14:14:00 -0000 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