Montar storage nfs e compartilhamentos Windows no Linux

Setting Up the NFS Client
________________________________________
Step One—Download the Required Software
________________________________________
Start off by using apt-get to install the nfs programs.
yum install nfs-utils nfs-utils-lib

Step Two—Mount the Directories
________________________________________
Once the programs have been downloaded to the the client server, create the directory that will contain the NFS shared files
mkdir -p /mnt/nfs/home

Then go ahead and mount it
mount 12.34.56.789:/home /mnt/nfs/home

You can use the df -h command to check that the directory has been mounted. You will see it last on the list.
df -h

Filesystem Size Used Avail Use% Mounted on
/dev/sda 20G 783M 18G 5% /
12.34.56.789:/home 20G 785M 18G 5% /mnt/nfs/home

Additionally, use the mount command to see the entire list of mounted file systems.
mount

Your list should look something like this:
/dev/sda on / type ext4 (rw,errors=remount-ro)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
nfsd on /proc/fs/nfsd type nfsd (rw)
12.34.56.789:/home on /mnt/nfs/home type nfs (rw,noatime,nolock,bg,nfsvers=2,intr,tcp,actimeo=1800,addr=12.34.56.789)

Once you have successfully mounted your NFS directory, you can test that it works by creating a file on the Client and checking its availability on the Server.

Create a file in the directory to try it out:
touch /mnt/nfs/home/example

You should then be able to find the files on the Server in the /home.
ls /home

You can ensure that the mount is always active by adding the directory to the fstab file on the client. This will ensure that the mount starts up after the server reboots.
vi /etc/fstab

12.34.56.789:/home /mnt/nfs/home nfs auto,noatime,nolock,bg,nfsvers=3,intr,tcp,actimeo=1800 0 0

You can learn more about the fstab options by typing in:
man nfs

After any subsequent server reboots, you can use a single command to mount directories specified in the fstab file:
mount -a

You can check the mounted directories with the two earlier commands:
df -h
mount

192.168.218.10:/nfs/backup /mnt/storage nfs auto,noatime,nolock,bg,nfsvers=3,intr,tcp,actimeo=1800 0 0
\\192.168.218.203\www /mnt/hmg cifs auto,user=backup,password=back,domain=teste 0 0
\\192.168.218.181\www /mnt/webserver cifs auto,user=backup,password=back,domain=teste 0 0
\\192.168.218.186\Manager /mnt/Manager cifs auto,user=backup,password=back,domain=teste 0 0
\\192.168.218.186\TOP /mnt/biometria cifs auto,user=backup,password=back,domain=teste 0 0
\\192.168.218.186\bilhetes /mnt/bilhete cifs auto,user=backup,password=back,domain=teste 0 0

Deixe um comentário