[OmniOS-discuss] I would like to create a zfs file system in my zone

Volker A. Brandt vab at bb-c.de
Sun Sep 18 14:47:24 UTC 2016


Peter Tribble writes:
> On Sun, Sep 18, 2016 at 9:55 AM, Richard Skelton <skeltonr at btconnect.com>
> wrote:
>     Before I install any optional software I would like to create a zfs file
>     system and mount it on /opt in the zone.
>     How can I do this?
> 
> 
> In this case, it could be:
> 
> zfs create -o mountpoint=/opt rpool/zones/fred5/ROOT/opt

On Solaris 11, a "zfs create -o mountpoint=/opt rpool/opt"  will also
work.  (Can't test on OmniOS ATM as my OmniOS system is down.)

This has the advantage that the ZFS dataset will appear as "rpool/opt"
in the zone, and as "<zone root>/<zone name>/opt" in the global zone.

> However, I wouldn't normally do this. If I was creating datasets for use by a
> zone, I would create a separate dataset such as rpool/fred5 in the global zone
> (with mountpoint set to none), use 'add dataset' in the zone configuration to
> delegate that dataset to the zone, and use that to create my own filesystems
> in the zone. The aim being to separate my own data from that managed by the
> operating system.
> 
> (Although the same issue of conflicts arises with the use of /opt, which the
> OS might think it has control of. Creating /opt/local or /opt/company-name
> one level down might be a better choice.)

One thing to remember is that the directory /opt normally is part of the
zone root, and thus part of the managed boot environments (BEs).  If you
create a dataset and mount it under /opt (or /opt/local), it will not
be part of any BE.  If you then create IPS packages that install things
in /opt, you will run into inconsistencies in the package database when
you switch back and forth between BEs.


Regards -- Volker
-- 
------------------------------------------------------------------------
Volker A. Brandt               Consulting and Support for Oracle Solaris
Brandt & Brandt Computer GmbH                   WWW: http://www.bb-c.de/
Am Wiesenpfad 6, 53340 Meckenheim, GERMANY            Email: vab at bb-c.de
Handelsregister: Amtsgericht Bonn, HRB 10513              Schuhgröße: 46
Geschäftsführer: Rainer J.H. Brandt und Volker A. Brandt

"When logic and proportion have fallen sloppy dead"


More information about the OmniOS-discuss mailing list