Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Info working ZFS realisations #19

Open
f-andrey opened this issue Sep 22, 2019 · 4 comments
Open

Info working ZFS realisations #19

f-andrey opened this issue Sep 22, 2019 · 4 comments

Comments

@f-andrey
Copy link

May be you interesting in ZFS analog

https://docs.oracle.com/cd/E26502_01/html/E29031/beadm-1m.html (integrated grub, seems to have been https://launchpad.net/beadm)
https://github.com/vermaden/beadm
https://github.com/freebsd/freebsd/tree/master/sbin/bectl

https://is.gd/BECTL - presentation beadm and bectl

@laenion
Copy link
Collaborator

laenion commented Sep 23, 2019

Indeed, there seem to be a lot of similarities between beadm and transactional-update, just that beadm is using ZFS instead of Btrfs.
That said: ZFS has all the features required by transactional-update; even GRUB2 support for ZFS snapshots seems to be available. So if anybody is interested in implementing ZFS support please feel free to do so.

One thing I should note about the presentation: On page 40 it is claimed that a "complete system rollback, restoring the complete system to the identical state as it was in when a snapshot was taken, is not possible" with Btrfs / openSUSE. This is not a limitation of Btrfs, but an intentional design decision: If directories like /var would be part of the snapshot, then a rollback would roll back production data accumulated since taking the snapshot - which is most likely not what anybody would want. For that reason certain directories are excluded from the snapshot by creating separate subvolumes.

@f-andrey
Copy link
Author

Yes in ZFS BE save not all data, only content/datasets zroot/ROOT/ page 42-45
/var and /var/... very discussion, not all content not dependent, for example pkg base

@vermaden
Copy link

vermaden commented Sep 24, 2019

Hi,

author of https://github.com/vermaden/beadm and https://is.gd/BECTL presentation here.

For the record, I got similar question on my blog and this is the answer:
https://vermaden.wordpress.com/2018/11/15/zfs-boot-environments-reloaded-at-nluug-autumn-conference-2018/#comment-15782

I will copy it here so you will not have to visit my terrible blog :)

FreeBSD by default omits these dirs in ZFS Boot Environments protection:

  • /tmp
  • /usr/home
  • /usr/ports
  • /usr/src
  • /var/audit
  • /var/crash
  • /var/log
  • /var/mail
  • /var/tmp

So no real ‘data’ here besides /home (by default as /usr/home on FreeBSD) – but beadm(8) is here to protect the system and its services – not users data. So on FreeBSD besides users home directories WHOLE SYSTEM along with daemons/services/data is protected by default.

These are excludes from OpenSUSE Leap 15 Linux system:

  • /boot/grub2.*
  • /home
  • /opt
  • /var/opt
  • /srv
  • /usr/local
  • /tmp
  • /var/tmp
  • /var/log
  • /var/cache
  • /var/crash
  • /var/lib/libvirt/images
  • /var/lib/mailman
  • /var/spool
  • /var/lib/named
  • /var/lib/mariadb
  • /var/lib/mysql
  • /var/lib/pgqsl

This means that system can be screwed from the beginning (/boot/grub2.*) along with broken services/daemons/applications (/opt and /srv and /usr/local omitted). Not to mention ‘picky’ excludes for mariadb/mysql/pgsql dirs, why sqlite/db2/informix/mongodb/… directories are not omitted?

I am also curious what Ubuntu 19.10 will bring as it will be shipped with root on ZFS feature … but as I know the Linux world the /boot partition will be separate anyway with some ext4/xfs filesystem so the whole idea of protection of the whole system will be dead on day one.

Hope that helps.

Regards.

@laenion
Copy link
Collaborator

laenion commented Sep 24, 2019

Yes, that was me in the blog - of course I'm always interested in seeing how other systems are solving the same task :-)

Regarding the subvolume layout I should note that the above list for Leap is not up to date any more, I've opened https://bugzilla.opensuse.org/show_bug.cgi?id=1151714 to fix the documentation. We have a unified /var subvolume now.

Regarding /boot: When using Btrfs on openSUSE /boot will usually be part of the root file system for exactly that reason: Protect the system as a whole. The exception you are talking about is /boot/grub2/<arch>, which has to match the version installed into the MBR / EFI. Because of that, this, and only this, directory is created as a separate subvolume.

However for transactional-update all of this is not relevant: ZFS should provide all the necessary features required for transactional-update support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants