Skip to content
Snippets Groups Projects
Verified Commit 58c5d911 authored by Jan Alexander Steffens (heftig)'s avatar Jan Alexander Steffens (heftig)
Browse files

clean-chroots: Recurse, like devtools' subvolume_delete_recursive does

Needed to get rid of subvolumes created by tmpfiles.
parent f0e7aa33
No related branches found
No related tags found
No related merge requests found
......@@ -13,6 +13,14 @@ echo "<6>Deleting ${#chroots} chroots"
if btrfs filesystem df . &>/dev/null; then
remove() {
local subvol
test -d $1
find $1 -mindepth 1 -xdev -depth -inum 256 -print0 |
while IFS= read -d $'\0' -r subvol; do
remove $subvol
done
btrfs sub del -- $1 &>/dev/null
}
else
......@@ -41,3 +49,5 @@ done
df -HT .
exit $ret
# vim:set sw=2 et:
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment