Creating and Using Oracle® Solaris Zones

Exit Print View

Updated: May 2015
 
 

How to Use LOFS to Mount a File System

You can share a file system between the global zone and non-global zones by using LOFS mounts. This procedure uses the zonecfg command to add an LOFS mount of the global zone /export/datafiles file system to the my-zone configuration. This example does not customize the mount options.

You must be the global administrator or a user in the global zone with the Zone Security rights profile to perform this procedure.

  1. Become an administrator.

    For more information, see Using Your Assigned Administrative Rights in Securing Users and Processes in Oracle Solaris 11.2 .

  2. Use the zonecfg command.
    global# zonecfg -z my-zone
  3. Add a file system to the configuration.
    zonecfg:my-zone> add fs
  4. Set the mount point for the file system, /datafiles in my-zone.
    zonecfg:my-zone:fs> set dir=/datafiles
  5. Specify that /export/datafiles in the global zone is to be mounted as /datafiles in my-zone.
    zonecfg:my-zone:fs> set special=/export/datafiles
  6. Set the file system type.
    zonecfg:my-zone:fs> set type=lofs
  7. End the specification.
    zonecfg:my-zone:fs> end
  8. Verify and commit the configuration.
    zonecfg:my-zone> verify
    zonecfg:my-zone> commit

Temporary Mounts

You can add LOFS file system mounts from the global zone without rebooting the non-global zone:

global# mount -F lofs /export/datafiles /export/my-zone/root/datafiles

To make this mount occur each time the zone boots, the zone's configuration must be modified using the zonecfg command.