PDA

View Full Version : Mount --bind at boot?



Ash M
18-01-2005, 05:33 PM
Hey,

Here is my situation

I have a computer running an FTP server on my local WLAN (myself and a friend 700m away)

We have quickly filled up an 80gb HDD, so come payday I'm off to buy a 160/200gb hdd to add to the system.

I have my FTP server (running FC2, soon to be FC3, running VSFTPD)

Have created two non-priveledged ftp only users, both with /home/ftp as their home directory for me & my mate.

I want to mount the new drive (all of it, one massive partition) as /home/ftp/pub2 - so it is still part of their home directory.

Chill showed me how to do this a while back with the mount --bind command.

Any way I can do this at boot? Can I just edit fstab to mount the drive at /home/ftp/pub2 instead? Will this still work okay (i.e will those users be able to access /home/ftp/pub2 as if it were part of their home dir?

Cheers,

Ash

CyberChuck
18-01-2005, 07:09 PM
Yes - you can edit fstab so that the new HDD becomes /home/ftp/pub2.
This will work fine - the only thing you'll have to remember to do is change the owner of the folder (which is mapped to the drive) to the FTP user so it has read/write privilages on the drive (else you'll get all the "Permission Denied" error messages cropping up in your logfiles).

Chilling_Silence
18-01-2005, 07:34 PM
Why not make a user:
useradd ash -m -G users -k /mnt/newhdd/homedir -s /bin/bash

Otherwise you can add the command to /etc/init.d/local
I did the mount --bind because I didnt know about the -k part of useradd, but useradd -k would be ideal.

Search the forum, Ive done a vsftpd setup before too ;)


Chill.

Ash M
18-01-2005, 07:45 PM
Why not make a user:
useradd ash -m -G users -k /mnt/newhdd/homedir -s /bin/bash

Otherwise you can add the command to /etc/init.d/local
I did the mount --bind because I didnt know about the -k part of useradd, but useradd -k would be ideal.

Search the forum, Ive done a vsftpd setup before too ;)


Chill.

What does the -k do differently....? I don't actually need to add a user... I already have 2 pre-made ftp users... So all i want to do is add the new drive as /home/ftp/pub2, so that it appears as part of the already created users home dir (/home/ftp).

Ash

Chilling_Silence
18-01-2005, 08:50 PM
Then do as I said and add it into /etc/init.d/local :)