Automating mounting of ISO images

Ryan Coleman editor at
Wed Mar 23 20:06:29 UTC 2011

We're close on this (thanks for the push).

It wants to load the entire path up in ${DEST} which is not ideal but I can live with that.

I am also trying to make the directories right before the attempt to mount the image (a 'duh' moment just now). 
So I'd like to have just the filename, not the full path, made as a folder... 

In other news: The ISOs are all made by me, so no special chars, just capital and lowercase letters, sometimes numbers, no spaces and use of underscores and hyphens.


On Mar 23, 2011, at 2:11 PM, Chuck Swiger wrote:

> Hi--
> On Mar 23, 2011, at 11:49 AM, Ryan Coleman wrote:
>> Disc images are located in /mount/disc_images/ (all are ISOs)
>> They need to mount into /mount/office_files/images/FILENAME [without the .iso extension]
>> How can I do this? I've always been given these types of scripts in the past at an old job but I don't have access to those examples anymore.
> Something like this might do (untested, though):
> #! /bin/sh                                                                                                  
> for FILE in /mount/disc_images/*; do
>   DEST=$FILE:r
>   mount -t cd9660 /dev/`mdconfig -f ${FILE}` /mount/office_files/images/${DEST}
> done
> Might need to add quotes if you have spaces or other unusual characters in your ISO filenames....
> Regards,
> -- 
> -Chuck

More information about the freebsd-questions mailing list