Go to main content

Creating and Using Oracle® Solaris Zones

Exit Print View

Updated: April 2019

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.

  1. Become a zone administrator.

    You must also be assigned the ZFS File System Management and ZFS Storage Management rights profiles. The root role has all of these rights.

    For more information, see Assigning Limited Rights to Zone Administrators.

  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