Jump to content
XPEnology Community

I've got ZFS working for those interested . . .


erocm123

Recommended Posts

Warning: This seems to be working well, but is in it's very early stages. Play with it at your own risk.

 

So I have gotten zfs compiled and working on nanoboot 5.0.3.1 with DSM 5.0-4493. It wasn't pretty getting it going, but it seems like the functionality that I want is there. Compression, snapshots, clones, replication, etc. I haven't had too much time to mess with it but performance seems pretty good.

 

I am a Linux Admin, but I mostly work with Redhat / CentOS and this is actually the first time that I have cross-compiled. In that sense I am a newb so there are probably much better ways to do what I have done. If so, please let me know. I've compiled from source in the past, but this was a little different. I'm so used to YUM or other package managers . . . :grin:

 

Anyway, there is one small hurdle that I am trying to overcome. It seems that the Synology implementation of Samba does something a little tricky that the Kernel / ZFS don't like. Perhaps it is related to ACLs. When I initiate a copy from Windows, Windows believes there is no room on the volume and in dmesg I see:

 

[ 1534.802643] write_begin() or write_end() is not implemented

 

When I use the samba2 package from ipkg the Samba shares work just fine.

 

If you want to give it a shot, here are the files and instructions. As I haven't tested much, I don't recommend using in production:

 

Unpack and load the kernel modules (change the commands to where you have unpacked the modules):

insmod /opt/lib/modules/3.2.40/spl.ko
insmod /opt/lib/modules/3.2.40/splat.ko
insmod /opt/lib/modules/3.2.40/zavl.ko
insmod /opt/lib/modules/3.2.40/znvpair.ko
insmod /opt/lib/modules/3.2.40/zunicode.ko
insmod /opt/lib/modules/3.2.40/zcommon.ko
insmod /opt/lib/modules/3.2.40/zfs.ko
insmod /opt/lib/modules/3.2.40/zpios.ko

 

Library files need to go into /lib64/

 

DSM5> tar -zxf libuuid.so.1.3.0.tar.gz
DSM5> chmod 755 libuuid.so.1.3.0; cp libuuid.so.1.3.0 /lib64/; rm /lib64/libuuid.so; rm /lib64/libuuid.so.1; ln -s /lib64/libuuid.so.1.3.0 /lib64/libuuid.
so; ln -s  /lib64/libuuid.so.1.3.0 /lib64/libuuid.so.1

 

DSM5> tar -zxf libz.so.1.2.8-x64.tar.gz
DSM5> cp -p libz.so.1.2.8 /lib64/; ln -s /lib64/libz.so.1.2.8 /lib64/libz.so; ln -s /lib64/libz.so.1.2.8 /lib64/libz.so.1

 

Install the deb packages with dpkg. I was lazy and sick of messing around with things so I just did a:

DSM5> dpkg -i --force-all *.deb

 

Since I didn't have udevadm I had to create the zfs device pointer manually:

DSM5> cat /sys/class/misc/zfs/dev
10:57
DSM5> mknod /dev/zfs c 10 57

 

At this point zfs and zpool commands should work.

zpool create tank /dev/sdXX <---- change this to the device you want to use. 

 

Create dataset

zfs create tank/data

 

Turn on compression:

zfs set compression=on tank/data

 

These should mount automatically, but you can change the mount type to "legacy" and mount them with fstab or manually.

 

zfs set mountpoint=legacy tank/data
mount -t zfs -o usrjquota=aquota.user,grpjquota=aquota.group,jqfmt=vfsv0,synoacl,defaults,atime,dev,exec,rw,suid,xattr,nomand,zfsutil,usrjquota=aquota.user,grpjquota=aquota.group,jqfmt=vfsv0,synoacl tank/data /volume1/zfs/data

 

Take a snapshot

zfs snapshot tank/data@snapshot0821

 

I'm out of time for now. Will post more later.

 

Link:

https://drive.google.com/file/d/0B_7bVXd64Md1Q054Qy1FWVd4bEU/edit?usp=sharing

Link to comment
Share on other sites

wow...interesting...good stuff even getting this to partially work!

 

What type of system specs are you running...I ask as some of the functions are pretty cpu/memory intensive which is why freenas has higher system requirements to run as compared to synology.

Link to comment
Share on other sites

I currently have it running as an ESXi VM on top of a Gen 8 HP Microserver. The Microserver has been modified to have a Intel Xeon CPU E3-1230 V2 3.30GHz.

 

I've given the VM 4GB of RAM and 4 CPU Cores.

 

I have FreeNAS running alongside this on the same hardware with the same specs (4GB RAM 4 CPU cores) and performance has been really good with it. I'll have to see how the SynologyZFS setup compares. I don't use dedupe in my home lab as it requires more resources, but I do use compression. I've used dedupe out in the workforce but it has been on multi controller SANS with lots of RAM.

Link to comment
Share on other sites

Thanks for the mirror. I am still trying to figure out Samba. NFS works fine, but I am still having problems with the Synology compiled Samba. Not sure what is going on. As mentioned before, the Samba package that is available via ipkg is working great.

Link to comment
Share on other sites

By the way, here is the init script that I use to automatically load the kernel modules. I borrowed it and modified it from somewhere else:

 

I've got ipkg / bootstrap setup so I put the init script in /opt/etc/init.d/S10modules

 

#!/bin/sh
# Original script has been written by Davy Leggieri (hey another French guy 
# Modified by Charles-Henri Hallard on April 2012 to fit with my configuration
#
# there is start stop var because at stop modules usbserial should be unloaded last
MODULES_DIR="/opt/lib/modules/3.2.40"
MODULES_START="spl.ko splat.ko zavl.ko znvpair.ko zunicode.ko zcommon.ko zfs.ko zpios.ko"
MODULES_STOP="zpios.ko zfs.ko zcommon.ko zunicode.ko znvpair.ko zavl.ko splat.ko spl.ko"

start_modules(){
       echo "--- Load modules ---"
       for i in $MODULES_START; do
               echo "Loading $i"
               insmod $MODULES_DIR/$i
       done

}

stop_modules(){
       echo "--- Unload modules ---"
       for i in $MODULES_STOP; do
               echo "Unloading $i"
               rmmod $MODULES_DIR/$i
       done
}

case "$1" in
start)
       start_modules
       ;;
stop)
       stop_modules
       ;;
*)
       echo "usage: $0 { start | stop }" >&2
       exit 1
       ;;

Link to comment
Share on other sites

Seems like Synology has included a few vfs hooks in their version of Samba. I believe it is one of them that is causing problems:

 

synosmb_vfs_acl_init

synosmb_vfs_indexing_init

synosmb_vfs_stream_init

synosmb_vfs_xattr_init

synosmb_vfs_xferlog_init

 

Troubleshooting their samba modules is a little over my head right now. I've compiled smbd from source (without the modules) and it seems to work fine with the zfs mounts that I have. No indication of any problems from the GUI and shares work how I expect. I have never really gotten into Windows ACLs on Synology so I'm not sure if they are behaving properly.

Link to comment
Share on other sites

Imagine XPenology evolving into a ZFS-equivalent of DSM...and then getting bought out/implemented by Synology :mrgreen:

Seriously, good work. We knew eventually someone was going to buckle up and try this out.

 

Edit: Mirrored your files just to be sure. http://mir.cr/1ECPZWO5

 

 

Geez... Are you a kid to think like this?!?

 

 

Sent from my iPhone using Tapatalk

Link to comment
Share on other sites

Good work mate but I'm a techie and coming from FreeNAS and OVM 2y ago and I never had missed the ZFS.

 

I consider having ZFS on XPEnology is just for geeks. No real advantages and major resources hog.

 

 

Sent from my iPhone using Tapatalk

Link to comment
Share on other sites

Good work mate but I'm a techie and coming from FreeNAS and OVM 2y ago and I never had missed the ZFS.

 

I consider having ZFS on XPEnology is just for geeks. No real advantages and major resources hog.

 

 

Sent from my iPhone using Tapatalk

I was joking, or can't you read?

Link to comment
Share on other sites

×
×
  • Create New...