Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: Automounting ISO images using automount [SOLVED]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Automounting ISO images using automount [SOLVED]



My lab recently transitioned from Ubuntu over to Mac OS X Server. On our old Ubuntu sever we used automount to mount some ISO images of conference proceedings. That way we could browse the contents of the proceedings without actually having to download the ISO and mount it on our own machine.

On the Ubuntu server our automount configuration files looked something like this...

auto.master
==========

/var/foo/conferences /etc/auto.conferences

auto.conferences
==============

iros2007	-fstype=iso9660,ro,loop :/var/foo/images/IROS_2007.iso
icra2007	-fstype=iso9660,ro,loop :/var/foo/images/ICRA_2007.iso

Now I understand that just copying these files into Darwin is not going to work. My question is, is there a similar approach that would produce the same results using automount in Darwin? I've spent a good few hours on the apple lists, and google today and have come up short. I'm about to resort to a shell script, but I really like the way automount was working for us thus far. Any suggestions?


If you're running Leopard server, then you should have no problem using autofs to mount these as needed. In fact, autofs is perfectly suited to this type of thing, and is probably much better than statically mounting a whole bunch of isos through fstab. (As another poster suggested, the old automounter from Tiger is probably not suited to this). One thing to consider is that fstype=iso9660 probably needs to be changed to fstype=cd9660, at least according to the mount man page.

If you have quite a few of these images, I would recommend creating an executable map. It can get a listing of /var/foo/images/ and dynamically create the map for you. As you toss more images into that directory, you won't have to edit auto.conferences. Read `man auto_master` for details.

Good luck!

Luke, you got me on the right track. Thanks! I was so convinced that I should be able to do this with an indirect map that I hesitated looking at the executable map option. As far as I can tell mount will not play nicely with ISO images, so there isn't a way to use an indirect map. This is what i ended up doing:

/etc/auto_master
=============

/var/foo/conferences /etc/auto_conferences -nobrowse

/etc/auto_conferences
=================

#!/bin/bash

IMAGE_DIR="/var/foo/images"
MOUNT_OPTS="-fstype=cd9660,ro"

key="$1"
image_path="$IMAGE_DIR/$key.iso"

/usr/bin/logger -p local0.notice "automount: attempting to mount $image_path"

if [ -f $image_path ]; then
device=`/usr/bin/hdid -nomount $image_path`
/usr/bin/logger -p local0.notice "automount: mounting $image_path using device $device"
echo -e "$MOUNT_OPTS\t:$device"
exit
fi

/usr/bin/logger -p local0.notice "automount: could not mount $image_path"
exit 1

This may not be an optimal solution, but it serves my purposes (trusted users only) well enough. It looks in the IMAGE_DIR to see if there is an ISO image that matches the key passed in. If an ISO exists it uses hdid to attach the image to a device and the device name is stored in device. MOUNT_OPTS and device are used to create an entry for the executable map. I hope this helps someone else down the line. Thanks to everyone that answered.

Cheers!

Rod

"I love deadlines. I like the whooshing sound they make as they fly by." --Douglas Adams

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Macos-x-server mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.