LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   fstab and automounting permanent symlinks (https://www.linuxquestions.org/questions/linux-newbie-8/fstab-and-automounting-permanent-symlinks-720789/)

vertigo12369 04-21-2009 09:09 PM

fstab and automounting permanent symlinks
 
I'm running a proftpd server (on Ubuntu 8.04 server) with user accounts chrooted to their home directories. I have a share directory that I want all users to access. So in order to get out of chroot jail I need to set up a symlink like so...

Code:

mount --bind /share /home/john/share
This works until I reboot the server. I want to make this symlink permanent which from what I understand requires an entry in the fstab file.

So the question is how do I automount a symlink?

Code:

/dev/hdb1  /home        ext2          defaults  1 2
Would mount the hard disk /dev/hdb1 to the /home directory. Would I want
Code:

/share  /home/john/share  auto  rw,auto,user,sync  0 0
? To mount my /share directory inside my chrooted /home/john/share?

All of the examples I have found are for automounting hardware not directories on existing hardware.

Thanks!

i92guboj 04-22-2009 01:48 PM

I haven't actually tested this but there's no reason why this wouldn't work, just add the bind option there.

Code:

/dir1 /dir2 none bind 0 0
I am not sure if the fs would be ok as none or if it would require the real fs or auto, whatever.

But you could also just mount the real device many times. I usually do things like these on desktop boxes with /tmp and /var/tmp

Code:

/dev/sdb9 /tmp ext2 noatime 0 1
/dev/sdb9 /var/tmp ext2 noatime 0 1


vertigo12369 04-23-2009 12:00 PM

Awesome!

Everything works now. Thanks for your input!


All times are GMT -5. The time now is 04:16 AM.