Sunday, January 15, 2012

ZFS: Versioning


ZFS Versioning

Abstract:
Most operating systems support a type of file system to retain it's data. When newer versions of the file system are released, sometimes it is not clear to the user community. With ZFS, the ability to clearly see what the version exists and even a clear way to create older pool types for backwards compatibility and testing.

Article:
Bob Netherton at Oracle published a blog article recently discussing ZFS Versioning. It is well worth the read. Below are a few commands extracted from Bob's article.

Commands:
The "zpool" and "zfs" commands offer visibility to capabilities.

# 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.

# 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.
Capabilities:
As of Solaris Update 6, the following lists the zpool and zfs versions.

Solaris Release         ZPOOL Version ZFS Version
Solaris 10 10/08 (u6) 10 3
Solaris 10 5/09 (u7) 10 3
Solaris 10 10/09 (u8 15 4
Solaris 10 9/10 (u9) 22 4
Solaris 10 8/11 (u10) 29 5
Solaris 11 11/11 (ga) 33 5
Showing Versions:
A test pool can be made, in order to show the versions.

# zpool create testpool testdisk

# zpool get version testpool
NAME PROPERTY VALUE SOURCE
testpool version 31 default

# zfs get version testpool
NAME PROPERTY VALUE SOURCE
testpool version 5 -
Creating Older Pools:
Older pools can be created and versions validated.


# zpool destroy testpool
# zpool create -o version=15 -O version=4 testpool testdisk
# zfs create testpool/data

# zpool get version testpool
NAME PROPERTY VALUE SOURCE
testpool version 15 local

# zfs get -r version testpool
NAME PROPERTY VALUE SOURCE
testpool version 4 -
testpool/data version 4 -
Testing an Upgrade:
A version upgrade can be conducted and verified.

# zpool upgrade -V 29 testpool
This system is currently running ZFS pool version 31.

Successfully upgraded 'testpool' from version 15 to version 29

# zpool get version testpool
NAME PROPERTY VALUE SOURCE
testpool version 29 local

# zfs upgrade -V 5 testpool
1 filesystems upgraded

# zfs get -r version testpool
testpool version 5 -
testpool/data version 4 -
Upgrading Recursively:
While the base pool can be updated, it is most likely that file system under the pool needed to be upgraded. This can be done via the recursive option.

# zfs upgrade -V 5 -r testpool
1 filesystems upgraded
1 filesystems already at this version

# zfs get -r version testpool
NAME PROPERTY VALUE SOURCE
testpool version 5 -
testpool/data version 5 -

No comments:

Post a Comment