Emergency UNIX and Linux Support

Please post your urgent questions here for highest visibility. Posting a new thread to this forum requires Bits. We monitor this forum to help people with emergencies, but we do not guarantee response time or answers. This forum is "best effort" only. Members who reply to posts here receive a bonus of 1000 Bits per reply.

Help with autos and mount bind


👤 Login to reply

    #1  
Old 10-01-2014
maverick_here maverick_here is offline
Registered User
 
Join Date: May 2009
Last Activity: 30 October 2014, 10:43 PM EDT
Location: Hyderabad
Posts: 132
Thanks: 0
Thanked 6 Times in 5 Posts
RedHat Help with autos and mount bind

I have a sftp server running on Centos 5.10. It servers as upload/download interface for three users who basically are chrooted to three different locations.
Code:
User A -- >  /home/REGIONA/

User B -- > /home/REGIONB/

User C -- > /home/REGIONC/

The users run certain application procedures on app servers and on the app servers the code uploads data to the sftp server, there are three app servers for three users

Say
Code:
APP server A

APP server B

App server C

I have setup the autofs mounts on the Apps servers, where the application code upon completion will go to the mount point and dump the data


example


Code:
/sftp/REGIONA/upload   --> from APP server A

/sftp/REGIONB/upload   --> from APP server B

/sftp/REGIONC/upload  --> from APP server C

Everything works fine.


Now coming to the issue, I have a requirement of making the "UPLOAD" region common across all the three app servers so what i did was


mkdir /opt/upload

Code:
mount -o bind,rw /opt/upload /home/REGIONA/upload

mount -o bind,rw /opt/upload /home/REGIONB/upload

mount -o bind,rw /opt/upload /home/REGIONC/upload

Now, this works OK if i upload data from filezilla/winscp


However from the App servers which do a autofs mount of the remote ( sftp ) servers filesystems , they are not recognizing upload to be a bound mount.When I upload data
programmatically from the app servers the data si not visible


for example

From APP server A I run the script / application code

I does not show up on /home/REGIONA/upload

and when I umount /home/REGIONA/upload, it shows up.


I figure its an issue with autofs recognizing an underlying mount binded sub directory on the remote filesystem.

Any ideas ?
Sponsored Links
    #2  
Old 10-01-2014
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
 
Join Date: Feb 2004
Last Activity: 21 July 2018, 1:18 PM EDT
Location: NM
Posts: 11,441
Thanks: 638
Thanked 1,176 Times in 1,082 Posts
Assuming I understand - in general filesystems (and the kernel) do not play well when mounted natively read/write at more than one point on separate kernels.

Our answer:
The solution we have is to create one "regular" mount, share the disk, and then mount the device as a foreign nfs filesystem on the other two systems. In our case we have one disk device nfs mounted at 9 locations.
Sponsored Links
    #3  
Old 10-01-2014
achenle achenle is offline Forum Advisor  
Registered User
 
Join Date: Jun 2009
Last Activity: 25 June 2018, 8:15 AM EDT
Posts: 1,015
Thanks: 3
Thanked 156 Times in 148 Posts
What is the output from "mount" on all the servers?

Last edited by achenle; 10-01-2014 at 11:06 AM..
    #4  
Old 10-01-2014
maverick_here maverick_here is offline
Registered User
 
Join Date: May 2009
Last Activity: 30 October 2014, 10:43 PM EDT
Location: Hyderabad
Posts: 132
Thanks: 0
Thanked 6 Times in 5 Posts
The output of mount

The output of mount if we are looking for the it on the APP server is as follows


Code:
foo.bar.com:/home/REGION1 on /sftp/msysftp01-REGION1 type nfs (rw,soft,intr,rsize=32768,wsize=32768,addr=XX.XX.XX.XX)

It is doing an auto mount of /sftp/msysftp01-REGION1, however I have a mount --bind mount under the /sftp/msysftp01-REGION1 which is not behaving a seperate entity and when data upload happens to that region, its not visible. I have to un mount the mount bind mount for it to be visible.

So in a nutshell autofs does not recognize the remote underlying subdirectory to be mount binded.
Sponsored Links
    #5  
Old 10-03-2014
maverick_here maverick_here is offline
Registered User
 
Join Date: May 2009
Last Activity: 30 October 2014, 10:43 PM EDT
Location: Hyderabad
Posts: 132
Thanks: 0
Thanked 6 Times in 5 Posts
Got it working

Hello,

I have it working now, I will document the whole procedure of what I did. I had to fiddle with the nfs options from the SFTP servers.

I basically shared with following options

Code:
/home/REGIONA/    (rw,wdelay,root_squash,nohide,crossmnt)
/home/REGIONB/  (rw,wdelay,root_squash,nohide,crossmnt)
 /home/REGIONC/ (rw,wdelay,root_squash,nohide,crossmnt)

and also

Code:
/home/REGIONA/upload (rw,wdelay,root_squash,nohide)
/home/REGIONB/upload (rw,wdelay,root_squash,nohide)
 /home/REGIONC/upload (rw,wdelay,root_squash,nohide)

Now from the sftp server if i check all the three directories
Code:
[root@XXXXX~]# ls -lrt /opt/upload/ /home/REGIONA/upload /home/REGIONB/upload/ /home/REGIONC/upload
/opt/upload/:
total 144
-rw-rw---- 1 nfsnobody root 23893 Oct  3 21:28 acme01.log.3
-rw-rw---- 1 nfsnobody root 23893 Oct  3 21:28 acme01.log.2
-rw-rw---- 1 nfsnobody root 23893 Oct  3 21:28 acme01.log.1
-rw-rw---- 1 nfsnobody root 23893 Oct  3 21:28 acme02.log.3
-rw-rw---- 1 nfsnobody root 23893 Oct  3 21:28 acme02.log.2
-rw-rw---- 1 nfsnobody root 23893 Oct  3 21:28 acme02.log.1

/home/REGIONA/upload/:
total 144
-rw-rw---- 1 nfsnobody root 23893 Oct  3 21:28 acme01.log.3
-rw-rw---- 1 nfsnobody root 23893 Oct  3 21:28 acme01.log.2
-rw-rw---- 1 nfsnobody root 23893 Oct  3 21:28 acme01.log.1
-rw-rw---- 1 nfsnobody root 23893 Oct  3 21:28 acme02.log.3
-rw-rw---- 1 nfsnobody root 23893 Oct  3 21:28 acme02.log.2
-rw-rw---- 1 nfsnobody root 23893 Oct  3 21:28 acme02.log.1

/home/REGIONB/upload:
total 144
-rw-rw---- 1 nfsnobody root 23893 Oct  3 21:28 acme01.log.3
-rw-rw---- 1 nfsnobody root 23893 Oct  3 21:28 acme01.log.2
-rw-rw---- 1 nfsnobody root 23893 Oct  3 21:28 acme01.log.1
-rw-rw---- 1 nfsnobody root 23893 Oct  3 21:28 acme02.log.3
-rw-rw---- 1 nfsnobody root 23893 Oct  3 21:28 acme02.log.2
-rw-rw---- 1 nfsnobody root 23893 Oct  3 21:28 acme02.log.1

/home/REGIONC/upload:
total 144
-rw-rw---- 1 nfsnobody root 23893 Oct  3 21:28 acme01.log.3
-rw-rw---- 1 nfsnobody root 23893 Oct  3 21:28 acme01.log.2
-rw-rw---- 1 nfsnobody root 23893 Oct  3 21:28 acme01.log.1
-rw-rw---- 1 nfsnobody root 23893 Oct  3 21:28 acme02.log.3
-rw-rw---- 1 nfsnobody root 23893 Oct  3 21:28 acme02.log.2
-rw-rw---- 1 nfsnobody root 23893 Oct  3 21:28 acme02.log.1

And if upload to any of the APP servers to the upload directory it is consistent across.

The issue is now resolved

Last edited by maverick_here; 10-04-2014 at 12:59 AM.. Reason: I have found few typos in my post
Sponsored Links
👤 Login to reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Linux Bind mount issues. Naveen.6025 Red Hat 1 07-02-2014 03:01 PM
mount --bind programAngel UNIX for Dummies Questions & Answers 1 09-24-2011 12:38 PM
mount -t cifs permission denied by mount -t smbfs works fine humbletech99 UNIX for Advanced & Expert Users 3 09-07-2009 05:02 PM
how to mount a hotswap scsi drive on a solaris 2.6 netra box using the mount command? soulshaker UNIX for Dummies Questions & Answers 4 07-18-2001 01:11 PM



All times are GMT -4. The time now is 07:20 PM.

Unix & Linux Forums Content Copyrightę1993-2018. All Rights Reserved.
×
UNIX.COM Login
Username:
Password:  
Show Password





Not a Forum Member?
Forgot Password?