Export and Import Share Information
You can export share information to save for reference. You can also edit the exported file's share options, and then — from the master node — import this file to add or modify multiple shares.
Note: For a list of all the Appliance Controller commands, see the Command Index.
StorNext NAS processes share imports as follows:
- If neither the share nor the share directory exist, NAS performs a
share create
for the new share and share directory. - If the share does not exist but the share directory does exist, NAS performs a
share add
for the new share within the existing share directory. - If both the share and share directory already exist, NAS performs a
share change
to the existing share and share directory.
Caution
-
The Appliance Controller manages the smb.conf and /etc/exports files for StorNext NAS. Any edits you make directly to either of these files are lost when you restart the Appliance Controller, or when you make a change using any of the
share
commands. -
When you make a change to an SMB share, its existing connection might be impacted and depending on the SMB client, it is possible to disconnect from that share.
- Log in to the Appliance Controller CLI.
- At the prompt, enter the following:
share export config [nfs | smb] [<filename>]
The parameters are:
[nfs | smb]
(Optional) The type of shares — NFS or SMB — to export. If you do not provide a share type, all shares will be exported, regardless of type.
[<filename>]
(Optional) The file to which the configuration is written. If you do not provide a file name, the configuration is written to /var/shares.config.
Example:
> share export config
# Share export file '/var/shares.config' generated at Thu Jun 9 09:44:39 2016.
# Previous file located at '/var/shares.config.bak'
[global]
type = smb
path =
valid users = sysadmin
socket options = TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=131072 SO_SNDBUF=131072
log level = 3
[myNFSshare066]
type = nfs
path = /stornext/snfs1/share066
rw
sync
nfs_clients = *
[myshare900]
type = smb
path = /stornext/snfs1/share900
writable=yes
public=no
[myshare800]
type = nfs
path = /stornext/snfs1/share800
ro
nfs_clients = *
[myshare042]
type = nfs
path = /stornext/snfs1/share042
anongid=150
anonuid=150
ro
nfs_clients = *
- Log in to the Appliance Controller CLI on the master node:
- At the prompt, enter the following:
share import config [nfs | smb] [<filename>]
The parameters are:
[nfs | smb]
(Optional) The type of shares — NFS or SMB — to import. If you do not provide a share type, all shares will be imported, regardless of type.
[<filename>]
(Optional) The file from which the configuration is imported If you do not provide a file name, the configuration is read from /var/shares.config.
Example:
> share import config smb
Skipping import for share 'myshare800'
Skipping import for share 'myshare42'
Skipping import for share 'myshare600'
Skipping import for share 'nfsshare22'
Skipping import for share 'myNshare66'
Skipping import for share 'myshare1000'
Skipping import for share 'myshare1500'
Importing share 'myshare55' ...
Importing share 'myshare1100' ...
Importing share 'global' ...
Importing share 'myshare' ...
Importing share 'myshare900' ...
Importing share 'myshare1' ...
Importing share 'myshare1200' ...
Importing share 'myshare2' ...
Share configuration '/var/shares.config' successfully imported
In the above example, only SMB shares are being imported. The Skipping import for share...
lines refer to NFS shares that are not being imported:
Imported File Format
[NAME of SHARE]
type=[smb|nfs]
path=/full path to stornext folder/
type specific options
option
…
[NFS1]
type = nfs
path = /stornext/share/NFS1
rw
sync
fsid=8000
nfs_clients = 1.1.1.1 2.2.2.2
[NFS2]
type = nfs
path = /stornext/share/NFS2
ro
sync
nfs_clients = 2.2.2.2
[SMB1]
type = smb
path = /stornext/share/SMB1
public = no
writable = yes