Created
March 10, 2021 04:35
-
-
Save sprhawk/548d536993bd7189942de0388418bbb0 to your computer and use it in GitHub Desktop.
delete readonly btrfs snapshot
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# set -x | |
# set -v | |
for f in *; do | |
if [ -d $f ]; then | |
device_dir=${f%%.*} | |
snapshot_dir=${f##*.} | |
if [ $snapshot_dir != $device_dir ]; then | |
echo $f "-> " $snapshot_dir ":" $device_dir | |
btrfs property set -ts $f ro false | |
rm -rf $f | |
fi | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment