ZFS /usr/local/www & boot-environments

Do you think /usr/local/www belongs to the boot-environment or should it be a separate dataset.
What do you think ?
A php or html file does not change that often like the contents of a database.
 
It all depends on your specific needs.
But if it holds your public facing website, then yes, my opinion it should be a separate dataset.
 
Do you think /usr/local/www belongs to the boot-environment
absolutely not! nothing under /usr/local belongs in the BE! The BE should only ever hold the base system.

Don't fiddle with the default structure for the root-dataset when using BEs unless you _REALLY_ know what you are doing and want to achieve with that.

If you want an extra safeguard before doing major upgrades, just snapshot the whole pool and/or use zfs checkpoints.

edit: fixed /usr -> /usr/local
 
Why a separate dataset when public and not private ?
Public, private, no matter.
Basically:
Something should be part of a Boot Environment if it needs to rollback with kernel/userland.

A webserver, a database, logfiles, ports tree, home directories, source tree: typically you do not want these to roll back.
Kernel, boot loader, userland, installed packages/ports: typically these you do want to roll back.

I'm going to disagree a little with sko: it depends what under /usr/ A lot of the base system outside of the kernel actually installs in /usr, like /usr/bin, /usr/sbin, /usr/lib, heck even /usr/local is under the /usr dataset.

So a default install to ZFS, Boot Environments will contain anything under /usr unless it has a separate dataset.
/usr/home is a dataset
/usr/ports is a dataset
/usr/src is a dataset
They are not part of a boot environment.
 
With this info I've set two new datasets,
/usr/local with canmount=off
/usr/local/www with canmount=on
PS: it seems there is nothing in /var/www
 
Be careful with /usr/local: you may have ports/packages that call things at startup, so check your /etc/rc.conf for things "enabled".
look at what's in /usr/local/etc/rc.d, see if you need any of them like cupsd, openntpd,etc.
 
True, i've found some ports write into /usr/local/etc like ssh stuff and so.
This is stuff you want to backup.
I'll take a snapshot of /usr/local which includes /usr/local/etc
 
True, i've found some ports write into /usr/local/etc like ssh stuff and so.
This is stuff you want to backup.
Exactly.

The default datasets after an install are reasonable for most of the users.
Since most people don't set up a webserver on their machines, not having a separate dataset for /usr/local/www is not a big deal. People setting up a webserver may actually their webservers in a different location, perhaps even jails.

It never hurts to periodically reevaluate what datasets you have and use, but just always be aware that you could break things.
 
This is my current setup,
Code:
ZT/ROOT                                               48.3G   185G       96K  none
ZT/ROOT/default                                       48.3G   185G     13.6G  legacy
ZT/ROOT/default/nosnapshot                            3.79G   185G       96K  none
ZT/ROOT/default/nosnapshot/ccache                     1.84G   185G     1.84G  /ccache
ZT/ROOT/default/nosnapshot/xcache                     1.95G   185G     1.95G  /usr/home/x/.cache
ZT/ROOT/default/usr                                   24.5G   185G       96K  none
ZT/ROOT/default/usr/home                              3.28G   185G     3.25G  /usr/home
ZT/ROOT/default/usr/local                             13.8G   185G     13.5G  /usr/local
ZT/ROOT/default/usr/local/www                          175M   185G      175M  /usr/local/www
ZT/ROOT/default/usr/obj                               5.33G   185G     5.33G  /usr/obj
ZT/ROOT/default/usr/ports                              392K   185G      120K  /usr/ports
ZT/ROOT/default/usr/ports/distfiles                    176K   185G      176K  /usr/ports/distfiles
ZT/ROOT/default/usr/ports/packages                      96K   185G       96K  /usr/ports/packages
ZT/ROOT/default/usr/src                               2.05G   185G     2.05G  /usr/src
ZT/ROOT/default/var                                   5.79G   185G       96K  none
ZT/ROOT/default/var/audit                               96K   185G       96K  /var/audit
ZT/ROOT/default/var/cache                             5.32G   185G     5.31G  /var/cache
ZT/ROOT/default/var/cache/netdata                     3.59M   185G     3.59M  /var/cache/netdata
ZT/ROOT/default/var/crash                               96K   185G       96K  /var/crash
ZT/ROOT/default/var/db                                 457M   185G       96K  none
ZT/ROOT/default/var/db/mongodb                        39.1M   185G     39.1M  /var/db/mongodb
ZT/ROOT/default/var/db/mysql                          1.63M   185G     1.48M  /var/db/mysql
ZT/ROOT/default/var/db/mysql/dbx1                      152K   185G      152K  /var/db/mysql/dbx1
ZT/ROOT/default/var/db/netdata                         288K   185G      288K  /var/db/netdata
ZT/ROOT/default/var/db/postgres                        416M   185G      416M  /var/db/postgres
ZT/ROOT/default/var/db/redis                           100K   185G      100K  /var/db/redis
ZT/ROOT/default/var/db/sqlite                           96K   185G       96K  none
ZT/ROOT/default/var/games                              104K   185G      104K  /var/games
ZT/ROOT/default/var/log                               19.3M   185G     19.3M  /var/log
ZT/ROOT/default/var/mail                               168K   185G      168K  /var/mail
ZT/ROOT/default/var/spool                             4.17M   185G     4.17M  /var/spool
ZT/ROOT/default/var/www                                 96K   185G       96K  /var/www
 
I'm going to disagree a little with [FONT=monospace]sko[/FONT]: it depends what under /usr/ A lot of the base system outside of the kernel actually installs in /usr, like /usr/bin, /usr/sbin, /usr/lib, heck even /usr/local is under the /usr dataset.
yes, of course those belong into the BE and are by default, so you shouldn't play with that default layout. what I initially meant (and fixed now) was /usr/local; shouldn't send a post in a hurry without reading it again...
 
Do you think /usr/local/www belongs to the boot-environment
absolutely not! nothing under /usr/local belongs in the BE! The BE should only ever hold the base system.

Don't fiddle with the default structure for the root-dataset when using BEs unless you _REALLY_ know what you are doing and want to achieve with that.

If you want an extra safeguard before doing major upgrades, just snapshot the whole pool and/or use zfs checkpoints.

edit: fixed /usr -> /usr/local
/usr/local is part of BE and fortunately. Because a BE (with default datasets) isn't only intended to recover a base system problem but also any third-party program mess.

Code:
$ zfs list -o name,canmount,mountpoint
NAME                CANMOUNT  MOUNTPOINT
zroot                     on  /zroot
zroot/ROOT                on  none
zroot/ROOT/av-rem     noauto  /
zroot/ROOT/default    noauto  /
zroot/tmp                 on  /tmp
zroot/usr                off  /usr
zroot/usr/home            on  /usr/home
zroot/usr/ports           on  /usr/ports
zroot/usr/src             on  /usr/src
zroot/var                off  /var
zroot/var/audit           on  /var/audit
zroot/var/crash           on  /var/crash
zroot/var/log             on  /var/log
zroot/var/mail            on  /var/mail
zroot/var/tmp             on  /var/tmp
Only the mounted datasets aren't saved in the BE system. mer said all about this.
 
I have canmount=off on,
Code:
zfs list -o name,canmount,mountpoint | grep ZT | grep -v poudriere | grep -v "@" | grep off
Code:
ZT                                                    off       none
ZT/ROOT                                               off       none
ZT/ROOT/default/nosnapshot                            off       none
ZT/ROOT/default/usr                                   off       none
ZT/ROOT/default/var                                   off       none
ZT/ROOT/default/var/db                                off       none
 
Back
Top