I love simple solutions. I share my full music collection to multiple devices on my LAN using a samba. I also have some seasonal music which I only want to be available during the holiday season. I decided to create a bind mount for my seasonal music. Creating a bind mount allows you to remount part of your file system someplace else.
I keep my seasonal music in the following folder.
/files/christmas-music
I keep my entire music collection minus the seasonal music under the following folder.
/files/music
I am sharing my music folder using samba. I have multiple devices on my LAN which mount this as a CIFS share.
[music] comment = music path = /files/music admin users = +admin, musicrw read list = music write list = musicrw read only = No create mask = 0775 directory mask = 0775 guest ok = Yes
Under my music folder I have many subfolders that are filled with music files. Here is but a few.
/files/music/_Chill /files/music/_Classic /files/music/_Metal /files/music/_New_Wave
When I’m ready to make my seasonal music availabe. I create a subfolder for it. Then I mount my seasonal music using a bind type of mount.
mkdir /files/music/_Christmas sudo mount -t bind /files/christmas-music /files/music/_Christmas
I add this to my /etc/fstab
/files/christmas-music /files/music/_Christmas bind defaults 0 0
That makes the seasonal music available to my devices that already have my music folder mounted. When the holiday season is over, I unmount the bind mount. The bind mount works perfectly in this situation. Why didn’t I use a symlink?– Because symlinks are disabled by default on samba.
I hope you enjoyed this simple example of using a bind mount.