auto mounting an .iso file

This forum is dedicated to basic help and support :

Ask here your questions about basic installation and usage of Mageia. For example you may post here all your questions about getting Mageia isos and installing it, configuring your printer, using your word processor etc.

Try to ask your questions in the right sub-forum with as much details as you can gather. the more precise the question will be, the more likely you are to get a useful answer

auto mounting an .iso file

Postby tim » Jul 31st, '12, 12:38

Hello everybody,

I want to automatically mount an .iso file which is on an ntfs file system that I mounted via fstab. Do I have to make another fstab entry or is it better to write a small script and place it in /etc/init.d? How would such an entry or script look like?

Thank you very much for your help!

tim
tim
 
Posts: 8
Joined: Jul 31st, '12, 12:24

Re: auto mounting an .iso file

Postby isadora » Jul 31st, '12, 12:53

Would suggest a new entry in fstab:

Code: Select all
/iso-archiv/image.iso /mnt/image1 iso9660 ro,loop,auto 0 0

Where /iso-archiv/image.iso is the full-path to the .iso
Where /mnt/image1 is your choice for mount-point.
..........bird from paradise..........

Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away.
—Antoine de Saint-Exupéry
User avatar
isadora
 
Posts: 2766
Joined: Mar 25th, '11, 16:03
Location: Netherlands

Re: auto mounting an .iso file

Postby wintpe » Aug 1st, '12, 10:09

There is of course autofs that will dynamicly mount anything specified in the automount maps.

I use it for automounting my nfs mounts on demand.

That way you dont have hangs when the destination server or path is not up, on boot.

Ive seen a few people on here putting nfs mounts in fstab, which is not the best way to do it.

Autofs will mount the destination on the path when an attempt is made to navigate to that path, so boot ups are not held up by destination servers down.

I can post an example of howvto do it if anyone is struggling.

Regards peter
Redhat 6 Certified Engineer (RHCE)
Sometimes my posts will sound short, or snappy, however its realy not my intention to offend, so accept my apologies in advance.
wintpe
 
Posts: 1204
Joined: May 22nd, '11, 17:08
Location: Rayleigh,, Essex , UK

Re: auto mounting an .iso file

Postby wintpe » Aug 1st, '12, 14:57

ok so heres example (working from my system).

install the autofs package

so exports on a file server

/local/0 *(rw,insecure,all_squash)
/local/1 *(rw,insecure,all_squash)
/local/2 *(rw,insecure,all_squash)

now on the client

cd /etc/autofs

im going to make the above mounts appear under /local

so first edit edit auto.master and add a line

/local /etc/autofs/auto.local

now edit auto.local (which is a new file to contain all the mounts appearing under /local.

0 -rw,soft,bg,tcp,vers=3,rsize=262144,wsize=262144 fileserver:/local/0
1 -rw,soft,bg,tcp,vers=3,rsize=262144,wsize=262144 fileserver:/local/1
2 -rw,soft,bg,tcp,vers=3,rsize=262144,wsize=262144 fileserver:/local/2

you only need to start the line with the mount point under /local

when you run service autofs restart a virtual mount point will be created called /local
(this is not a directory, but looks like one) you cant create any files in it, its read only.

now if you cd /local/0 you will see the mount appears almost magically
and you dont need to be root, as the autofs daemon intercepts your change directory request and starts a mount command with the options in the auto.local file for that matching entry.

if you have not used it for a while or dont have any open files holding it open, it will quietly dismount until its needed again

similarly as per this thread an ISO or cdrom could be mounted using the same system as long as the mount options are in the autofs file associated with the mount path.

those mount options ive put in my autofs file also greatly improve NFS performance on standard mageia/mandriva which I found to be absolutely appalling using the mageia/mandriva default options (ie the vers=3,rsize=262144,wsize=262144 ).

regards peter
Redhat 6 Certified Engineer (RHCE)
Sometimes my posts will sound short, or snappy, however its realy not my intention to offend, so accept my apologies in advance.
wintpe
 
Posts: 1204
Joined: May 22nd, '11, 17:08
Location: Rayleigh,, Essex , UK

Re: auto mounting an .iso file

Postby tim » Aug 5th, '12, 12:25

Thank you very much for your help! But it looks like i produced another error with my editing :D

https://lh6.googleusercontent.com/-CXIMdUXpsCw/UB5BvEHMoPI/AAAAAAAAAPY/UlRmD9jfGo4/s1048/DSC_0156.JPG

so i opened my fstab with vi and this is how it looks like:

https://lh6.googleusercontent.com/-KBrmLjdsmZo/UB5GFf-5opI/AAAAAAAAAQA/rUOhmLEj0SA/s1048/DSC_0159.JPG

here as plain text so you can read it better

Code: Select all
# Entry for /dev/sdb1 :
UUID=cb9ea857-75c5-4be1-a08c-8f9d030857c7 / ext4 defaults 1 1
# Entry for /dev/sdb6 :
UUID=9c53e51a-0492-4fda-86d4-562de5a8c14d /home ext4 defaults 1 2
# none /proc proc defaults 0 0
# Entry for /dev/sdb5 :
UUID=dc2dd0cc-742a-4c70-b217-e7525b3c9839 swap swap defaults 0 0
# Windows-Platte
# UUID=8AE6CB51E6CB3C67 /home/tim/Win7 ntfs defaults,umask=000 0 0
# Tausch-Platte
# UUID=907C516F7C5150D8 /home/tim/Tausch ntfs defaults,umask=000 0 0
# Video to Brain - Java 7
# /dev/sda2/Programme/Video2Brain_-_Java_7_-_Einstieg_für_Anspruchsvolle /home/tim/Java7 iso9660 ro,loop,auto 0 0


I am really desperate.. If you need to know any other outputs just let me know and I will check. Thanks for your help in advance!

tim
tim
 
Posts: 8
Joined: Jul 31st, '12, 12:24

Re: auto mounting an .iso file

Postby doktor5000 » Aug 5th, '12, 15:38

You can't reference a file through the /dev device tree. Also /dev/sda2/Programme/Video2Brain_-_Java_7_-_Einstieg_für_Anspruchsvolle looks like a folder, or you're missing the extension .iso or whatever image that is. Apart from that, is it correct that this file/folder is located on the same partition which you mount below /home/tim/Win7?
Then why don't you just add a symlink, this can even be done via file manager ...

BTW: As your main language seems to be german, why not use the german forum, maybe that makes communicating easier?
https://forums.mageia.org/de/index.php
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18058
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany


Return to Basic support

Who is online

Users browsing this forum: No registered users and 1 guest