Mount an SFS on a node over the Network File System (NFS), and use it like any other folder there. Every node you mount it on sees the same files. Follow the section for your node’s system: Linux or Windows Server.
Before you begin
Section titled “Before you begin”- The SFS reads Available.
- Your node is attached to the SFS’s VPC, so its private IP is in the same range as the SFS’s Endpoint. See Attach a node to a VPC.
- Your node has access to the SFS. Every new SFS needs this step; see Grant a VPC access to an SFS or Configure per-node access to an SFS.
- You have the SFS’s Endpoint, from its Info tab.
Mount it on Linux
Section titled “Mount it on Linux”Run these commands on the node as root, or put sudo in front of each.
Install the NFS client
Section titled “Install the NFS client”On RHEL or CentOS:
yum install nfs-utilsOn Ubuntu or Debian, refresh the package list first:
apt updateapt install nfs-commonMount the SFS
Section titled “Mount the SFS”Create a folder for the SFS, then mount the SFS there:
mkdir -p /mnt/sfsmount -t nfs -o soft,timeo=600,retrans=2,retry=2 <endpoint>:/data /mnt/sfsReplace <endpoint> with the SFS’s Endpoint. /mnt/sfs is the folder the SFS appears in,
and you can name it anything you like. Use this command rather than the Mount Command on the
Info tab: this one has the option values filled in.
What the mount options do
Section titled “What the mount options do”- soft makes the node return an error when the SFS is briefly out of reach, so your programs keep responding.
- timeo=600 is how long the node waits for a reply, in tenths of a second: 600 is 60 seconds.
- retrans=2 is how many times the node resends a request before it reports an error.
- retry=2 is how many minutes the mount command keeps trying to connect.
Check that the SFS is mounted
Section titled “Check that the SFS is mounted”Run df -h /mnt/sfs. When the SFS is mounted, the first column reads <endpoint>:/data.
Everything you save in /mnt/sfs now lives on the SFS. The mount uses NFS version 4.2; SFS also
serves version 3: for a client that needs it, add vers=3 to the mount options.
New files on the SFS are owned by root, whichever user on the node creates them. To give a file
to another user, change its owner with chown after you create it.
If the mount reports access denied by server, give your node access; see
Troubleshooting SFS. If
the mount command waits and prints nothing, see
Troubleshooting SFS.
Mount it again after a restart
Section titled “Mount it again after a restart”A mount lasts until the node restarts. To mount the SFS again at every start, add this line to
/etc/fstab on the node:
<endpoint>:/data /mnt/sfs nfs soft,timeo=600,retrans=2,retry=2,_netdev 0 0The last option in the line tells the node to wait for its network before it mounts the SFS. To
try the line now, run mount -a, then check with df -h /mnt/sfs.
Unmount it
Section titled “Unmount it”To stop using the SFS on this node, leave the /mnt/sfs folder in your terminal and run
umount /mnt/sfs. The files stay on the SFS, ready for the next mount. If you added the line to
/etc/fstab, remove it too.
Mount it on Windows Server
Section titled “Mount it on Windows Server”Install Client for NFS
Section titled “Install Client for NFS”In PowerShell as Administrator, install Client for NFS. It is ready as soon as the install finishes.
Install-WindowsFeature NFS-ClientMount the SFS as a drive
Section titled “Mount the SFS as a drive”In a Command Prompt, mount the SFS as a drive letter, here Z::
mount -o anon <endpoint>:/data Z:Replace <endpoint> with the SFS’s Endpoint. Windows confirms that Z: is connected, and the
SFS’s files are in Z:\. The drive lasts for the session you signed in with; mount it again in a
new session. To unmount it, run umount Z:.
Your SFS is ready to use on this node. To use it from more nodes, give each one access and mount it the same way.