|
|
6.6. File SystemsVirtualization of storage in a zone is achieved by means of a restricted root, similar to the chroot(2) environment at the file system level. Processes running within a zone are limited to files and file systems that can be accessed from the restricted root. Unlike chroot, a zone is not escapable; once a process enters a zone, it and all of its children will be restricted to that zone and associated root. The loopback file system (lofs) provides a useful tool for constructing a file system namespace for a zone. This is used to mount segments of a file system in multiple places within the namespace; for example, /usr could also be mounted underneath a zone root. 6.6.1. ConfigurationGenerally speaking, the set of file systems mounted in a zone is the set of the file systems mounted when the virtual platform is initialized plus the set of file systems mounted from within the application environment itself (for instance, the file systems specified in a zone's /etc/vfstab, as well as autofs and autofs-TRiggered mounts and mounts explicitly performed by zone administrator). Certain restrictions are placed on mounts performed from within the application environment to prevent the zone administrator from denying service to the rest of the system or otherwise negatively impacting other zones. 6.6.1.1. zonecfg File System ConfigurationThe global administrator can specify a number of mounts to be performed when the virtual platform is set up. Shown below is the interface for specifying that /dev/ dsk/c0t0d0s7 in the global zone is to be mounted as /var/tmp in zone my-zone and that the file system type to use should be UFS, mounted with logging enabled. zonecfg:newzone> add fs zonecfg:newzone:fs> set dir=/var/tmp zonecfg:newzone:fs> set special=/dev/dsk/c0t0d0s7 zonecfg:newzone:fs> set raw=/dev/rdsk/c0t0d0s7 zonecfg:newzone:fs> set type=ufs zonecfg:newzone:fs> set options=noatime zonecfg:newzone:fs> end zonecfg:newzone> info fs dir=/var/tmp fs: dir: /var/tmp special: /dev/dsk/c0t0d0s7 raw: /dev/rdsk/c0t0d0s7 type: ufs options: [noatime] File systems loopback-mounted (via lofs) into a zone must be mounted with the -o nodevices option to prevent dev_t proliferation. 6.6.2. Size RestrictionsThe Zones infrastructure does not attempt to provide limits, through zone-wide quotas or otherwise, on how much disk space can be consumed by a zone. The global administrator is responsible for space restriction. Administrators interested in this functionality have a number of options, including the following:
6.6.3. File System-Specific IssuesThere are certain security restrictions on mounting certain file systems from within a zone, while other file systems exhibit special behavior when mounted in a zone. The modified file systems are summarized below.
6.6.4. File System Traversal IssuesRecall that a zone's file system namespace is a subset of that accessible from the global zone. Global zone processes accessing a zone's file system namespace can open up a host of problems on the system. Unprivileged processes in the global zone are prevented from traversing a non-global zone's file system hierarchy by insisting on the zone root's parent directory being owned, readable, writable, and executable by root only, and restricting access to directories exported by /proc (see Section 6.5.3). The following are highlighted as potential issues that are avoided by restricted access into the zone's file system namespace but that should be taken into account by the global administrator.
The following example illustrates the per-zone mnttab. global# zoneadm list -v ID NAME STATE PATH 0 global running / 100 my-zone running /aux0/my-zone global# cat /etc/mnttab /dev/dsk/c0t0d0s0 / ufs rw,intr,largefiles,logging,xattr,oner- ror=panic,suid,dev=800000 1028243575 /devices /devices devfs dev=9cbc0000 1028243566 /proc /proc proc dev=9cc00000 1028243572 mnttab /etc/mnttab mntfs dev=9ccc0000 1028243572 fd /dev/fd fd rw,suid,dev=9cd00001 1028243575 swap /var/run tmpfs xattr,dev=1 1028243596 swap /tmp tmpfs xattr,dev=2 1028243598 proc /aux0/my-zone/proc proc zone=my-zone,dev=9cc00000 1028570870 fd /aux0/my-zone/dev/fd fd rw,suid,dev=9cd00004 1028570870 /opt /aux0/my-zone/opt lofs rw,suid,dev=800000 1028570870 /sbin /aux0/my-zone/sbin lofs rw,suid,dev=800000 1028570870 swap /aux0/my-zone/tmp tmpfs xattr,dev=7 1028570870 swap /aux0/my-zone/var/run tmpfs xattr,dev=8 1028570870 mnttab /aux0/my-zone/etc/mnttab mntfs zone=my-zone,dev=9ccc0000 1028570870 taxman.eng:/web /aux0/my-zone/net/taxman.eng/web nfs intr,nosuid,grpid,xattr,dev=9cec0020 1028572145 jurassic.eng:/export/home14/ozgur /home/ozgur nfs intr,nosuid,noquota,xattr,dev=9cec0043 1028939560 global# cat /aux0/my-zone/etc/mnttab / / ufs rw,intr,largefiles,logging,xattr,onerror=panic,suid,dev=800000 1028243575 /usr /usr lofs rw,suid,dev=800000 1028243598 proc /proc proc zone=my-zone,dev=9cc00000 1028570870 fd /dev/fd fd rw,suid,dev=9cd00004 1028570870 /opt /opt lofs rw,suid,dev=800000 1028570870 /sbin /sbin lofs rw,suid,dev=800000 1028570870 swap /tmp tmpfs xattr,dev=7 1028570870 swap /var/run tmpfs xattr,dev=8 1028570870 mnttab /etc/mnttab mntfs zone=my-zone,dev=9ccc0000 1028570870 taxman.eng:/web /net/taxman.eng/web nfs intr,nosuid,grpid,xattr,dev=9cec0020 145 |
|
|