[HOWTO] Instal ZFS-Plugin & use ZFS on OMV

  • I have a Raidz1-ZFS system with 3 disks (/dev/sdb-sdd). Mountpoint for this ZFS-Pool is /mnt/zfs.


    Now SMART reports on one Harddisk "pending sectors". I now want to replace this failed disk from the ZFS pool and replace with a new disk.

    Under NAS4free there was appropriate tools in the Web GUI "ZFS-Area". Unfortunately, there is this possibility at OMV ?(


    Which commands I have to use to solve this problem ?! :?:


    I have various instructions found on the net, but unfortunately contradict each other in part. In this respect I am a little confuded.


    THANK YOU!!

    defcon999

  • better always to use sources : http://docs.oracle.com/cd/E192…819-5461/gbbzy/index.html


    What I do in your way? .
    1- be sure what is the defective disk ( write Serial number on a paper to avoid confusion).
    2- stop the NAS (Poweroff)
    3- change defective disk by new one ( VERY, VERY importan to be sure , so serial Disk must be used to be sure)
    3-Poweron the NAS
    4- from shell execute the apropiate zpool replace (see oracle documentation to be sure)
    5- once done if all works fine, a resilver MUST be started automatically.



    PD: allways check all twice, if you replace erroneous disk or type zpool replace adax erroneous, you can lose your pool. (you must be sure how is named your new and failed disk)

  • I'm still having boot issues with the latest version of ZFS. It looks like zfs-import runs after the local filesystems are mounted. I have a lot of "bind" mounts setup for NFS and one for Docker that obviously won't work unless my zfs is imported first.


    Can I just add $local_fs to the dependencies for the zfs-import init script? Should I provide an insserv override?

  • It looks like it is:



    Though... it *is* importing before other things try to mount...so I'm not sure why the bind mounts are failing.

    • Offizieller Beitrag

    It looks correct, i can't remember in my previous system the "S level" being recorded at boot. However i was dragging a very old install since squeeze. You can see rpcbind starting that is runlevel 2. Everything from before is single user.


    How big is the pool and how long does it take to import in CLI?


    All i can think now is to add the sequence in rc.local to execute first import, then mount-zfs finally mount -a.
    Another thing could be add a sleep timer in the init just after zfs-import.

  • It does take quite a bit of time for the import to complete, but I figured the import operating was synchronous and boot wouldn't continue until it's fully imported. Is that not the case? Is there any way to tell when import is completed?


    Oh, it looks like "zfs-import" runs "zpool import" with the "-N" argument, which doesn't mount any filesystems. It looks like zfs-mount takes care of mounting, and it requires "$local_fs". Perhaps that's the issue? I've enabled verbose mounting in /etc/default/zfs, we'll see what happens the next time I reboot.

  • Yes, it looks like zfs-mount runs too late:



    The line right before rpcbind is the zfs-mount script.

    • Offizieller Beitrag

    the order at init.d doesn't matter is the lab tags that put them in order and in place. Zfs mount should be at /etc/rcS among normal mounts and networking. Rpcbind is runlevel two so it should be displayed at /etc/rc[2345].d with normal services.


    problem is the zfs mounts are failing. That's your issue. Play with sleep timers in the init script maybe.

  • zfs-mount was not in S, in fact, the default script is defined thusly:


    Code
    ### BEGIN INIT INFO
    # Provides:          zfs-mount
    # Required-Start:    $local_fs zfs-import
    # Required-Stop:     $local_fs zfs-import
    # Default-Start:     2 3 4 5
    # Default-Stop:      0 1 6
    # X-Stop-After:      zfs-zed
    # Short-Description: Mount ZFS filesystems and volumes
    # Description: Run the `zfs mount -a` or `zfs umount -a` commands.
    ### END INIT INFO


    So it clearly depends on $local_fs and doesn't start during S. I've setup an override for it and that's moved it into S, we'll see if that does the job.

    • Offizieller Beitrag

    I made a mistake when i saw the problems with the packaging issues last month in github, i though this issue was being addressed. @ikogan don't even bother at ZOL, this issue lays there since the beginning. They guy doesn't wanna touch the init scripts.
    We might need to add the override again in postinst. cc @nicjo814

    edit: I see that the override hasn't being removed from stable omv-zfs apparently, an easy fix will be to downgrade the plugin to stable instead of testing

  • Hello,


    I have a problem with my server concerning permissions from Emby on ZFS Filesytsem.


    Hardware: HP Gen8 G1610T with 16 GB EEC Ram, 120 GB SSD with OMV, 4 x 4 TB Seagate NAS HDD with ZFS RaidZ-1 Filesystem
    OMV 2.1.18, emby installed over OMV-Extras.com Version 3.0.5781.0


    The problem is, that emby cant write meta data to the media folder.
    My share is i.e.
    /MyStuff/Media/Videos/Movies/Captain Phillips (2013)/Captain Phillips (2013).mkv
    or
    /MyStuff/Media/Videos/Serien/Better call Saul/Season 1/Better Call Saul - S01E01 - Anfänge
    MyStuff is the ZFS Data storage.


    I`m strugeling around with tekkb in this thread
    Emby spielt keine Videos ab, zeigt keine Bilder an
    to figure out whats wrong. We realized that it have to be the permission to write/execute files on the share.


    Any ideas or solution?

  • I told you what to do.


    Edit this file /etc/samba/smb.conf


    Find your media share and edit the directory mask to 0775.
    Then restart samba.


    It is that easy. Then all directories added, via drag and drop or copy/paste, will have 775 chmod, actually they inherit 2775.


    I tested what blublub said. When you created a shared folder with everyone the directory mask is still 755 with SAMBA. This does not fix the
    problem.


    I spend some amount of time yesterday figuring this out and you just ignore what I wrote.... hehe :thumbup:


    PS- On the other thread I even gave you command to fix folders that you already dragged/dropped or copied/pasted.

  • @tekkb
    Sorry if you got that wrong.
    I made your change too, but this was not topic of this thread here. I just wanted to keep it separate.
    This thread is ZFS
    The other thread was about permission in gerneral because it wasn't working on ZFS or regular RAID 5, so lets say that is a SAMBA problem.


    As I said, I made you change in the smb.conf and everythings seems to work as far as I can tell right now. If not, I hope I can ask here again.


    Just to make this clear if I got that correct:: reset the permission just change the folder which are already in the share. Your trick with the smb.conf will change it for the future folder, which are copied? Is ith the same chmod 775/2775?


    Thank you again I really appreciate your help!!!!

Jetzt mitmachen!

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