`<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Sep 18, 2016 at 9:55 AM, Richard Skelton <span dir="ltr"><<a href="mailto:skeltonr@btconnect.com" target="_blank">skeltonr@btconnect.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br>
I would like to create a zfs file system in my zone and create snapshots<br>
like I would in a global zone.<br>
In the zone I see:-<br>
root@fred5:/root# zfs list<br>
NAME USED AVAIL REFER MOUNTPOINT<br>
rpool 38.6G 93.2G 23.5K /rpool<br>
rpool/zones 2.94G 93.2G 19K /zones<br>
rpool/zones/fred5 1.85G 93.2G 19K /zones/fred5<br>
rpool/zones/fred5/ROOT 1.85G 93.2G 19K legacy<br>
rpool/zones/fred5/ROOT/zbe 1.85G 93.2G 1.85G legacy<br>
root@fred5:/root# ls /zones/fred5<br>
ls: cannot access '/zones/fred5': No such file or directory<br></blockquote><div><br></div><div>So the way it works is this: the dataset<br><br>rpool/zones/fred5/ROOT<br><br></div><div>is delegated to the zone. Anything above that is associated with the global zone;<br></div><div>that dataset or below is associated with the local zone. You get to see all the parents<br></div><div>in the hierarchy, with their mountpoints in their own context, which is a bit confusing.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
root@fred5:/root# zpool list<br>
NAME SIZE ALLOC FREE EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT<br>
rpool 136G 30.3G 106G - 19% 22% 1.00x ONLINE -<br>
root@fred5:/root#<br>
<br>
Before I install any optional software I would like to create a zfs file<br>
system and mount it on /opt in the zone.<br>
How can I do this?<br></blockquote><div><br></div><div>In this case, it could be:<br><br></div><div>zfs create -o mountpoint=/opt rpool/zones/fred5/ROOT/opt </div></div><br></div><div class="gmail_extra">However, I wouldn't normally do this. If I was creating datasets for use by a<br>zone, I would create a separate dataset such as rpool/fred5 in the global zone<br>(with mountpoint set to none), use 'add dataset' in the zone configuration to<br>delegate that dataset to the zone, and use that to create my own filesystems<br>in the zone. The aim being to separate my own data from that managed by the<br>operating system.<br><br></div><div class="gmail_extra">(Although the same issue of conflicts arises with the use of /opt, which the<br></div><div class="gmail_extra">OS might think it has control of. Creating /opt/local or /opt/company-name<br></div><div class="gmail_extra">one level down might be a better choice.)<br></div><div class="gmail_extra"><br>-- <br><div class="gmail_signature">-Peter Tribble<br><a href="http://www.petertribble.co.uk/" target="_blank">http://www.petertribble.co.uk/</a> - <a href="http://ptribble.blogspot.com/" target="_blank">http://ptribble.blogspot.com/</a></div>
</div></div>
`