Tuesday Nov 30, 2010

Upgrading ZFS

Upgrading to the latest release of Solaris doesn't automatically upgrade your existing ZFS pools and datasets. So if you're trying to take advantage of cool new features like dedup and crypto on those datasets, you'll have to update ZFS first.

Upgrading Your ZFS Pools

Beware - upgrading your root ZFS pool will essentially invalidate your prior boot environments as you will no longer be able to boot into them.

The version property will tell where you're currently at:

bleonard@opensolaris:~$ zpool get version rpool
NAME   PROPERTY  VALUE    SOURCE
rpool  version   14       local

And the -v (lower case) option will tell you what's available:

bleonard@opensolaris:~$ zpool upgrade -v
This system is currently running ZFS pool version 31.

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
 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
 29  RAID-Z/mirror hybrid allocator
 30  Encryption
 31  Improved 'zfs list' performance

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

You can move to any version you'd like using the -V (upper case) option, however, I'm just going to move the the latest and greatest:
bleonard@opensolaris:~$ pfexec zpool upgrade rpool
This system is currently running ZFS pool version 31.

Successfully upgraded 'rpool' from version 14 to version 31

Just to verify the upgrade:

bleonard@opensolaris:~$ zpool get version rpool
NAME   PROPERTY  VALUE    SOURCE
rpool  version   31       default

Upgrading Your ZFS Datasets

The process is very similar. First, if you're interested in the version you're current at:

bleonard@opensolaris:~$ zfs get version rpool
NAME   PROPERTY  VALUE    SOURCE
rpool  version   3        -

Then to see what's available:

bleonard@opensolaris:~$ zfs upgrade -v
The following filesystem versions are supported:

VER  DESCRIPTION
---  --------------------------------------------------------
 1   Initial ZFS filesystem version
 2   Enhanced directory entries
 3   Case insensitive and File system unique identifier (FUID)
 4   userquota, groupquota properties
 5   System attributes

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

I'm going to upgrade all the file systems at once. However, there is the option to upgrade just a particular file system, for example:

bleonard@opensolaris:~$ pfexec zfs upgrade rpool/export/home
1 filesystems upgraded 

Or a file system and its descendants:

bleonard@opensolaris:~$ pfexec zfs upgrade -r rpool/export
1 filesystems upgraded
1 filesystems already at this version

But to simply upgrade all:

bleonard@opensolaris:~$ pfexec zfs upgrade -a
25 filesystems upgraded
2 filesystems already at this version

This process may take several minutes to complete, depending of the number file systems that need to be upgraded.

About

The Observatory is a blog for users of Oracle Solaris. Tune in here for tips, tricks and more as we explore the Solaris operating system from Oracle.

Connect with Oracle Solaris:


Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today