How can I share FolderA on ServerA so that my client can simply access it as ServerA:/FolderA if FolderA is not in / ?
Lets say FolderA is actually
/usr/local/test/RandomName
I can use bind in fstab to shorten it and put it in /export
/usr/local/test/RandomName /export/FolderA none bind 0 0
So now, I can mount it as
mount -t nfs ServerA:/export/FolderA /media/folderA
What I really want is
mount -t nfs ServerA:/FolderA /media/folderA
The server is Ubuntu 10.04 and the clients will include Macs and Linux machines
You have to set the base directory in your NFS exports. To do that and make
/export
the base directory you should open the fileand enter the following in the first line:
With the option fsid=0 (or fsid=root) set you won't call the full path on the client side and then the command
just will work as you will.
exports(5) Man page /etc/exports configuration - Red Hat
I'm not sure if you can do that using bind in your server's fstab. but I do know you can do this:
Configure your /etc/exports file to export /FolderA and you should be good.
The sole
fsid=0
didn't work for me.nfs-utils
>=2.4.1 gotAdd the "[exports] rootdir" option to nfs.conf
feature (May 28, 2019):Something like this should work:
Note: I couldn't make exporting
/
root path work but exporting through a subdirectory did it.Target dir bound to
/export/nfs/FolderA
./etc/nfs.conf
:/etc/exports
:Access it
nfs://server_name/nfs/FolderA
Open following file on NFS server:
and enter following details to it:
Then login NFS client and do mount as follows:
Fstab entry:
Note: