Date: Wed, 23 Mar 2011 16:05:12 -0500 From: Ryan Coleman <editor@d3photography.com> To: Polytropon <freebsd@edvax.de> Cc: FreeBSD Mailing List <freebsd-questions@freebsd.org> Subject: Re: Automating mounting of ISO images Message-ID: <B20B5E13-51EB-4E3A-8441-32F60482D77E@d3photography.com> In-Reply-To: <20110323214516.47d71026.freebsd@edvax.de> References: <21012F71-5038-45F1-98C6-72A0B1239009@d3photography.com> <31D3BED1-7035-435F-B127-EFAAF6AFF076@mac.com> <20D9B390-3190-4865-A19E-BDEDC595E7A2@d3photography.com> <20110323211605.4c893e70.freebsd@edvax.de> <2A377C8B-D9E6-4E60-834C-5BD7C03AA552@d3photography.com> <20110323214516.47d71026.freebsd@edvax.de>
next in thread | previous in thread | raw e-mail | index | archive | help
On Mar 23, 2011, at 3:45 PM, Polytropon wrote:
> On Wed, 23 Mar 2011 15:35:21 -0500, Ryan Coleman <editor@d3photography.com> wrote:
>> Here's the working script (Yay!)
>>
>> #! /bin/sh
>>
>> for FILE in /mount/disc_images/*.iso; do
>> DEST=$FILE
>> DIRNAME=`basename ${FILE} .iso`
>> echo ${DIRNAME} ${FILE}
>> mkdir /mount/new_brighton/images/${DIRNAME}
>> mount -t cd9660 /dev/`mdconfig -f ${FILE}` /mount/new_brighton/images/${DIRNAME}
>> done
>>
>> Thanks to Polytropon and Chuck for their guidance.
>
> Just a little note:
>
> Make sure you're mounting the ISOs as "-o ro" to prevent
> write access to them. If users don't have +w access to
> the mounted directories, you can leave out this step.
> Depending on the permissions used, this might corrupt
> (or at least change) the image files which may not be
> desired.
>
> If you want to omit one external program call (one per
> iteration step), use DIRNAME=${FILE%.iso} instead of the
> `basename ${FILE} .iso` - although it's more obvious what
> DIRNAME gets designated to. :-)
I did try that once and it didn't strip the directory structure out so when basename worked I didn't mess with it too much. If we have 100+ ISOs to mount then I'll worry.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?B20B5E13-51EB-4E3A-8441-32F60482D77E>
