-
Notifications
You must be signed in to change notification settings - Fork 18.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes subvol delete on a non-btrfs volume #42272
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -61,10 +61,12 @@ if command -v btrfs > /dev/null 2>&1; then | |||||||||||||
# Source: http://stackoverflow.com/a/32865333 | ||||||||||||||
for subvol in $(find "$dir" -type d -inum 256 | sort -r); do | ||||||||||||||
if [ "$dir" != "$subvol" ]; then | ||||||||||||||
( | ||||||||||||||
set -x | ||||||||||||||
btrfs subvolume delete "$subvol" | ||||||||||||||
) | ||||||||||||||
if [ "$(stat -f --format=%T $subvol)" == "btrfs" ]; then | ||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I realize this script specified
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Full agreement from me 😇 I'd go one step further, too:
Suggested change
Or even (to catch any possible failing exit code from
Suggested change
|
||||||||||||||
( | ||||||||||||||
set -x | ||||||||||||||
btrfs subvolume delete "$subvol" | ||||||||||||||
) | ||||||||||||||
fi | ||||||||||||||
fi | ||||||||||||||
done | ||||||||||||||
fi | ||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, it's probably worth bringing that conditinoal all the way up to here, ala:
(So we only have a single
if
)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's, nifty; and looks good to me.