All of lore.kernel.org
 help / color / mirror / Atom feed
* Allow sending of rw-subvols if file system is mounted ro
@ 2019-03-12 15:48 Martin Raiber
  2019-03-12 18:00 ` Andrei Borzenkov
  2019-03-13  0:52 ` Chris Murphy
  0 siblings, 2 replies; 4+ messages in thread
From: Martin Raiber @ 2019-03-12 15:48 UTC (permalink / raw)
  To: linux-btrfs

Hi,

I know there are corner cases that probably make this difficult (such as
remounting the file system rw while a send is in progress), but it would
be nice if one could send all subvolumes as long as a file system is
mounted read-only (pretend every subvol ist read-only if the file system
is mounted read-only).

Background/use case:

Through no fault of btrfs, metadata got damaged, which makes a file
system go read-only after a while and I'd like to btrfs send/receive the
subvolumes and snapshots that are still readable to another btrfs file
system (btrfs send/receive being the only option that does this somewhat
efficiently). Only I cannot send the subvolumes that are not set to
read-only prior to the file system going read-only.
I patched the kernel and btrfs-tools (just commenting the checks out) to
support this in my case, but it would be great if this would be possible
without patching.

Regards,
Martin Raiber


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Allow sending of rw-subvols if file system is mounted ro
  2019-03-12 15:48 Allow sending of rw-subvols if file system is mounted ro Martin Raiber
@ 2019-03-12 18:00 ` Andrei Borzenkov
  2019-03-12 18:15   ` Noah Massey
  2019-03-13  0:52 ` Chris Murphy
  1 sibling, 1 reply; 4+ messages in thread
From: Andrei Borzenkov @ 2019-03-12 18:00 UTC (permalink / raw)
  To: Martin Raiber, linux-btrfs

12.03.2019 18:48, Martin Raiber пишет:
> Hi,
> 
> I know there are corner cases that probably make this difficult (such as
> remounting the file system rw while a send is in progress), but it would
> be nice if one could send all subvolumes as long as a file system is
> mounted read-only (pretend every subvol ist read-only if the file system
> is mounted read-only).
> 

It is possible to mount top level read-only and still mount subvolume
read-write.

> Background/use case:
> 
> Through no fault of btrfs, metadata got damaged, which makes a file
> system go read-only after a while and I'd like to btrfs send/receive the
> subvolumes and snapshots that are still readable to another btrfs file
> system (btrfs send/receive being the only option that does this somewhat
> efficiently). Only I cannot send the subvolumes that are not set to
> read-only prior to the file system going read-only.
> I patched the kernel and btrfs-tools (just commenting the checks out) to
> support this in my case, but it would be great if this would be possible
> without patching.
> 
> Regards,
> Martin Raiber
> 


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Allow sending of rw-subvols if file system is mounted ro
  2019-03-12 18:00 ` Andrei Borzenkov
@ 2019-03-12 18:15   ` Noah Massey
  0 siblings, 0 replies; 4+ messages in thread
From: Noah Massey @ 2019-03-12 18:15 UTC (permalink / raw)
  To: Andrei Borzenkov; +Cc: Martin Raiber, linux-btrfs

On Tue, Mar 12, 2019 at 2:04 PM Andrei Borzenkov <arvidjaar@gmail.com> wrote:
>
> 12.03.2019 18:48, Martin Raiber пишет:
> > Hi,
> >
> > I know there are corner cases that probably make this difficult (such as
> > remounting the file system rw while a send is in progress), but it would
> > be nice if one could send all subvolumes as long as a file system is
> > mounted read-only (pretend every subvol ist read-only if the file system
> > is mounted read-only).
> >
>
> It is possible to mount top level read-only and still mount subvolume
> read-write.

How about if the underlying medium is currently ro?


>
> > Background/use case:
> >
> > Through no fault of btrfs, metadata got damaged, which makes a file
> > system go read-only after a while and I'd like to btrfs send/receive the
> > subvolumes and snapshots that are still readable to another btrfs file
> > system (btrfs send/receive being the only option that does this somewhat
> > efficiently). Only I cannot send the subvolumes that are not set to
> > read-only prior to the file system going read-only.
> > I patched the kernel and btrfs-tools (just commenting the checks out) to
> > support this in my case, but it would be great if this would be possible
> > without patching.
> >
> > Regards,
> > Martin Raiber
> >
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Allow sending of rw-subvols if file system is mounted ro
  2019-03-12 15:48 Allow sending of rw-subvols if file system is mounted ro Martin Raiber
  2019-03-12 18:00 ` Andrei Borzenkov
@ 2019-03-13  0:52 ` Chris Murphy
  1 sibling, 0 replies; 4+ messages in thread
From: Chris Murphy @ 2019-03-13  0:52 UTC (permalink / raw)
  To: Martin Raiber; +Cc: linux-btrfs

On Tue, Mar 12, 2019 at 9:48 AM Martin Raiber <martin@urbackup.org> wrote:
>
> Hi,
>
> I know there are corner cases that probably make this difficult (such as
> remounting the file system rw while a send is in progress), but it would
> be nice if one could send all subvolumes as long as a file system is
> mounted read-only (pretend every subvol ist read-only if the file system
> is mounted read-only).
>
> Background/use case:
>
> Through no fault of btrfs, metadata got damaged, which makes a file
> system go read-only after a while and I'd like to btrfs send/receive the
> subvolumes and snapshots that are still readable to another btrfs file
> system (btrfs send/receive being the only option that does this somewhat
> efficiently). Only I cannot send the subvolumes that are not set to
> read-only prior to the file system going read-only.
> I patched the kernel and btrfs-tools (just commenting the checks out) to
> support this in my case, but it would be great if this would be possible
> without patching.

It might be sane for an offline tool, such as btrfs-tune or btrfs
rescue, to effectively allow `btrfs property set <pathtosubvolume> ro
true` which is just a single bit change to the containing node, and
also updating the checksum for that node.

But, kinda sorta what you want is built into btrfs rescue. You can
scrape data out of specific subvolumes. So, while you can't do an
incremental send/receive style recovery; you can at least get the data
out.

-- 
Chris Murphy

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-03-13  0:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-12 15:48 Allow sending of rw-subvols if file system is mounted ro Martin Raiber
2019-03-12 18:00 ` Andrei Borzenkov
2019-03-12 18:15   ` Noah Massey
2019-03-13  0:52 ` Chris Murphy

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.