The FreeBSD Diary |
(TM) | Providing practical examples since 1998If you buy from Amazon USA, please support us by using this link. |
ZFS: upgrade
20 September 2010
|
Yesterday I upgraded my file server to the latest version of FreeBSD (8.1-STABLE #0: Sat Sep 18 23:43:48 EDT 2010) by building world and installing. My goal was to get a recently MFC'd feature related to scrubbing of pools. I tried to find the original commit message but failed. But Revision 211800 seems related. After upgrading, I then added daily_scrub_zfs_enable="YES" to /etc/periodic.conf. The next morning, I found this in my 'daily run output' email: Checking status of zfs pools: pool: storage state: ONLINE status: The pool is formatted using an older on-disk format. The pool can still be used, but some features are unavailable. action: Upgrade the pool using 'zpool upgrade'. Once this is done, the pool will no longer be accessible on older software versions. scrub: scrub in progress for 6h51m, 39.36% done, 10h33m to go config: NAME STATE READ WRITE CKSUM storage ONLINE 0 0 0 raidz2 ONLINE 0 0 0 gpt/disk01-live ONLINE 0 0 0 gpt/disk02-live ONLINE 0 0 0 gpt/disk03-live ONLINE 0 0 0 gpt/disk04-live ONLINE 0 0 0 gpt/disk05-live ONLINE 0 0 0 gpt/disk06-live ONLINE 0 0 0 gpt/disk07-live ONLINE 0 0 0 errors: No known data errors |
ZFS version
|
ZFS evolves. As a new version of ZFS is added to the operating system, the physical file format may change. Thus, your filesystem version may lag behind the OS, but it is still usable and operational. The main downside is not being able to use the latest and greatest ZFS features. For details on what you have installed: $ sudo zpool upgrade Password: This system is currently running ZFS pool version 15. The following pools are out of date, and can be upgraded. After being upgraded, these pools will no longer be accessible by older software versions. VER POOL --- ------------ 14 storage Use 'zpool upgrade -v' for a list of available versions and their associated features. Now let's see what we have available:: $ sudo zpool upgrade -v Password: This system is currently running ZFS pool version 15. The following versions are supported: VER DESCRIPTION --- -------------------------------------------------------- 1 Initial ZFS version 2 Ditto blocks (replicated metadata) 3 Hot spares and double parity RAID-Z 4 zpool history 5 Compression using the gzip algorithm 6 bootfs pool property 7 Separate intent log devices 8 Delegated administration 9 refquota and refreservation properties 10 Cache devices 11 Improved scrub performance 12 Snapshot properties 13 snapused property 14 passthrough-x aclinherit 15 user/group space accounting For more information on a particular version, including supported releases, see: http://www.opensolaris.org/os/community/zfs/version/N Where 'N' is the version number. $ |
Upgrading the pool
|
From man zpool: zpool upgrade [-V version] -a | pool ... Upgrades the given pool to the latest on-disk version. Once this is done, the pool will no longer be accessible on systems running older versions of the software. -a Upgrades all pools. -V version Upgrade to the specified version. If the -V flag is not specified, the pool is upgraded to the most recent version. This option can only be used to increase the version number, and only up to the most recent version supported by this software. When you upgrade ZFS, you cannot go back. If there is a problem, you're stuck with it. It is reasonable to be cautious here. Don't upgrade unless you need a new feature. That said, ZFS 15 went into FreeBSD on July 13 (according to this HEADS UP). So, here goes: [dan@kraken:~] $ sudo zpool upgrade -a Password: This system is currently running ZFS pool version 15. Successfully upgraded 'storage' [dan@kraken:~] $ This was pretty much a non-event. It took about 1.5 seconds I think.... Confirming the upgrade: $ sudo zpool upgrade This system is currently running ZFS pool version 15. All pools are formatted using this version. NOTE: after writing this, it was brought to my attention that the filesystem can be upgraded too. See the comments on this article for details. Oh... well, I guess there's not as much to this as I thought there might be. ZFS continues to exceed my expectations. |