public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Thomas Freudenberg <th.freudenberg@4commerce.de>
To: "pve-devel@lists.proxmox.com" <pve-devel@lists.proxmox.com>
Subject: [pve-devel] Update LXC vzdump to support BTRFS
Date: Thu, 2 Nov 2023 17:33:18 +0000	[thread overview]
Message-ID: <em58265ac9-aeea-42c8-9484-f31e4f3243c6@5ab1f258.com> (raw)

Hi everyone,

in case that we need support for BTRFS SNAPSHOT Backups, I have patched the file:

/usr/share/perl5/PVE/LXC.pm

and added support to mount BTRFS SNAPSHOT SUBVOL.

If interested let me know if I should send in a patch.

Cheers
Tom


1795a1796,1813
>                   } elsif ($scfg->{type} eq 'btrfs') {
>                       # extract subvol path for snapshot from storage
>                       my $snap_subvol_path = $path =~s/$scfg->{path}\///r;
>
>                       # parse result from btrfs command for device uuid
>                       my $device_uuid;
>
>                       my $parser = sub {
>                           my $line = shift;
>                           if ($line =~ m/^.*\s+uuid:\s+([0-9a-f-]+)(\s+.*)?$/) {
>                               $device_uuid = $1;
>                           }
>                       };
>
>                       # get uuid for block device from btrfs volume
>                       PVE::Tools::run_command(['btrfs', 'filesystem', 'show', '-m', '/vol/pve'], outfunc => $parser, timeout => 10);
>
>                       PVE::Tools::run_command(['mount', '-o', 'ro', @extra_opts, '-t', 'btrfs', '-o', "subvol=$snap_subvol_path", "UUID=$device_uuid", $mount_path]);


                 reply	other threads:[~2023-11-02 17:51 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=em58265ac9-aeea-42c8-9484-f31e4f3243c6@5ab1f258.com \
    --to=th.freudenberg@4commerce.de \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal