Add mountpoint check to btrfs subvol logic

Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
This commit is contained in:
WorMzy Tykashi 2013-09-16 00:35:37 +01:00 committed by Pierre Schmitz
parent 27441f201c
commit 59e348fc3c
1 changed files with 1 additions and 1 deletions

View File

@ -142,7 +142,7 @@ create_chroot() {
slock 8 "$chrootdir/root.lock" "Locking clean chroot"
stat_busy "Creating clean working copy [$copy]"
if [[ "$chroottype" == btrfs ]]; then
if [[ "$chroottype" == btrfs ]] && ! mountpoint -q "$copydir"; then
if [[ -d $copydir ]]; then
btrfs subvolume delete "$copydir" >/dev/null ||
die "Unable to delete subvolume %s" "$copydir"