Friday, January 16, 2009

Mount Solaris to Linux (NFS)

In Solaris (the NFS server):
- Edit file /etc/dfs/dfstab, add line like this (refer to 'man share' for more options):
share -F nfs /sourcedir
- Edit file /etc/dfs/sharetab, add line like this:
/sourcedir - nfs rw
- Restart NFS server after adding entry to the file:
/etc/init.d/nfs.server stop
/etc/init.d/nfs.server start
(or, in another reference: svcadm restart nfs/server)
- Verify the updated NFS share by running dfshares or exportfs (both files are located in /usr/sbin)

In Linux (the NFS client):
- Create the mount point:
mkdir /targetdir
- Mount the shared directory in NFS server:
mount -t nfs sunserver:/sourcedir /targetdir
- Check now if you can access the mounted directory:
cd /targetdir
- To automatically mount the shared directory every time the server starts, add the following line to /etc/vfstab:
sunserver:/sourcedir — /targetdir nfs — yes — ro
- Either reboot the system, or run mountall (it reads the /etc/vfstab file and mounts all)

Source:
http://nfs.sourceforge.net/nfs-howto/ar01s08.html
http://www.linuxselfhelp.com/HOWTO/NFS-HOWTO/interop.html

http://sharetab.com/solaris-setting-up-nfs-network-file-sharing-server/

Other:
To mount from a Linux server to Solaris client, check this: http://blogs.sun.com/macrbg/entry/solaris_nfsv4_client_mount_from

No comments:

Post a Comment