Using 'mount' to create a Symbolic Link instead of using the 'ln -s' command.

Category: Software and Systems Engineering
Author: Sean O'Donnell
Thu, May. 29th, 2008 @ 17:29:10 (MDT)

OK, it's not actually a symbolic link, but it is effectively the same. I'll re-title this entry when I have more time.

Recently, I was configuring an anonymous FTP server for the purpose of distributing large DVD installation disks. I'm using vsftpd on RHEL4, but realized that vsftpd doesn't support symbolic links, or at least, not symlinks with adequate permissions.

An interesting way to work-around this issue, is to use 'mount --bind' (rather than 'ln -s') to create a link to the file or directory.

mount /path/src /path/dest --bind --ro

The command above will create a read-only mount-point.

/etc/fstab

In order to make the mount-point active automatically when the computer is restarted, you'll need to add the following line to your '/etc/fstab' file.

/path/src        /path/dest         auto    ro,bind        0       0

You'll need to replace the file paths with that of your own.

Copyleft (<) 1998-2019 www.seanodonnell.com