aboutsummaryrefslogtreecommitdiff
path: root/upload-machine
diff options
context:
space:
mode:
Diffstat (limited to 'upload-machine')
-rwxr-xr-xupload-machine12
1 files 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