Build the nfsv4 virtual fs mount points
mkdir -p /opt/fog/data/capture
mkdir -p /opt/fog/data/images
(optional) Provide the same ./postinitscript files for both capture and deploy.
mkdir -p /images/dev/postinitscripts
mkdir -p /images/postinitscripts
Edit the /etc/fstab to bind mount the virtual NFSv4 file system to the physical fog directories
/images/dev /opt/fog/data/capture none bind 0 0
/images /opt/fog/data/images none bind 0 0
If you included optional step #2 append this to the end of the /etc/fstab
/images/postinitscripts /images/dev/postinitscripts none bind 0 0
Connect the virtual fs to the physical fs
Now you should be able to run these commands to see if the mount works. Looking at /opt/fog/data/capture should give the same list as /images/dev and looking at /opt/fog/data/images should give the same list as /images. If that is valid then move on to the next step.
Now we need to get the gid and uid of the fog service account fogproject.
5.1 Run the following command to get fogproject’s uid: grep fogproject /etc/passwd | cut -d ":" -f3 note this value. It will most likely be 1000 or 1001 but could be anything, it depends on the host OS.
5.2 Run the following command to get fogproject's gid: grep fogproject /etc/passwd | cut -d ":" -f4 note this value. It will most likely be 1000 or 1001. You will need the uid and gid values in the next step.
Edit the /etc/exports file. In this case we are converting FOG to only operate in NFSv4 mode. So we will remove all of the FOG NFSv3 export lines and replace them with the NFSv4 export lines. Insert the following into the /etc/exports file.
Be sure to update the anonuid= and anongid= values above to match the values of the uid and gid you collected in the previous step.
The last step is FOG server linux OS dependant. We will need to enable NFSv4 and disable all other NFSvX support. For Debian variants you need to do this:
7.1 Edit /etc/default/nfs-common and make these adujustments
7.2 Edit /etc/default/nfs-kernel-server Note that RPCNFSDOPTS is typically not included by default. Please add that option if it is not present.