Samba Segfault when moving/copy file from a EXT4 partition to BTRFS partition

  • Hi I noticed the Samba (ver 2:4.13.13+dfsg-1~deb11u5) in my machine running OMV 6.8.0-1 (Shaitan) will segfault whenever I tried to move or copy a file from an EXT4 partition (mapped to a Windows network drive to Z:) to an BTRFS partition (mapped as Windows network drive Y:).


    The panic error from the syslog is:

    The panic will be resolved if I remove the `shadow:` option entries and `shadow_copy2` from the `/etc/samba/smb.conf, like the one below.


    I am not quite sure if it is an Samba bug or its library is just a bit old and have compatibility issue with the btrfs driver the kernel use. I was considering updating the Samba and see if it can be resolved but it looks like I will ruin my apt package dependency if I do so. Samba will not panic if I just move/copy file within the btrfs partition. It also doesn't panic if I copy/move file from my Windows workstation to the btrfs partition. It seems only an problem if the copy is from a samba managed non-btrfs partition (in my case, an EXT4 partition) to a btrfs partition. Shall I create an issue in the github issue tracker?


    The "deleting shadow copy from /etc/samba/smb.conf" is also not very convenient. As the file will be rewritten by omv engine when a configuration is changed. Could we have an option in the OMV's web UI to set the shadow_copy2 to off? For me, Samba snapshot and shadow_copy is completely useless and it would be great if there is an option in the setup to disable it.

  • macom

    Hat das Thema freigeschaltet.
    • Offizieller Beitrag

    If you want to see the bug fixed, please report the issue to the Debian project. Alternatively the upstream Samba project. The OMV project is not and can't maintain the software it bundles.


    Could we have an option in the OMV's web UI to set the shadow_copy2 to off?

    No, that is not possible.


    You can add vfs objects = foo bar baz to the Extra options field of the SMB share to override the setting generated by OMV.

  • votdev

    Hat das Label OMV 6.x hinzugefügt.
  • If you want to see the bug fixed, please report the issue to the Debian project. Alternatively the upstream Samba project. The OMV project is not and can't maintain the software it bundles.


    No, that is not possible.


    You can add vfs objects = foo bar baz to the Extra options field of the SMB share to override the setting generated by OMV.

    I will try to file a bug in debian. This issue is likely fixed in upstream Samba but didn't backport to the version that Debian uses.


    I tried the Extra options workaround you mentioned. It looks like I need to put blank vfs objects = and shadow:OPTIONS =  into the Extra options to make it work. After this, the copy/move option no longer causes samba to segfault.


    Could you briefly explain why it is not possible to add an UI option in OMV to disable the shadow_copy2 when configurate an SMB/CIFS share for a folder on btrfs partition? IIUC the `shadow_copy2` options are added to `smb.conf` by the OMV engine and it will only do so if it detects the underlying partition is using btrfs. I didn't see the same option happen on EXT4 (it doesn't have snapshot feature anyway) or ZFS (it has snapshot feature) partition. If that is the case, adding an UI option to disable shadow_copy2 should be doable.

    • Offizieller Beitrag

    Could you briefly explain why it is not possible to add an UI option in OMV to disable the shadow_copy2 when configurate an SMB/CIFS share for a folder on btrfs partition? IIUC the `shadow_copy2` options are added to `smb.conf` by the OMV engine and it will only do so if it detects the underlying partition is using btrfs. I didn't see the same option happen on EXT4 (it doesn't have snapshot feature anyway) or ZFS (it has snapshot feature) partition. If that is the case, adding an UI option to disable shadow_copy2 should be doable.

    This is simple. I hate to add knobs for every usecase. OMV is no webmin where you can configre everything that is possible.

  • I just formatted my drive to btrfs recently and had the same problem, this is giving me a lot of trouble, I think I'll go back to ext4 and stay away from btrfs.

    In my case I encountered some I/O performance issue with btrfs lately so I switched to OpenZFS entirely.

    The smb segfault only happens with shadow_copy2 enabled, which won't be enabled in anything other than btrfs.

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!