How do I mount the contents of /home/multimedia in two places under Linux operating systems?
If you are using Linux kernel v2.4.0+, you can remount part of the file hierarchy somewhere else using the following mount command syntax. This is useful for NFS servers in /exports. You must type the following commands as the root user. The syntax is
mount --bind /path/to/olddir /path/to/newdir mount -B olddir newdir
The syntax for /etc/fstab entry is:
/olddir /newdir none bind
In this example, mount /home/multimedia/mp3 and /home/multimedia/videos as follows:
# mkdir -p /exports/{music,videos}
# mount --bind /home/multimedia/mp3 /exports/music
# mount --bind /home/multimedia/videos /exports/videos
Verify new settings:
# mount
# df -a
# mount | egrep -i --color 'music|videos'
Update /etc/fstabe file as follows:
# vi /etc/fstab
Append the following:
/home/multimedia/mp3 /exports/music none bind /home/multimedia/videos /exports/videos
Save and close the file.
See also:
- man page mount(8) command.
You should follow me on twitter here or grab rss feed to keep track of new changes.
Featured Articles:
- 30 Handy Bash Shell Aliases For Linux / Unix / Mac OS X
- Top 30 Nmap Command Examples For Sys/Network Admins
- 25 PHP Security Best Practices For Sys Admins
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- Linux: 20 Iptables Examples For New SysAdmins
- Top 20 OpenSSH Server Best Security Practices
- Top 20 Nginx WebServer Best Security Practices
- 20 Examples: Make Sure Unix / Linux Configuration Files Are Free From Syntax Errors
- 15 Greatest Open Source Terminal Applications Of 2012

- My 10 UNIX Command Line Mistakes
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- The Novice Guide To Buying A Linux Laptop













{ 0 comments… add one now }