Boot environment contents: /etc, /usr and /var filesystems #36
-
Thanks to Sithuk for the excellent Ubuntu-Server-ZFSbootmenu scripts. I have a question. According to the ZFSBootMenu Boot Environments Primer:
This seems to argue for the contents of /etc, /usr and /var to be included as datasets under What is the rationale for creating /usr, for instance, using If /usr were created using the latter method, snapshots of the entire boot environment could be taken using Is there a problem created by using the latter method? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 7 replies
-
The canmount=off property doesn't make a separate mountable filesystem. It is to establish inheritable properties for descendent file systems. So /usr and /var remain coupled with the system state. You can test this for yourself by cloning a snapshot a few times to create test boot environments (BE). Then create a test file in /usr and /var on each boot environment. Name them differently in each BE to allow for comparison. Then switch between the boot environments to check that the system state remains consistent. You can also test /var/lib/apt and /var/lib/dpkg if you have specific concerns about losing package manager consistency with the system state. Relevant man page entry:
The reason to create rpool/usr is to allow the creation of a persistent rpool/usr/local so that locally compiled software is persistent across boot environments. The approach is as per the OpenZFS root on zfs guide for Debian, which doesn't use zsys. Link below. |
Beta Was this translation helpful? Give feedback.
-
/var/lib is created with canmount=off. So it won't be separately mounted.
The script is currently setup to take snapshots of "$RPOOL"/ROOT. So your /var/nc_data would not be automatically snapshotted. You would need to configure that.
I recommend testing your setup in a VM first so you can confirm the behaviour is as you expect. Please let me know how you get on. |
Beta Was this translation helpful? Give feedback.
The canmount=off property doesn't make a separate mountable filesystem. It is to establish inheritable properties for descendent file systems. So /usr and /var remain coupled with the system state.
You can test this for yourself by cloning a snapshot a few times to create test boot environments (BE). Then create a test file in /usr and /var on each boot environment. Name them differently in each BE to allow for comparison. Then switch between the boot environments to check that the system state remains consistent. You can also test /var/lib/apt and /var/lib/dpkg if you have specific concerns about losing package manager consistency with the system state.
Relevant man page entry:
https://o…