[OpenIndiana-discuss] local zones and local users

Maurilio Longo maurilio.longo at libero.it
Wed Nov 9 14:59:08 UTC 2016


Hi again,

so, next round against zones :)

Inside my local zone (named zone1) I have:

root at zone1:/root# zfs list
NAME                               USED  AVAIL  REFER  MOUNTPOINT
nas                                650G  13.4T    96K  /nas
nas/zones                          537M  13.4T    88K  /nas/zones
nas/zones/zone1                    537M  13.4T    88K  /nas/zones/zone1
nas/zones/zone1/ROOT               537M  13.4T    88K  legacy
nas/zones/zone1/ROOT/zbe           537M  13.4T   537M  legacy


So I've created export and export/home as zfs filesystems inside my local zone

root at zone1:/root# zfs create -o mountpoint=/export nas/zones/zone1/ROOT/export
root at zone1:/root# zfs create nas/zones/zone1/ROOT/export/home

and now I have

# zfs list
NAME                               USED  AVAIL  REFER  MOUNTPOINT
nas                                650G  13.4T    96K  /nas
nas/zones                          537M  13.4T    88K  /nas/zones
nas/zones/zone1                    537M  13.4T    88K  /nas/zones/zone1
nas/zones/zone1/ROOT               537M  13.4T    88K  legacy
nas/zones/zone1/ROOT/export        176K  13.4T    88K  /export
nas/zones/zone1/ROOT/export/home    88K  13.4T    88K  /export/home
nas/zones/zone1/ROOT/zbe           537M  13.4T   537M  legacy


and at this point I can add a local user to the zone with

root at zone1:/root# useradd -b /export/home -m -z maurilio
80 blocks
root at zone1:/root# zfs list
NAME                                        USED  AVAIL  REFER  MOUNTPOINT
nas                                         650G  13.4T    96K  /nas
nas/zones                                   537M  13.4T    88K  /nas/zones
nas/zones/zone1                             537M  13.4T    88K  /nas/zones/zone1
nas/zones/zone1/ROOT                        537M  13.4T    88K  legacy
nas/zones/zone1/ROOT/export                 292K  13.4T    88K  /export
nas/zones/zone1/ROOT/export/home            204K  13.4T    88K  /export/home
nas/zones/zone1/ROOT/export/home/maurilio   116K  13.4T   116K 
/export/home/maurilio
nas/zones/zone1/ROOT/zbe                    537M  13.4T   537M  legacy


Which is similar to a global zone's hierarchy and gives me a local user which 
is not root.

I did try to create the export filesystem as child of nas/zones/zone1 but I 
can't, I get a permission denied error.

Now, just to be sure, am I the only one who tries/wants to proceed like this?

I've found several examples related to Solaris 11 where the global zone's 
/export/home is imported via zonecfg inside the local zone, but I'm still 
unable to find an example where export/home is created inside a local zone's 
root fs.

Any confirmation will be appreciated.

Regards

Maurilio.



Maurilio Longo via openindiana-discuss wrote:
> 2) my local zone has a /home directory and an /export directory but it 
> hasn't
> got the export/home zfs filesystem that I have on every rpool so when I 
> try to
> issue a:
> 
>     useradd -m local-user
> 
> I get an error "unable to create the home directory. Operation non 
> applicable".
> 
> What is the "correct" or preferred way to proceed?
> 
> Can I/should I create, inside my local zone, an export/home zfs filesystem,
> mount it onto /export and then add the user?
> 
> Or is it better to mount the global zone's /export/home inside the local 
> zone
> (adding an fs with zonecfg) to have a place where I can create local 
> user's homes?
> 
-- 
  __________
|  |  | |__| Maurilio Longo
|_|_|_|____|




More information about the openindiana-discuss mailing list