PDA

View Full Version : Mounting .iso



r00fattaX
12th December 2011, 07:37 PM
I am having trouble mounting an .iso file. I know the command, but when I do it it says I need to be root. So I do

su -

Now when I try to Navigate back to the directory where my .iso is located, it keeps telling me no directory or file exists. Here is what I'm doing

$ cd Downloads <-that works

$ mount -t iso9660 /dir/to/nfsu2.iso /mnt/dir/for/iso -o loop <-need root for this, okay no prob

$ su -

# cd Downloads <- No such directory or file. :confused:

Firewing1
12th December 2011, 07:42 PM
$ su -
# cd Downloads <- No such directory or file. :confused:
Adding a dash after 'su' will set the appropriate login variables (for example you will be able to call binaries in /sbin or /usr/sbin without typing out the full name because $PATH gets set) however it also moves your current working directory into root's home. You'll need to cd back to /mnt/dir/for/iso first:

su -
cd /mnt/dir/for/iso
# and now, continue as you did before:
cd Downloads

You can always use the 'pwd' command to find out where you are currently. Also, note that once the ISO is mounted you shouldn't need to be root to access the files within... In most cases, they should be browsable by a regular user.

smr54
12th December 2011, 07:46 PM
I think, judging from this and your other posts, that you're not quite grasping the directory concept.

When you do su - you are in root's home directory. I have a dated page on this.

http://home.roadrunner.com/~computertaijutsu/rhpath.html

It was written more about an old, no longer present issue, but it might give you a bit of understanding.

If you do su (no dash)

You will be where you were when you issued the command.

If you do su -

you will be in root's home directory.

There's a useful command

pwd

It stands for print working directory.

However, in this case, even if you didn't use su - , unless you've moved out of the Downloads directory, you'll still get that not found. This is because you're already in Downloads.

Now, as root, to get to that Downloads directory, you'd go into your normal user's $HOME directory. For example, if your user name is root

su -

cd /home/roo/Downloads

Hope this helps.

r00fattaX
12th December 2011, 08:26 PM
When you say :



cd /mnt/dir/for/iso


Are any of those variables? Should I replace "Dir" with the directory where the .iso is? After trying it this is what I get.

$ su -
# cd /mnt/dir/for/iso <-same error, specified folder does not exist

I know I'm probably misunderstanding, I apologize, I have no experience with Linux and as a PC repair tech I'm just trying to increase my knowledge. I'm learning basically from the very beginning here, and the phrase "Hard to teach an old dog new tricks" sounds pretty relevant in this case. Your patience and help is greatly appreciated.

---------- Post added at 07:11 PM ---------- Previous post was at 07:03 PM ----------

smr54, that WAS helpful. Seems like it would just be easier to use

$ su

in most cases.[COLOR="Silver"]

---------- Post added at 07:26 PM ---------- Previous post was at 07:11 PM ----------

OKay, I think I got it, it says file is already mounted to /mnt/iso. Problem is folder has a lock on it and when I click it, nothing shows up.

smr54
12th December 2011, 08:55 PM
su - can be handy in some cases when you will need root's complete environment. I'm not sure what's going on with your exact circumstances, but it's always a good thing to get used to the command line.

The command


mount


will show you what is mounted. (You know that already, as far as I can tell).

So,

ls /mnt/iso

Should give you some indicatation. If it is an actual iso, I'm not even sure how to deal with the automount stuff--I usually use openbox as my window manager, which leaves most of this stuff to the user, rather than doing it automatically.

At any rate, I usually do something like


mount -o loop <whatever>.iso /mnt

ls /mnt

(In this case, the <whatever> is the variable.

If it's a physical disk, however, such as CD or DVD, usually I can just do something like


mount /dev/scd0 /mnt

Then do ls /mnt

But, not trying to sound elitist, I really have no idea how the GUI tools for this work or how they're supposed to work, I don't use them, so, while I do lose their convenience, I also avoid some of their problems.

pant
12th December 2011, 09:10 PM
cd /home/r00fattaX/Downloads

while r00fattaX is your user name ( not root, firefox stores files in /home/user/Downloads , not /root/Downloads which will be if you run "su - , cd Downloads"..

Hope it helps

Firewing1
13th December 2011, 01:54 AM
Are any of those variables? Should I replace "Dir" with the directory where the .iso is? After trying it this is what I get.

$ su -
# cd /mnt/dir/for/iso <-same error, specified folder does not exist

I know I'm probably misunderstanding, I apologize, I have no experience with Linux and as a PC repair tech I'm just trying to increase my knowledge. I'm learning basically from the very beginning here, and the phrase "Hard to teach an old dog new tricks" sounds pretty relevant in this case. Your patience and help is greatly appreciated.
No worries! We all have to learn how to do the basics in order to get better. We've all been there at one time too :)

I was simply copying the /mnt/dir/for/iso path from the command you had posted in the first post, if you are using a different one (from subsequent posts I see this is /mnt/iso) then you will need to substitute it for /mnt/iso instead.

You mentioned that you tried browsing the files from the graphical interface but they had a lock - you may be interested in using the 'uid', 'gid' or 'umask' options then to change the owner/group/permissions respectively on the mounted files. For example:


# unmount first it if it is already mounted
umount /mnt/iso
# remount it using new options
mount -t iso9660 /dir/to/nfsu2.iso /mnt/iso -o loop,uid=1000,gid=1000
(note that the lines starting with '#' are descriptive comments and will be ignored by the shell, even if you copy/paste and run the entire code block).

This mount command would mount the ISO but set the owner and group of all files to 1000. You can identify your user and group number by running:

id
It will output something like:

uid=503(firewing1) gid=503(firewing1)
# ...
So you would use 503 instead of 1000 in this case. It is possible that your UID and GID numbers differ, that's OK.

marko
13th December 2011, 02:29 AM
Another good option is fuseiso, if you don't have it then install it:


su
<root password>
yum install fuseiso
(any dependencies it needs will get pulled in too)


fuseiso -p filename.iso mountpointthe directories in the iso file will be in the mountpoint then when you're done you can
unmount the mountpoint with:


fusermount -u mountpointThe advantage of this is you don't have to be root for mounting and unmounting these as long as the iso and the mount point are in the filesystem you own.

Firewing1
15th December 2011, 07:51 PM
I believe gvfs can mount ISOs in userspace as well if you are using GNOME. Just right-click the ISO and there's an option to browse the files inside.