zfs と zpool を upgrade2014年05月15日 13時25分20秒

ZFS をアップグレードしてみた。アップグレード自体は特に変わった事ではないが、やはりファイルシステムを弄るのは、慎重になるので、事例として。

zfs upgrade をおもむろに実行するとこうなる。


$ zfs upgrade
This system is currently running ZFS filesystem version 5.

The following filesystems are out of date, and can be upgraded.  After being
upgraded, these filesystems (and any 'zfs send' streams generated from
subsequent snapshots) will no longer be accessible by older software versions.


VER  FILESYSTEM
---  ------------
 1   bkup

zfs を更新する前に、zpool を更新するように言われる。bkup と言う名のプールを一つ作ってある。

zfs をそのまま更新しようと試みる。


$  zfs upgrade -r bkup
bkup: can not be upgraded; the pool version needs to first be upgraded
to version 24

が却下される。

今度は zpool upgrade


$  zpool upgrade
This system supports ZFS pool feature flags.

The following pools are formatted with legacy version numbers and can
be upgraded to use feature flags.  After being upgraded, these pools
will no longer be accessible by software that does not support feature
flags.

VER  POOL
---  ------------
 6   bkup

Use 'zpool upgrade -v' for a list of available legacy versions.
Every feature flags pool has all supported features enabled.

zpool upgrade だけでは説明だけ。未だに何もなされていない。

折角なので、各バージョンの説明を見ておく。


$  zpool upgrade -v
This system supports ZFS pool feature flags.
...
The following features are supported:

FEAT DESCRIPTION
-------------------------------------------------------------
async_destroy                         (read-only compatible)
     Destroy filesystems asynchronously.
empty_bpobj                           (read-only compatible)
     Snapshots use less space.
lz4_compress
     LZ4 compression algorithm support.

The following legacy versions are also 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
 16  stmf property support
 17  Triple-parity RAID-Z
 18  Snapshot user holds
 19  Log device removal
 20  Compression using zle (zero-length encoding)
 21  Deduplication  
 22  Received properties
 23  Slim ZIL
 24  System attributes
 25  Improved scrub stats
 26  Improved snapshot deletion performance
 27  Improved snapshot creation performance
 28  Multiple vdev replacements

For more information on a particular version, including supported releases,
see the ZFS Administration Guide.

プールは結構こまめに機能拡張されてきている。FreeBSD でも 10.0 だ。

今度は bkup プールを更新する。


$  zpool upgrade  bkup
This system supports ZFS pool feature flags.

Successfully upgraded 'bkup' from version 6 to feature flags.
Enabled the following features on 'bkup':
  async_destroy
  empty_bpobj
  lz4_compress

zpool はバージョン毎に単調増加だったが、Sun の手を離れた時に、一気に 5000 まで上げて、昨日毎にバージョンを割り当てる方式に変わったそうだ。

プールのバージョンを更新したので、zfs も更新できるようになった。業と、一ファイルシステムだけ更新してみる。


$  zfs upgrade bkup/sys
1 filesystems upgraded
$  zfs upgrade
VER  FILESYSTEM
---  ------------
 1   bkup/device
 1   bkup/home
 2   bkup/sys

一つだけ新しくなっているのが分かる。

今度は一気に更新する。


$ zfs upgrade -r bkup
3 filesystems upgraded
1 filesystems already at this version