[OpenIndiana-discuss] How to mount ISO image on boot?

Ray Arachelian ray at arachelian.com
Tue Jul 17 16:43:41 UTC 2012


On 07/17/2012 12:34 PM, Ray Arachelian wrote:
> On 07/17/2012 09:29 AM, Aneurin Price wrote:
>> Hello all,
>>
>> >From the command line, I can mount an iso image using mount directly
>> (without having to invoke lofiadm):
>> # mount -F hsfs /path/to/my.iso /mountpath
>>
>> I've tried adding a line to /etc/vfstab to have this done automatically on boot:
>> /path/to/my.iso - /mountpath hsfs - yes -
>>
> Try it this way:
>
> mount -o ro -F hsfs  `lofiadm -a /path/to/my.iso` /mountpath
>
> When you're done you'll need to run lofiadm -d /path/to/my.iso after you
> unmount it.
>

Sorry, I don't think you can add this to /etc/vfstab - well, you might
be able to if you could get lofiadm to run before your ISO gets mounted,
but that's going to be too tricky.

The easiest way is just to write the command into /etc/rc3.d/S99mountiso
like this:

#!/bin/bash

mount -o ro -F hsfs `lofiadm -a /path/to/my.iso` /mountpath



More information about the OpenIndiana-discuss mailing list