0

How can I tell if a btrfs subvolume is read-only or read-write?

2

btrfs property will show the read-only / read-write status of a subvolume:

btrfs property get -ts /path/to/subvolume

This will give either: ro=true or ro=false.

  • This is a more direct way to know the read-only state, than the btrfs subvolume command, and you can also change it with btrfs property set -ts /path/to/subvolume ro true or false. – marcz Jun 21 at 7:43
1
btrfs sub show /path/to/subvolume|grep readonly

returns 0 if it is readonly, you can test it with

btrfs sub show /path/to/subvolume|grep readonly && echo yep
  • Welcome to U&L! I'd suggest using -q with grep. – Tom Hale Apr 18 at 6:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.