Hi guys,
Tonight I thought i'd finally work out how to correctly set up a NFS share on my FreeBSD server so I could use the NAS hdd function in the Hikvision interface. This isn't comprehensive guide but it worked for me.
This is done under FreeBSD 10.2, using ZFS as my main drive setup and whatever version of NFS comes with FreeBSD.
In your /etc/rc.conf, add these lines:
My ZFS pool is called storage, it doesn't really matter what it's called, though:
Create the cameras sub pool:
If you want to change the zfs mount point for whatever reason, use:
I stuck with /storage/cameras
Set the quota that you want that sub pool to have, I've used 400gb as an example:
Verify the quota worked if you like:
I have ZFS snapshot directorys turned on by default, you will NEED to turn these off or the initialization of the drive in the Hikvision GUI will fail. Use this command to turn it off:
Now you need to edit /etc/exports which how NFS knows what you want to export to clients, I used this syntax in it, yours may vary:
Issue these 2 commands to restart nfsd and mountd:
Then go into your hikvision NVR (I guess this would work for the newer cameras, too) then goto: Storage\Storage Management \Net HDD
Server address would be the IP of your server, mine is 192.168.1.1 so I input that there.
File path is the mount point you chose when setting up the NFS share previously, mine is /storage/cameras
Type is NAS
Make sure to click Save
Then go back to HDD Management
The drive may take a minute or two to come online, You will need to initialize it, same as a physical hard drive.
Click the left check box by your NAS hdd you have just added and click on the drive then click format.
THE ZFS DIRECTORY MUST BE EMPTY OR IT WILL FAIL! (Device Error) This is why you hide the zfs snap dir.
This may not be the best way to do this but it works for me.
Cheers.
Tonight I thought i'd finally work out how to correctly set up a NFS share on my FreeBSD server so I could use the NAS hdd function in the Hikvision interface. This isn't comprehensive guide but it worked for me.
This is done under FreeBSD 10.2, using ZFS as my main drive setup and whatever version of NFS comes with FreeBSD.
In your /etc/rc.conf, add these lines:
Code:
rpcbind_enable="YES"
nfs_server_enable="YES"
mountd_enable="YES"
mountd_flags="-r"
My ZFS pool is called storage, it doesn't really matter what it's called, though:
Code:
df -h /storage
Filesystem Size Used Avail Capacity Mounted on
storage 7.0T 5.9T 1.1T 84% /storage
Code:
zfs create storage/cameras
Code:
zfs set mountpoint=/new/path/you/want storage/cameras
Set the quota that you want that sub pool to have, I've used 400gb as an example:
Code:
zfs set quota=400G storage/cameras
Code:
df -h /storage/cameras
Filesystem Size Used Avail Capacity Mounted on
storage/cameras 400G 154K 400G 0% /storage/cameras
Code:
zfs set snapdir=hidden storage/cameras
Now you need to edit /etc/exports which how NFS knows what you want to export to clients, I used this syntax in it, yours may vary:
Code:
/storage/cameras -network=192.168.1.0/24 -maproot=root
Code:
service nfsd restart
service mountd restart
Then go into your hikvision NVR (I guess this would work for the newer cameras, too) then goto: Storage\Storage Management \Net HDD
Server address would be the IP of your server, mine is 192.168.1.1 so I input that there.
File path is the mount point you chose when setting up the NFS share previously, mine is /storage/cameras
Type is NAS
Make sure to click Save
Then go back to HDD Management
The drive may take a minute or two to come online, You will need to initialize it, same as a physical hard drive.
Click the left check box by your NAS hdd you have just added and click on the drive then click format.
THE ZFS DIRECTORY MUST BE EMPTY OR IT WILL FAIL! (Device Error) This is why you hide the zfs snap dir.
This may not be the best way to do this but it works for me.
Cheers.