LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Help mounting an iso file (https://www.linuxquestions.org/questions/linux-newbie-8/help-mounting-an-iso-file-507454/)

Mikesoft 12-04-2006 02:43 PM

Help mounting an iso file
 
How would I go about mounting an iso file in Linux?

homey 12-04-2006 02:45 PM

Like this...

mkdir /mnt/iso
mount -o loop knoppix.iso /mnt/iso

fordeck 12-04-2006 02:45 PM

mount -o loop,ro -t iso9660 /path-to/image.iso <path-to-mount-point>

Mikesoft 12-04-2006 02:51 PM

Thanks for that help but Im still confused! :P

My iso file is located at Mike/Desktop/ (iso here)

How would I mount it? Sorry just dont understand what has been said above. Im a bit of a windows user :P

homey 12-04-2006 03:10 PM

You need to make a folder to put the iso contents into. That's why I made a folder called /mnt/iso .

mkdir /mnt/iso

Then, the mount command put the iso contents into that folder...

mount -o loop Mike/Desktop/(iso here) /mnt/iso

Quakeboy02 12-04-2006 03:11 PM

Normally when you do a mount, it's "mount (options) device directory". Options begin with a hyphen ("-"). Device is usually something like "/dev/sda". And the directory is just a directory such as /movies that you've created with a mkdir command, such as "mkdir /movies".

Let's take the case of where the .iso file is on your desktop. In your case, "Mike" I believe, it would probably be "/home/Mike/somename.iso". Let's assume that it's a movie that you want to play, and create a directory to play all movies. I'm kinda sloppy about this by not subdirring out of "/mnt". So, I just made a movies directory by "mkdir /movies".

So, where does that put us? Let's say that you ripped "Prisoner Of Azkaban".iso to your desktop. The embedded spaces are a nuisance, of course, but the mount command could be: "mount -o loop /home/Mike/"Prisoner Of Azkaban".iso /movies". You could also add the ",ro" (read only) as mentioned above. You could also add the "-t iso9660", as well. My system doesn't require either of those, so I don't usually bother. If you can see the file when you do a "ls"; i.e. if you're in the same directory as the file, you could shorten the command to:

mount -o loop "Prisoner Of Azkaban".iso /movies

Of course, "/movies" could be any directory on your system. Just be sure to understand that if you use a directory that has other files or directories under it, those will be unreachable until you unmount your iso file.

Good luck.

jschiwal 12-04-2006 03:15 PM

First you need some place to mount the iso file. If doesn't matter what you call this directory. Let's say it's called /mnt/iso. Then as root, "mkdir /mnt/iso" will create the directory.
Since the iso file is in /home/mike/desktop, cd there first to make the mount command shorter.
"cd /home/mike/Desktop/". You haven't said what the name if the iso file is, so for the sake of example, let's suppose that it is example.iso.
The type of filesystem that a CDROM uses is called "iso9660".

Look in the "man mount" manpages for options and filesystems I haven't mentioned. You probably want to su to root before mounting the image unless you have sudo setup.
# sudo mount -t iso9660 example.iso /mnt/iso/ -o ro,defaults,unhide,loop

The filesystem type is given after the "-t". The image is given before the mount location. The options are given after the "-o". The magic is due to the loop option, which allows you to mount an image of a filesystem as if it were the filesystem itself. Because the iso9660 filesystem is readonly, you can only read from it. You can not access the iso contents in the /mnt/iso directory.

pixellany 12-04-2006 03:15 PM

Take a look at the man page for "mount"---ie do "man mount" in a terminal window.

To take apart the command, it is basically this:
mount <with these options> <using this file system> <this file> <to this mount point>

So, suppose you want to mount your file to /mnt/Mikes_iso The command previously given would look like this:

Code:

mount -o loop,ro -t iso9660 /home/Mike/Desktop/<isofilename> /mnt/Mikesiso
if the mount point does not already exist, you would have to create it with:
Code:

mkdir /mnt/Mikesiso
I have done this with full pathnames. Depending on where you are in the tree, you can use relative path names, but that is more confusing.

I used the case of a mount point in /mnt, but it can be anywhere. Just don't use a directory with data in it, or it will be hidden (until you unmount)

BTW: "mount" is really misleading--it goes back to the days of tape drives. "Connect" is far more descriptive of what is happening.

pixellany 12-04-2006 03:16 PM

Boy, are you getting a lot of help!!! Lots of mounties out today....;)

Mikesoft 12-04-2006 04:10 PM

wow thanks for all the help guys! Got it working ;)


All times are GMT -5. The time now is 01:53 PM.