How to make a btrfs snapshot writable?

32 down vote accepted

The btrfs manpage fails to document the property subcommand, which I found by grep’ing the source. It’s also in btrfs --help.

To set a snapshot to read-write, you do something like this:

btrfs property set -ts /path/to/snapshot ro false

Change that to true to set it to read-only.

You can also use list to see the available properties:

btrfs property list -ts /path/to/snapshot
ro                  Set/get read-only flag of subvolume.

-t specifies the type of object to work on, s means subvolume. Other options are f (filesystem), i (inode), and d (device). If you don’t specify, it’ll show all applicable ones (for list) or try to guess for get/set.

Edit: in the newest btrfs tools, there is a btrfs-property manpage documenting that subcommand, although it’s not mentioned in the main manpage at all. It’s also available as the btrfs-property page on the wiki.

(Note: This requires a new-enough btrfs-tools. Apparently on Debian Wheezy, you’ll have to install the updated one from wheezy-backports; thanks artfulrobot).

发表评论

电子邮件地址不会被公开。 必填项已用*标注

跳至工具栏