mkmountpoint


Description:

[ Version ( since = "1.0.62" ) ]
public bool mkmountpoint (string exemptpath) throws Error

create a mountpoint

mkmountpoint and rmmountpoint are specialized calls that can be used to create extra mountpoints before mounting the first filesystem.

These calls are *only* necessary in some very limited circumstances, mainly the case where you want to mount a mix of unrelated and/or read-only filesystems together.

For example, live CDs often contain a "Russian doll" nest of filesystems, an ISO outer layer, with a squashfs image inside, with an ext2/3 image inside that. You can unpack this as follows in guestfish:

<![CDATA[add-ro Fedora-11-i686-Live.iso]]>

<![CDATA[run]]>

<![CDATA[mkmountpoint /cd]]>

<![CDATA[mkmountpoint /sqsh]]>

<![CDATA[mkmountpoint /ext3fs]]>

<![CDATA[mount /dev/sda /cd]]>

<![CDATA[mount-loop /cd/LiveOS/squashfs.img /sqsh]]>

<![CDATA[mount-loop /sqsh/LiveOS/ext3fs.img /ext3fs]]>

The inner filesystem is now unpacked under the /ext3fs mountpoint.

mkmountpoint is not compatible with umount_all. You may get unexpected errors if you try to mix these calls. It is safest to manually unmount filesystems and remove mountpoints after use.

umount_all unmounts filesystems by sorting the paths longest first, so for this to work for manual mountpoints, you must ensure that the innermost mountpoints have the longest pathnames, as in the example code above.

For more details see <ulink url='https://bugzilla.redhat.com/show_bug.cgi?id=599503'> http://bugzilla.redhat.com/show_bug.cgi?id=599503 </ulink>

Autosync [see set_autosync, this is set by default on handles] can cause umount_all to be called when the handle is closed which can also trigger these issues.

Parameters:

this

A GuestfsSession object

Returns:

true on success, false on error