ZFS implications for patching

A colleague of mine made an interesting comment today while we were getting a cup of tea. (We drink lots of tea in Patch Test, possibly because there is a big whiteboard near the kettle, or rather a kettle near a big whiteboard somewhere other than a meeting room…)

Anyway, the comment was about the future of patching now that ZFS is alive.

One thing that ZFS allows you to do is manage snapshots of your filesystem. A snapshot is described as a read only copy of the filesystem. Unlike a traditional backup which would require twice the space, a snapshot only get blocks of data copied over when they change on the live filesystem.

Writeable snapshots are called clones apparently (I’m new to ZFS ok!). Actually you clone an existing snapshot.

Finally there are the backup and restore options. You can create a full or incremental backup of a snapshot. Consequently you can restore a full directory or just the incremental changes.

What is interesting for patching is that in the future it may be possible to use ZFS to handle backing out patches. If you were to take a snapshot, then apply a patch, then the snapshot contains all the files that have changed since you applied the patch. Including all the metadata changes to the package database. You would then take a backup of that snapshot. To backout the patch, just restore this partial snapshot.

Thats an oversimplification. More care would be needed not to restore something that another patch had changed, like the pkginfo file of a package. But for such defined shared files (/var/sadm/pkg/*/pkginfo for example) it should be possible to write a tool to correctly merge the running and restored versions to correctly reflect the system state.

Everything you need to know about ZFS is linked from http://www.opensolaris.org/os/community/zfs/. Of particular interest are zfs(1M), one manpage is really all you need, and this pdf explains the basics of the filesystem, why its cool, and how it works – read this first.

Congratulations to the ZFS team! And I look forward to many lengthy email conversations when we have to generate patches for this!

Technorati Tag:

Technorati Tag:

Technorati Tag:

1 thought on “ZFS implications for patching”

  1. I am *really* looking forward to integration between ZFS and Live Upgrade. And between ZFS and zone creation. With ZFS, creating alternate boot environments or zones should take one, maybe two seconds even on a slow machine. This would be a huge improvement over the many minutes that it takes now.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top