Forum › Forums › New users › New Users and General Questions › Solved: problem mounting directories to /sda5 › Reply To: Solved: problem mounting directories to /sda5
you cannot also do
Hi @Stevesr0, you can do this.
$ sudo mount /sda5 /home/stevesr0/Music
$ sudo mount /sda5 /home/stevesr0/Video
This mounts the device /dev/sda5 to two places in your root file system: /home/stevesr0/Music and /home/stevesr0/Video parallel. You can parallel mount to as many places you like.
The content of the filesystem on the partition will appear in both (all) folders you have mounted to, and if you remove a file from one of the folders now, it will vanish in the other the same time. This behaviour can be a bit confusing, since from other („default”) folders you are not used to this, there a file appears merely in a single place. Be aware: If deleting a file from one of these folders, it will be no longer present in the other folders as well to which you have mounted, since they all represent the same partition in your file system. So be careful what you are deleting, if you mount a device to more than a single place: You might believe you have another copy in the other folder, while it is actually the very same file you are up to delete.
And then, you will actually not see nor be able to access any content you had stored to the mointpoint folder before mounting as long a device is mounted to it. Only after u(n)mounting, the original content of the folder will reappear and you can access it again. Because of this, it is advisable not to mount a device to a folder where something is stored into before already. For mounting, always use an empty mountpoint folder.
In your case, to have your music folder mapped to a subfolder in your home, either make sure to move any content the intended folder contains before mounting somewhere else (maybe temporarily, you can move it to the mounted device in ~/Music afterwards, then all stuff will be stored to /dev/sda5 actually now when writing it to ~/Music, so everything is in one place and accessible), or create another new empty folder as mountpoint instead, e.g. /home/stevesr0/Music2 to which you can mount. Alternatively you could create the mountpoint folder even inside /home/stevesr0/Music, e.g. /home/stevesr0/Music/More_Music.
Please always observe the proper unmounting order for these nested mounts: First umount the nested mount, only then umount the base mount. So in your case: Before umounting your home (maybe /dev/sda4 or whatever), you’ll have to umount /dev/sda5 from /home/stevesr0/Music. (For pluggable storage devices like USB, SD etc, unplugdrive will take care of nested mounts and will not let you unmount the base device before the nested mount has been unmounted by whoever had mounted it. For internal devices you have to care for observing this on your own.
I could create subdirectories for different things related to music just by using the file manager (in this case, zzzfm). Which would also be mounted on /sda5 and automatically launched, without adding anything to fstab.
Sure, since you actually write everything to /dev/sda5 while it is mounted to /home/stevesr0/Music. You can use this Music folder as all the other ordinary folders in your file system, do everything in it what you can do in all the other folders also: create and remove subfolders in it, add or remove files to them etc. All this happens then actually in your /dev/sda5 partition instead of in the partition from where your home was mounted (e.g. /dev/sda4 or whatever), so all content will vanish from your home when umounting /dev/sda5, and be back immediately as soon you mount it again. As long unmounted, the mountpoint folder will be either empty (if nothing was in it before mounting) or give you access again to whatever you had stored before mounting /dev/sda5 to it.
Please do yourself a favour and to some tests with dummy mountpoint folders, a dummy partition (on which nothing of worth was stored, you can use e.g. an empty USB storage device for this), dummy folders and dummy files until you are familiar with the proceedings and feel confident, before applying it to your precious music collection. My advice: Don’t use „productive” stuff for trying for the first time (even though I sometimes ignore this rule myself when I’m perfectly confident that I’ve understood how things work and what I am expected to do.)
Windows is like a submarine. Open a window and serious problems will start.