Find the answer to your Linux question:
Results 1 to 6 of 6
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 ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jul 2012
    Posts
    3

    Question 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?

  2. #2
    Linux Engineer
    Join Date
    Apr 2012
    Location
    Virginia, USA
    Posts
    917
    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

    That's it.

  3. #3
    Just Joined!
    Join Date
    Jul 2012
    Posts
    3
    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?

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Engineer
    Join Date
    Apr 2012
    Location
    Virginia, USA
    Posts
    917
    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.

  6. #5
    Just Joined!
    Join Date
    Jul 2012
    Posts
    3
    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>.
    Last edited by SyouonKi; 07-13-2012 at 12:09 PM.

  7. #6
    Linux Engineer
    Join Date
    Apr 2012
    Location
    Virginia, USA
    Posts
    917
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •