My plan is to share a secondary drive installed in my PC to other computers using NFS protocol. I am using a 260 GB drive that is connected to the SATA port inside the computer. First we need to make sure that the drive is formatted properly and ZFS pool is set right.
You might want to take a look at the other ZFS references on our site before continuing.
My information: 2.5" Hitachi drive, capacity 260GB RAW, Drive ID = "c6d0"
Setup my pool called "laptop" (running as root)
Then we need a few folders on the drive just to make things nice. I am going to call it "freebie"
zpool create laptop c6d0
Now for some NFS magic
zfs create laptop/freebie
Verify that the NFS share point is set properly
zfs set sharenfs=on laptop/freebie
Set the permissions for the folder so people can read and write to it. There are normal NIX commands
zfs get sharenfs laptop/freebie
Also I want to locally go into the folder to modify the information through the GUI
chmod 1777 /laptop/freebie
Now you can test this by connecting. I am going to use a Mac for connecting, here is the command:
zfs allow -u arthur create,mount laptop/freebie
I dropped a few files and it transferred over to the folder. They were 616KB, 1.7MB, and 120KB, this is important for the next example which is to enable compression which I am going to turn on. If you don't want any compression then you can stop this demo.
Enabling compression is quite easy but I am not sure if existing files will compress but any new files will compress as they are added and removed. Enable Compression
zfs set compression=on laptop/freebie
So I now the files are 608KB, 1.4MB, 38KB respectively, going to test larger files next. That is it for this demo. I have some other projects to work on including now setting up SMB to this folder as well or another folder.
zfs set compression=off laptop/freebie