Mount in mount
I would like to mount one partition (mount2) onto a folder in the mount folder of another partition (mount1), both partitions formatted as ext4, as shown here: /..../mount1/..../mount2/
Might this cause any problems such as read/write performance for mount2?
No, you should be good. This is very normal for Linux.
so, say you want to mount /dev/sdb1 in /var/myfolder and /var is mounted on /dev/sda2
mount /dev/sdb1 /var/myfolder
Thanks for the reply but what if the devices are slow (in my case, these are two external hard disk drives connected through USB 2.0 and the read/write speeds aren't that fast)? Does an access to a file on the device at mount2 also cause an access to the device at mount1 every time, possibly only initially?
I'm not sure. I wouldn't try to mount a removable storage device in another removable storage device. Instead, why not just mount the second removable storage device on the root fs as described above, and then create a soft link to that mount point on the first removable storage device.
I've already thought of using soft links but I've noticed before how some applications need to be configured to use them so I thought I might as well just mount it instead to avoid this problem.
This is my actual situation: My setup is a cheap file server with the Raspberry Pi computer to which I connect all of my external storage devices through USB. These are then auto-mounted into /media and a separate script reads a text file on the root of the device (partition) containing a user name. The script then moves the mount location of the device in to the user's home folder.
Apart from an SD card, the only extra storage possible with the Raspberry Pi is though USB. I thought it might be a bad idea leaving anything variable on the SD card so I thought I might have /home, /var and /tmp on a USB storage device which I would never remove. I then realised the problems that this may cause as mentioned in my previous posts: /home is mounted from one external device and other storage devices would be mounted at /home/<user>/Media/<device>.
Yeah, it shouldn't be a problem. The biggest concern I saw was the system trying to mount the second drive before the first, but if the mount is a sub dir of /home, then it's all but assured the directory path will be available to mount he second drive. This should not have any impact on the performance of the system.