From eec7fcf965763d5395c336f92cd56b193d054947 Mon Sep 17 00:00:00 2001 From: "Jan Alexander Steffens (heftig)" Date: Tue, 7 Mar 2017 20:14:50 +0100 Subject: archbuild/makechrootpkg: Delete subvolumes in roots The systemd package creates a subvolume at /var/lib/machines (through tmpfiles), if it can. We need to delete this subvolume before we can delete the parent subvolume. Look through the root for inodes with the number 256. These identify subvolume roots. --- makechrootpkg.in | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'makechrootpkg.in') diff --git a/makechrootpkg.in b/makechrootpkg.in index 9e84996..dc598f7 100644 --- a/makechrootpkg.in +++ b/makechrootpkg.in @@ -97,10 +97,8 @@ create_chroot() { stat_busy "Creating clean working copy [$copy]" if is_btrfs "$chrootdir" && ! mountpoint -q "$copydir"; then - if [[ -d $copydir ]]; then - btrfs subvolume delete "$copydir" >/dev/null || - die "Unable to delete subvolume %s" "$copydir" - fi + subvolume_delete_recursive "$copydir" || + die "Unable to delete subvolume %s" "$copydir" btrfs subvolume snapshot "$chrootdir/root" "$copydir" >/dev/null || die "Unable to create subvolume %s" "$copydir" else -- cgit v1.2.3-54-g00ecf