TIP_Bind_A_Directory_In_FSTAB
| Terminals / Shells • Network • X Window System • Portage • System • Filesystems • Kernel • Other |
Mounting directories
Normally, when using the mount command, you are mounting partitions to a directory on the filesystem. For example, you will mount /dev/hda2 to /home.
You can also mount existing directories on the filesystem to another directory, making the files available in two locations. This can be useful when programs cannot follow symlinks, such as FTP servers in certain (secure) configurations.
The syntax for binding a directory is:
mount --bind existing_location new_location
A concrete example is:
mount --bind /usr/portage/distfiles /home/ftp/distfiles
After running this command, the contents of /usr/portage/distfiles/ will also be available under /home/ftp/distfiles/
That's easy enough to do, but if you want to have this occur automatically during system startup, you have two options:
- put the above command in /etc/conf.d/local.start OR
- add an entry to /etc/fstab, such as:
| File: /etc/fstab |
/usr/portage/distfiles /home/ftp/distfiles none bind |
Add that line, then run mount -a to have it take effect immediately (rather than waiting for the next reboot).
Feedback
Concerns or Compliments? Please use the Discussion section.
Created by NickStallman.net, Luxury Homes Australia
Real estate agents should be using interactive floor plans and list their apartments, townhouses and units.
