Sponsored Content
Full Discussion: Script for NFS mount point
Top Forums Shell Programming and Scripting Script for NFS mount point Post 302855195 by Rahulne25 on Thursday 19th of September 2013 10:24:16 AM
Old 09-19-2013
Thanks it working, but while mounting the share path in client machine if i have 2 share path in server how do i mount that 2 share path in client.

i have highlited some points in my script please help me how to resolve that...
Code:
while :
do
echo " enter the mount point name (empty to quit)"
read e
[ -z "$e" ] && break
echo "$e *(rw,sync,no_root_squash)" >>/etc/exports
done
service nfs restart
exportfs -r
exportfs -v
chkconfig nfs on
------------(Note: This is client server ip address)--------------------------
echo "enter the destserverip"
read a
-----------------------------------------------
#(Note:here i wants to enter source server ip address and mount point problem here is if i provide 2 share path 
how do i add that here)
----------------------------------------------------------------
echo "enter src serverip and mount point"
read b c
----------------------------------------------------------------------
(note this point us i want to create the mount point in client server if i have 2 share path how do i create the directoryor )
----------------------------------------------------------------------
 
echo "1. Do you wants to create the mount point[yes/no]?"
read n
yes=$(echo $n | tr -s '[:upper:]' '[:lower:]')
if [[ "$n" = "yes" ]]; then
-----------------------------------------------------------------------
(Note: if mount point is already created in client server how do i mention that 2 mount point details here)
-----------------------------------------------------------------------
echo "enter the dir name to create mount point"
read f
ssh -p 22 -l root $a mkdir $f
echo " enter the root password"
ssh -p 22 -l root $a mount -t nfs $b:$c $f
else
echo "enter the destmount point ensure the mount point is created"
read d
#ssh -p 22 -l root $a mkdir $f
echo " enter the root password"
ssh -p 22 -l root $a mount -t nfs $b:$c $d
fi


Last edited by vbe; 09-19-2013 at 11:31 AM.. Reason: code tags again....
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to change the file modification time of a file on nfs mount point

Hi I am accessing a file on nfs mounted device, after completing using of the file, i am tring to restore the access time and modification times of the file. So i got the previous modified time of the file using stat() function and trying to set the date and time for the file, To set these... (6 Replies)
Discussion started by: deepthi.s
6 Replies

2. Linux

one nfs mount point for many logical volumes

hi i am wondering if it is possible to use one nfs mount point for several logical volumes. i have a top level directory /imaging with data1 - data50 below it. each dataX directory is a logical volume configured through LVM. if i mount them separately on the client (i.e. 50 lines in fstab... (1 Reply)
Discussion started by: user23
1 Replies

3. AIX

NFS mount point monitoring script

Hi, I'm looking to create a NFS mount point monitoring shell script not sure if im going the right way about it so could do with some help. What i was thinking of doing was using the below command but am unsure how to handle the output. So if the filesyetem is active it will return "1" but if... (4 Replies)
Discussion started by: elmesy
4 Replies

4. Red Hat

NFS mount point problem

Hi Forum I am trying to mount /NFS as nfs mountpoint on two servers ( A & B ). After mounting the nfs filesystem, both of them behave normally for around 10 mins and after that the NFS file handle become stale and the mountpoints dont respond. While executing df -kh, the output hang out and the... (15 Replies)
Discussion started by: rajdasuwal
15 Replies

5. Solaris

No write permission on NFS mount point

hi all i have mounted one nfs mount point but i has no write permission on it. when i am going to make a directory it is giving an error # mkdir 1 mkdir: Failed to make directory "1"; Permission denied i shared using command # share -F nfs -o rw -d "backup" /backup mounted using... (3 Replies)
Discussion started by: nikhil kasar
3 Replies

6. Red Hat

NFS mount point

Hi, Can you tell me something about NFS mount point ? Regards, Maddy (3 Replies)
Discussion started by: Maddy123
3 Replies

7. Red Hat

Regarding NFS mount point

Dear All, We have two different mount points in Linux NFS one is 15 TB and another one is 15 TB. Can we club both of the two mount points and club in to a single volume in Linux. As we need to restore Database in that single volume. Kindly help us on this. Regards , rj (10 Replies)
Discussion started by: jegaraman
10 Replies

8. Shell Programming and Scripting

Mount NFS Share On NFS Client via bash script.

I need a help of good people with effective bash script to mount nfs shared, By the way I did the searches, since i haven't found that someone wrote a script like this in the past, I'm sure it will serve more people. The scenario as follow: An NFS Client with Daily CRON , running bash script... (4 Replies)
Discussion started by: Brian.t
4 Replies

9. Solaris

Sol 10 - Strange NFS behaviour - adminnfs prefix to mount point

Something has changed..... /etc/vfstab entry:- host1:/backup/RMAN - /RMAN nfs - no rw,hard,rsize=32768,wsize=32768,llockBut when I mount it, and run df -k | grep RMANResults are:- host1:/backup/RMAN 54971960832 26752241664 28219719168 49% ... (1 Reply)
Discussion started by: psychocandy
1 Replies

10. UNIX for Beginners Questions & Answers

How to create a new mount point with 600GB and add 350 GBexisting mount point? IN AIX

How to create a new mount point with 600GB and add 350 GBexisting mount point Best if there step that i can follow or execute before i mount or add diskspace IN AIX Thanks (2 Replies)
Discussion started by: Thilagarajan
2 Replies
NFSMOUNT.CONF(5)						File Formats Manual						  NFSMOUNT.CONF(5)

NAME
nfsmount.conf - Configuration file for NFS mounts SYNOPSIS
Configuration file for NFS mounts that allows options to be set globally, per server or per mount point. DESCRIPTION
The configuration file is made up of multiple sections followed by variables associated with that section. A section is defined by a string enclosed by [ and ] branches. Variables are assignment statements that assign values to particular variables using the = operator, as in Proto=Tcp. The variables that can be assigned are exactly the set of NFS specific mount options listed in nfs(5). Sections are broken up into three basic categories: Global options, Server options and Mount Point options. [ NFSMount_Global_Options ] - This statically named section defines all of the global mount options that can be applied to every NFS mount. [ Server "Server_Name" ] - This section defines all the mount options that should be used on mounts to a particular NFS server. The "Server_Name" strings needs to be surrounded by '"' and be an exact match of the server name used in the mount command. [ MountPoint "Mount_Point" ] - This section defines all the mount options that should be used on a particular mount point. The "Mount_Point" string needs to be surrounded by '"' and be an exact match of the mount point used in the mount command. EXAMPLES
These are some example lines of how sections and variables are defined in the configuration file. [ NFSMount_Global_Options ] Proto=Tcp The TCP/IPv4 protocol will be used on every NFS mount. [ Server "nfsserver.foo.com" ] rsize=32k wsize=32k proto=udp6 A 32k (32768 bytes) block size will be used as the read and write size on all mounts to the 'nfsserver.foo.com' server. UDP/IPv6 is the protocol to be used. [ MountPoint "/export/home" ] Background=True All mounts to the '/export/home' export will be performed in the background (i.e. done asynchronously). FILES
/etc/nfsmount.conf Default NFS mount configuration file SEE ALSO
nfs(5), mount(8), 9 October 2012 NFSMOUNT.CONF(5)
All times are GMT -4. The time now is 10:55 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy