diff options
author | Andrew Cady <d@jerkface.net> | 2016-04-22 22:44:21 -0400 |
---|---|---|
committer | Andrew Cady <d@jerkface.net> | 2016-04-22 22:45:17 -0400 |
commit | 34ed3df8b210461ae217424c089d917fb300a824 (patch) | |
tree | b513781de301c77c01e07963bf02a36b8c4a5b10 /btrfs-receive-root.sh | |
parent | af63aae1fdeb8c6456614b840b055aef02b64395 (diff) |
fix btrfs receive script to properly set up seed subvolumes
Diffstat (limited to 'btrfs-receive-root.sh')
-rw-r--r-- | btrfs-receive-root.sh | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/btrfs-receive-root.sh b/btrfs-receive-root.sh index 175dd49..62504bf 100644 --- a/btrfs-receive-root.sh +++ b/btrfs-receive-root.sh | |||
@@ -22,9 +22,14 @@ create_layer_filesystem() | |||
22 | 22 | ||
23 | finish() | 23 | finish() |
24 | { | 24 | { |
25 | btrfs_replace_default_subvolume_with "$mountpoint"/"$receive_subv" && | 25 | local subv_id |
26 | umount "$mountpoint" && | 26 | mv "$mountpoint"/ROOT "$mountpoint"/ROOT.old || return |
27 | sex btrfstune -S1 "$layer_file" && | 27 | btrfs subvolume snapshot "$mountpoint"/"$receive_subv" "$mountpoint"/ROOT || return |
28 | subv_id=$(btrfs_show_subvolume_id "$mountpoint"/ROOT) || return | ||
29 | btrfs subvolume set-default "$subv_id" "$mountpoint" || return | ||
30 | btrfs subvolume delete "$mountpoint"/ROOT.old || return | ||
31 | umount "$mountpoint" || return | ||
32 | sex btrfstune -S1 "$layer_file" || return | ||
28 | losetup -d "$layer_dev" | 33 | losetup -d "$layer_dev" |
29 | } | 34 | } |
30 | 35 | ||