How to Mount a File System From the Global Zone Into a Non-Global Zone
Assume that a zone has the zonepath /export/home/my-zone. You want to mount the disk /dev/lofi/1 from the global zone into /mnt in the non-global zone.
You must be the global administrator in the global zone to perform this procedure.
Become superuser, or assume the Primary Administrator role.
To create the role and assign the role to a user, see "Using the Solaris Management Tools With RBAC (Task Map)" in System Administration Guide: Basic Administration.
To mount the disk into /mnt in the non-global zone, type the following from the global zone:
global# mount -F ufs /dev/lofi/1 /export/home/my-zone/root/mnt
See Also
For information about lofi, see the lofiadm(1M) and lofi(7D) man pages.
Adding Non-Global Zone Access to Specific File Systems in the Global Zone
How to Add Access to CD or DVD Media in a Non-Global Zone
This procedure enables you to add read-only access to CD or DVD media in a non-global zone. The Volume Management file system is used in the global zone for mounting the media. A CD or DVD can then be used to install a product in the non-global zone. This procedure uses a DVD named jes_05q4_dvd.
Become superuser, or assume the Primary Administrator role.
To create the role and assign the role to a user, see "Using the Solaris Management Tools With RBAC (Task Map)" in System Administration Guide: Basic Administration.
Determine whether the Volume Management file system is running in the global zone.
global# svcs volfs STATE STIME FMRI online Sep_29 svc:/system/filesystem/volfs:default
(Optional) If the Volume Management file system is not running in the global zone, start it.
global# svcadm volfs enable
Insert the media.
Check for media in the drive.
global# volcheck
Test whether the DVD is automounted.
global# ls /cdrom
You will see a display similar to the following:
cdrom cdrom1 jes_05q4_dvd
Loopback mount the file system with the options ro,nodevices (read-only and no devices) in the non-global zone.
global# zonecfg -z my-zone zonecfg:my-zone> add fs zonecfg:my-zone:fs> set dir=/cdrom zonecfg:my-zone:fs> set special=/cdrom zonecfg:my-zone:fs> set type=lofs zonecfg:my-zone:fs> add options [ro,nodevices] zonecfg:my-zone:fs> end zonecfg:my-zone> commit zonecfg:my-zone> exit
Reboot the non-global zone.
global# zoneadm -z my-zone reboot
Use the zoneadm list command with the -v option to verify the status.
global# zoneadm list -v
You will see a display that is similar to the following:
ID NAME STATUS PATH BRAND 0 global running / native 1 my-zone running /export/home/my-zone native
Log in to the non-global zone.
global# zlogin my-zone
Verify the DVD-ROM mount.
my-zone# ls /cdrom
You will see a display similar to this:
cdrom cdrom1 jes_05q4_dvd
Install the product as described in the product installation guide.
Exit the non-global zone.
my-zone# exit
Tip - You might want to retain the /cdrom file system in your non-global zone. The mount will always reflect the current contents of the CD-ROM drive, or an empty directory if the drive is empty.
(Optional) If you want to remove the /cdrom file system from the non-global zone, use the following procedure.
global# zonecfg -z my-zone zonecfg:my-zone> remove fs dir=/cdrom zonecfg:my-zone> commit zonecfg:my-zone> exit
How to Add a Writable Directory under /usr in a Non-Global Zone
In a sparse root zone, /usr is mounted read-only from the global zone. You can use this procedure to add a writable directory, such as /usr/local, under /usr in your zone.
You must be the global administrator in the global zone to perform this procedure.
Become superuser, or assume the Primary Administrator role.
To create the role and assign the role to a user, see "Using the Solaris Management Tools With RBAC (Task Map)" in System Administration Guide: Basic Administration.
Create the directory /usr/local in the global zone.
global# mkdir -p /usr/local
Specify a directory in the global zone to serve as the backing store for the zone's /usr/local directory.
global# mkdir -p /storage/local/my-zone
Edit the configuration for the zone my-zone.
global# zonecfg -z my-zone
Add the loopback-mounted filesystem.
zonecfg:my-zone> add fs zonecfg:my-zone:fs> set dir=/usr/local zonecfg:my-zone:fs> set special=/storage/local/my-zone zonecfg:my-zone:fs> set type=lofs zonecfg:my-zone:fs> end zonecfg:my-zone> commit zonecfg:my-zone> exit
Boot the zone.
How to Export Home Directories in the Global Zone Into a Non-Global Zone
This procedure is used to export home directories or other file systems from the global zone into non-global zones on the same system.
You must be the global administrator in the global zone to perform this procedure.
Become superuser, or assume the Primary Administrator role.
To create the role and assign the role to a user, see "Using the Solaris Management Tools With RBAC (Task Map)" in System Administration Guide: Basic Administration.
Add the loopback-mounted filesystem.
global# zonecfg -z my-zone zonecfg:my-zone> add fs zonecfg:my-zone:fs> set dir=/export/home zonecfg:my-zone:fs> set special=/export/home zonecfg:my-zone:fs> set type=lofs zonecfg:my-zone:fs> set options=nodevices zonecfg:my-zone:fs> end zonecfg:my-zone> commit zonecfg:my-zone> exit
Add the following line to the zone's /etc/auto_home file:
$HOST:/export/home/&