From a22c237897a5fee1e32b52251d5a324248dc41f8 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 4 Oct 2022 06:02:06 +0200 Subject: Add -f (force) flag to `btrfs property set ro false` in upload-machine Recent btrfs-progs require the force flag (-f) (Debian bug #1019377). Turns out btrfs now strips the subvolume uuid if we make it rw, which will prevent it from being used as a base for incremental send. --- upload-machine | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/upload-machine b/upload-machine index 5d4e6b7..b726429 100755 --- a/upload-machine +++ b/upload-machine @@ -103,7 +103,7 @@ fi # btrfs send command # -send=(sudo btrfs send) +send=(btrfs send) if [ -n "$oldsv" ]; then send+=(-p "$oldsv") fi @@ -121,7 +121,15 @@ sudo "${send[@]}" | ssh "$host" sudo btrfs receive "$machines/$mname/" # Adjust machine ownership. # -ssh "$host" sudo btrfs property set -ts "$newsv_host" ro false +# Recent btrfs-progs require the force flag (-f) (Debian bug #1019377). +# Turns out btrfs now strips the subvolume uuid if we make it rw, which +# will prevent it from being used as a base for incremental send. +# +# @@ Maybe we should just keep the original as is (for incremental send) +# and make another copy where we change the ownership? Note: will also +# need to update remove-machine. +# +ssh "$host" sudo btrfs property set -f -ts "$newsv_host" ro false ssh "$host" sudo chown "$user:$user" "$newsv_host" ssh "$host" sudo chown "$user:$user" "$newsv_host/*" ssh "$host" btrfs property set -ts "$newsv_host" ro true -- cgit v1.1