Re: cannot use btrfs for nfs server

Graham Cobb
2021-07-12T13:06:33Z

On 12/07/2021 08:25, Ulli Horlacher wrote:
> On Sat 2021-07-10 (16:17), Chris Murphy wrote:
>> On Sat, Jul 10, 2021 at 12:56 AM Ulli Horlacher
>> <framstag@rus.uni-stuttgart.de> wrote:
>>
>>> root@tsmsrvj:# snaprotate -v test 5 /data/fex/spool
>>> $ btrfs subvolume snapshot -r /data/fex/spool /data/fex/spool/.snapshot/2021-07-10_0849.test
>>> Create a readonly snapshot of '/data/fex/spool' in '/data/fex/spool/.snapshot/2021-07-10_0849.test'
>>
>> I think this might be the source of the problem. Nested snapshots are
>> not a good idea, it causes various kinds of confusion.
>
> I do not have nested snapshots anywhere.
> /data/fex/spool is not a snapshot.

But it is the subvolume which is being snapshotted. What happens if you
put the snapshots somewhere that is not part of that subvolume? For
example, create /data/fex/snapshots, snapshot /data/fex/spool into a
snapshot in /data/fex/snapshots/spool/2021-07-10_0849.test, export
/data/fex/snapshots using NFS and mount /data/fex/snapshots on the client?

> /data/fex/spool/.snapshot/2021-07-10_0849.test is a simple snapshot of
> the btrfs subvolume /data/fex/spool
>
>
>>> We cannot move the snapshots to a different directory. Our workflow
>>> depends on snaprotate:
>>>
>>> http://fex.belwue.de/linuxtools/snaprotate.html

Won't snaprotate follow softlinks? ln -s /data/fex/snapshots
/data/fex/spool/.snapshot

>>
>> OK does the problem happen if you have no nested snapshots (no nested
>> subvolumes of any kind) in the NFS export path?
>>
>> If the problem doesn't happen, then either the tool you've chosen needs
>> to be enhanced so it will create snapshots somewhere else, which Btrfs
>> supports, or you need to find another tool that can.
>
> Without snapshots there is no problem, but we need access to the snapshots
> on the nfs clients for backup/recovery like Netapp offers it.
> But Netapp is EXPENSIVE :-}

My server snapshots data subvolumes into a different part of the tree
(in my case I use btrbk) and exports them to clients and the clients can
access all the snapshots over NFS perfectly well.