Skip to content

Instantly share code, notes, and snippets.

@sprhawk
Created March 10, 2021 04:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sprhawk/548d536993bd7189942de0388418bbb0 to your computer and use it in GitHub Desktop.
Save sprhawk/548d536993bd7189942de0388418bbb0 to your computer and use it in GitHub Desktop.
delete readonly btrfs snapshot
# 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