Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

According to the btrfs Readonly snapshots patch it's possible to "set a snapshot readonly/writable on the fly." So I should be able to turn my readonly snapshot (created with btrfs snapshot -r) writable, somehow.

But neither the btrfs subvolume manpage nor any other part of that manpage seems to give a way to do that.

share|improve this question

1 Answer 1

up vote 13 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.

share|improve this answer
1  
You'll also find that while the kernel APIs evolve and distributions ship with newer and newer kernels, the btrfs-tools found on some same distributions are not always aligned. So you sometimes found yourself having to compile the latest btrfs-tools form the upstreams git repository to be able to use the btrfs features of your kernel (at least that was very much the case a few years ago). –  Stéphane Chazelas Aug 12 at 19:00
    
@StéphaneChazelas Yes, definitely. Though in this case I'm on Debian testing, which has btrfs-tools 3.14, so not that insanely old. –  derobert Aug 12 at 20:30
1  
@mikeserv Indeed, it appears 3.14.2 split them out. I have 3.14.1, which is only a few months older, according to kernel.org git. But even the current man page doesn't mention properties. I checked (and linked to) the current one on the wiki, too. Turns out the is a separate, not-linked manpage for it though. –  derobert Aug 12 at 21:20

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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