btrfs-progs
btrfs-progs copied to clipboard
`btrfs send` errors when used on a ro-mounted fs but the subvol isn't ro
btrfs send
gives ERROR: subvolume ${subvol} is not read-only
when the fs is mounted as ro but ${subvol}
is a non-ro subvol.
btrfs send
givesERROR: subvolume ${subvol} is not read-only
when the fs is mounted as ro but${subvol}
is a non-ro subvol.
@25pwn It means that the subvol itself has to be ro, not that the filesystem should be ro.
You can make a ro snapshot that can be used with send with btrfs subvolume snapshot -r
.
Send requires that the subvolume is immutable during the operation, it's not even possible to flip the ro flag when it's running. The read-only mount does not guarantee that, there can be another writable mount of the same subvolume, this would break send.
Sorry, I never got the notifications for these
@25pwn It means that the subvol itself has to be ro, not that the filesystem should be ro.
You can make a ro snapshot that can be used with send with
btrfs subvolume snapshot -r
.
@Forza-tng What I (wrongly) believed was that ro-mounted subvols are immutable, therefore they should be send
able.
Send requires that the subvolume is immutable during the operation, it's not even possible to flip the ro flag when it's running. The read-only mount does not guarantee that, there can be another writable mount of the same subvolume, this would break send.
@kdave I see. Though this would be a niche feature, could you see this(send
when subvol is rw but immutable due to only being mounted ro etc.) being implemented? If I were to make these changes myself, would you accept the pull request?
Though this would be a niche feature, could you see this(
send
when subvol is rw but immutable due to only being mounted ro etc.) being implemented? If I were to make these changes myself, would you accept the pull request?
The problem is that it's not possible to implement. There's no way to prevent changing any file from the rw subvolume during the send from another mount. In a very limited case "I know what am I doning" yes, but any accidental change would lead to corruption of the send stream and this would lack safety for general case.
Understood, thank you for answering
I've added a note about that to send manual page.