LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Mounting 2 ISO's to the same directory (https://www.linuxquestions.org/questions/linux-general-1/mounting-2-isos-to-the-same-directory-318852/)

ritme909 04-30-2005 04:13 PM

Mounting 2 ISO's to the same directory
 
Hi, I was wondering if it is possible to mount two ISO's to the same directory. For example I try this:

mount -o loop firstiso.iso mountpoint
then
mount -o loop second.iso mountpoint

But when I mount the second ISO it seems to unmount the first (or at least the files from the first ISO are no longer there). I need all the files from both ISO's in the same directory. I hope this makes sense, any help is appreciated.

Thanks

Dark_Helmet 04-30-2005 04:23 PM

Nope, you can't do that. When you mount the second, it overlays the first mount. If you were to unmount the second, the first would probably reappear.

You'll need to do one of a couple things:
1. Create a new image file that contains the files from both. You could do that by mounting each file separately, but copying their contents to a single, other directory. For instance:
Code:

mount -o loop firstiso.iso /first_iso
mount -o loop secondiso.iso /second_iso
cp -R /first_iso/* /new_iso_directory
cp -R /second_iso/* /new_iso_directory

Then create the new iso from the contents of /new_iso_directory, or simply just access what you need from there.


2. Again, mount the iso files separately, but then do a symbolic link to the files from another directory. Basically the same thing as above, but using ln.

ritme909 04-30-2005 04:38 PM

Option number 1 isn't possible because I have very limited disk space, but the symbolic link idea works great, thanks!

Garlic Overtone 08-17-2011 08:41 PM

Solved
 
This question was #3 in google today on the topic of mounting 2 ISO images to the same directory. Figured I'd answer it once I figured it out.

There are 4 tools at your disposal:
  1. UnionFS-FUSE
  2. UnionFS
  3. aUFS
  4. UnionMount

The first is preferred because it only requires FUSE support and in Fedora/CentOS/RHEL it is already packaged by Fedora/EPEL.

Whereas the rest require patching core parts of your distribution and probably isn't worth the effort for something this simple.

So this assumes using fuse-unionfs. In RHEL/CentOS you can install the necessary software like so (Assuming you have the EPEL repository enabled).

Code:

sudo yum -y install funionfs
Then all you need to do is create 3 empty mount points. Call them disc1, disc2, and full.

Mount the first iso into disc1, the second into disc 2.
Code:

(sudo mount -o loop /path/to/image.iso /mnt/disc1)
Lastly, merge the 2 mountpoints.

Code:

funionfs none /mnt/full -o dirs=/mnt/disc1=ro:/mnt/disc2=ro
I never did get this to work using `mount -t fuse funionfs#' syntax.

LJ Article introducing UnionFS. Also, this blog post was helpful. The man page explains why I used 'none' as the second parameter.

HTH!


All times are GMT -5. The time now is 02:06 AM.