How does Union Filesystem work with SnapRaid and Samba exactly? Why am I not able to copy on commandline to Union sharedfolder?

  • I have a setup with snapraid and union filesystems, the latter beeing mergerfs by default as far as I know.


    I have three disks in my snapraid, one beeing parity. With the two data disks I set up a union filesystem.


    I set up a shared folder pointing to the union filesystem.


    This results in an entry /sharedfolders/Union. However, if I copy something to this folder with midnight commander it is not copied to the union filesystem but to the mountpoint on the system SSD. It does work when copying over samba, though. On the other hand I have other entries in /sharedfolders which are also samba shares and those are mountpoints which I also can use on the command line.


    If I copy something to the /sharedfolders/Union folder it will be copied to the local system disk because there is nothing mounted at this mountpoint. But if I access this via samba from a client it works as expected, copying the stuff to the union filesystem.


    If I want to use the union over the terminal I have to copy to /srv/333d269a-8fbc-4994-b2d0-af41e84909b2/Union. It then seems to work as expected, putting the files on the drive with the most free space.


    On the other hand I see the file snapraid.parity with 10TB of size in /srv/333d269a-8fbc-4994-b2d0-af41e84909b2 (the union mount) which is odd, because this parity file is located on the parity disk which I did NOT include in the union filesystem. How does it go there? Does snapraid automatically put a link to it on every disk?


    Can someone please explain this behaviur?

    • Offizieller Beitrag

    Your system is not correctly setup.


    That is the most likely explanation. There is a huge number of ways your system might have been setup wrong. Too many to enumerate. And possibly too many to bother finding out exactly how, in this case. Easier to try to do a correct setup from scratch. There is a very small number of correct ways to setup OMV, provided the hardware is OK.


    Also, when setting up a new system or doing major reconfiguration of an old system, please consider upgrading to the latest version of OMV. If your problems are caused by bugs they might have been fixed in the current version, or may be fixed in the future if you find the bug. If you use an old version of OMV, that might not be the case...

  • Well my system is working fine apart from this issue. But you might be right that I might have manually edited the /etc/fstab before. It is already good to know that your think that the mountpoint should normally work the way I expeced it to.

  • Well, but you probably have a samba share related to it, no? If so, you might check if you are able to copy something via the command line to that share's mountpoint or if it is just possible to copy it to /srv/... Would be interesting.

    • Offizieller Beitrag

    Not sure I understand...


    My mergerfs filesystem is indeed shared using a shared folder and the SSH, SMB and NFS services. And clients can use those services to read/write to the shared folder from the clients. Using the command line or whatever. But, naturally, referencing the shared folder name as used by the service, not the /srv/... mountpoint.

    • Offizieller Beitrag

    In addition on all my NAS and all my Linux clients I mount all shares, from all NAS, using autofs and NFS at /srv/nfs/someshare


    For instance, on nas4 I mount /srv/nfs/nas0 and /srv/nfs/nas1 and so on. The same on my laptop. Works fine...


    That is typically how I access any shares. Except locally. Then I might use either the /srv/nfs/someshare path or the /svr/crazypath/someshare path.

  • Zitat

    Except locally. Then I might use either the /srv/nfs/someshare path or the /svr/crazypath/someshare path.

    That's my point. Maybe it is natural, that on the server itself it is not possible to access the mergerfs filesystem via the /sharedfolders/Union path.

  • You have your OMV version tag for this thread set to 0.4, is that correct?

    --
    Google is your friend and Bob's your uncle!


    OMV AMD64 7.x on headless Chenbro NR12000 1U 1x 8m Quad Core E3-1220 3.1GHz 32GB ECC RAM.

  • bvrulez

    Hat das Label von OMV 0.4 auf OMV 4.x geändert.
  • I also had the wrong disk in the Union, which explaines the error the parity file. Sorry for the confusion, which arose from the fact that in SnapRaid I had set up the parity in the first disk which was odd for me.

  • I double-checked it again:


    /sharedfolder/Union does not show any content (because it seems not to be mounted to the actual UnionFS) from the command line.


    But the samba share that uses this exact shared folder Union [on Union, Union/] works as expected, shows content and is mounted when accessed from a client.


    Maybe someone can at least confirm this.

  • Try removing the Union sharedfolder (but not the content) and create it again. Use the name of Union and the directory of the unionfs mount point.

    --
    Google is your friend and Bob's your uncle!


    OMV AMD64 7.x on headless Chenbro NR12000 1U 1x 8m Quad Core E3-1220 3.1GHz 32GB ECC RAM.

  • gderf


    After shutdown by autoshutdown, the /sharedfolders/Union is again not mounted.


    My /etc/fstab looks like this:

    Code
    # >>> [openmediavault]
    /dev/disk/by-label/Barac /srv/dev-disk-by-label-Barac ext4 defaults,nofail,user_xattr,noexec,usrjquota=aquota.user,grpjquota=aquota.group,jqfmt=vfsv0,acl 0 2
    /dev/disk/by-label/Barac2 /srv/dev-disk-by-label-Barac2 ext4 defaults,nofail,user_xattr,noexec,usrjquota=aquota.user,grpjquota=aquota.group,jqfmt=vfsv0,acl 0 2
    /dev/disk/by-label/3TB01 /srv/dev-disk-by-label-3TB01 ext4 defaults,nofail,user_xattr,noexec,usrjquota=aquota.user,grpjquota=aquota.group,jqfmt=vfsv0,acl 0 2
    /dev/disk/by-label/BenRAID6 /srv/dev-disk-by-label-BenRAID6 ext4 defaults,nofail,user_xattr,noexec,usrjquota=aquota.user,grpjquota=aquota.group,jqfmt=vfsv0,acl 0 2
    //192.168.100.90/hgst/HGST /srv/6e1d9c6a-b7fa-4008-9b27-bc1c5f07bf49 cifs credentials=/root/.cifscredentials-f103d6d5-714a-46ea-8638-d4729bc532a7,_netdev,iocharset=utf8,vers=2.0,nofail 0 0
    /srv/dev-disk-by-label-3TB01:/srv/dev-disk-by-label-Barac2 /srv/333d269a-8fbc-4994-b2d0-af41e84909b2 fuse.mergerfs defaults,allow_other,direct_io,use_ino,category.create=mfs,minfreespace=4G 0 0
    # <<< [openmediavault]

    The share is in config.xml:


    Code
    <sharedfolder>
    <uuid>2ce306c6-18a4-42c5-8aa9-0a39dcbdcfe2</uuid>
    <name>Union</name>
    <comment></comment>
    <mntentref>0f4544d6-0edc-4c36-bd96-d493e9bc1f5d</mntentref>
    <reldirpath>Union/</reldirpath>
    <privileges></privileges>
    </sharedfolder>
    </shares>


    Maybe it is not mounted on startup because some other mount takes too long?

  • I solved the problem with a workaround that seems to be standard in higher versions of OMV than mine:


    Adding x-systemd.requires to the options for the union filesystem from the plugin window. So for my union of two disks the options are

    defaults,allow_other,use_ino,category.search=newest,x-systemd.requires=/srv/dev-disk-by-label-HDD1,x-systemd.requires=/srv/dev-disk-by-label-HDD2


    The only thing I now have to remember is to add this for each new disc of the union. I suggest putting a comment into /etc/fstab to remember this.

  • bvrulez

    Hat das Label gelöst hinzugefügt.

Jetzt mitmachen!

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