create NFS share via shell

Status
Not open for further replies.

tincboy

Cadet
Joined
Nov 20, 2013
Messages
7
As FreeNAS has no API interface and I need to add NFS and CIFS shares via code, I'm asking how to create each one of NFS and CIFS share via FreeNAS shell?
I've already create ZFS dataset and pool via shell but I don't know how to share them
Any help will be much appreciated
 

tincboy

Cadet
Joined
Nov 20, 2013
Messages
7
Thanks,
Does FreeNAS 9.2 has any beta release yet?
When we can expect it to be released?
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Do be warned, you should not use anything except releases in production machines or anything you plan to use long-term. Before it hits release the database entries can change(some being added, some being deleted) and plenty of people find out much later when they do a future upgrade that their database is useless for them because they used a non-release version. If you want to test it, feel free to use a nightly. But as soon as you say "I want to use this long term" you'd better wait for the actual -RELEASE. This has bitten quite a few people. It really sucks when you are forced to basically redo your FreeNAS config from scratch.
 

Dusan

Guru
Joined
Jan 29, 2013
Messages
1,165
Oh, it seems the feature is not ready yet.
The other option is then to work with the config DB. It's a SQLite3 DB stored here: /data/freenas-v1.db
For CIFS you needs to add records into table sharing_cifs_share and then regenerate config files and restart relevant services by running:
Code:
service ix-samba quietstart
service samba forcereload
service ix_avahi quietstart
service avahi-daemon reload

The tables for NFS are sharing_nfs_share and sharing_nfs_share_path. To apply the changes run:
Code:
service ix-nfsd quietstart
service ix_avahi quietstart
service avahi-daemon reload
 
Status
Not open for further replies.
Top