LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   mount olddir to NewDir (https://www.linuxquestions.org/questions/linux-newbie-8/mount-olddir-to-newdir-913451/)

ahmadirad 11-14-2011 08:37 AM

mount olddir to NewDir
 
Dear all
for some reasons i have to mount a directory into another.for this:

mount --bind /var/www/html/files/download/ /var/www/html/images/download_ric

i want ftp user that just can watch .../imagas/ can view /files/download folder
but i receive this error:mount: mount point /var/www/html/files/download does not exist

please somebody help me.thanks

schneidz 11-14-2011 08:47 AM

^
Code:

mkdir /var/www/html/files/download
mite need to be root.

ahmadirad 11-14-2011 08:52 AM

Dear schneidz
both /var/www/html/files/download and /var/www/html/images/download_ric are created before.

16pide 11-15-2011 03:31 AM

can you post the result of:
Code:

ls -ld /var/www/html/files/download /var/www/html/images/download_ric
strace debug command might be useful to find the root cause of your problem

ahmadirad 11-15-2011 11:00 PM

Dear 16pide
it was my wrong.the old directory is Downloads not Download.


mount --bind /var/www/html/files/downloads /var/www/html/images/download_ric is true.

Thanks

barani_pd 06-05-2013 05:37 AM

Hi,

I have similar question. Regrets if it is addressed elsewhere.

I have few users on my linux server and their home folder lies in /home. I checked after creating these users and ownership was user:user. They all connect through ftp (I have vsftp running on the server) and upload their files in their home folders. There is one special user who has to download these files by logging into ftp. But he should not be able to modify or delete these files, i.e. read only access.

For example let us take user1 the normal User and spuser as Special User with their home directories as /home/user1 & /home/spuser respectively. Their ownership is user1:user1 and spuser:spuser.

To make the requirement possible I used the follwoing:
1. Created a mount point under /home/spuser/ as USER1 using
mkdir /home/spuser/USER1
(The default ownership was spuser:spuser)

2. Then mounted using the following:
mount --bind /home/user1 /home/spuser/USER1
mount -o remount,ro,bind /home/spuser/USER1
But the moment I mount with the first command, the ownership of /home/spuser/USER1 changes to user1:user1 with 700 rights.

Due to the above spuser could not access USER1 and my ftp purpose fails. Can anyone guide where am I committing wrong. Your help is appreciable.

Thanks
Barani


All times are GMT -5. The time now is 09:14 PM.