Solaris ZFS Administration Guide

The contents of this Documentation are subject to the Public Documentation License Version 1.01 (the "License"); you may only use this Documentation if you comply with the terms of this License. A copy of the License is available at http://www.opensolaris.org/os/community/documentation/license.

Sun Microsystems, Inc. has intellectual property rights relating to technology embodied in the product that is described in this document. In particular, and without limitation, these intellectual property rights may include one or more U.S. patents or pending patent applications in the U.S. and in other countries.

U.S. Government Rights – Commercial software. Government users are subject to the Sun Microsystems, Inc. standard license agreement and applicable provisions of the FAR and its supplements.

This distribution may include materials developed by third parties.

Parts of the product may be derived from Berkeley BSD systems, licensed from the University of California. UNIX is a registered trademark in the U.S. and other countries, exclusively licensed through X/Open Company, Ltd.

Sun, Sun Microsystems, the Sun logo, the Solaris logo, the Java Coffee Cup logo, docs.sun.com, Java, and Solaris are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. All SPARC trademarks are used under license and are trademarks or registered trademarks of SPARC International, Inc. in the U.S. and other countries. Products bearing SPARC trademarks are based upon an architecture developed by Sun Microsystems, Inc. Legato NetWorker is a trademark or registered trademark of Legato Systems, Inc.

The OPEN LOOK and Sun™ Graphical User Interface was developed by Sun Microsystems, Inc. for its users and licensees. Sun acknowledges the pioneering efforts of Xerox in researching and developing the concept of visual or graphical user interfaces for the computer industry. Sun holds a non-exclusive license from Xerox to the Xerox Graphical User Interface, which license also covers Sun's licensees who implement OPEN LOOK GUIs and otherwise comply with Sun's written license agreements.

Products covered by and information contained in this publication are controlled by U.S. Export Control laws and may be subject to the export or import laws in other countries. Nuclear, missile, chemical or biological weapons or nuclear maritime end uses or end users, whether direct or indirect, are strictly prohibited. Export or reexport to countries subject to U.S. embargo or to entities identified on U.S. export exclusion lists, including, but not limited to, the denied persons and specially designated nationals lists is strictly prohibited.

DOCUMENTATION IS PROVIDED “AS IS” AND ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD TO BE LEGALLY INVALID.

Sun Microsystems, Inc. détient les droits de propriété intellectuelle relatifs à la technologie incorporée dans le produit qui est décrit dans ce document. En particulier, et ce sans limitation, ces droits de propriété intellectuelle peuvent inclure un ou plusieurs brevets américains ou des applications de brevet en attente aux Etats-Unis et dans d'autres pays.

Cette distribution peut comprendre des composants développés par des tierces personnes.

Certaines composants de ce produit peuvent être dérivées du logiciel Berkeley BSD, licenciés par l'Université de Californie. UNIX est une marque déposée aux Etats-Unis et dans d'autres pays; elle est licenciée exclusivement par X/Open Company, Ltd.

Sun, Sun Microsystems, le logo Sun, le logo Solaris, le logo Java Coffee Cup, docs.sun.com, Java et Solaris sont des marques de fabrique ou des marques déposées de Sun Microsystems, Inc. aux Etats-Unis et dans d'autres pays. Toutes les marques SPARC sont utilisées sous licence et sont des marques de fabrique ou des marques déposées de SPARC International, Inc. aux Etats-Unis et dans d'autres pays. Les produits portant les marques SPARC sont basés sur une architecture développée par Sun Microsystems, Inc. Legato NetWorker is a trademark or registered trademark of Legato Systems, Inc.

L'interface d'utilisation graphique OPEN LOOK et Sun a été développée par Sun Microsystems, Inc. pour ses utilisateurs et licenciés. Sun reconnaît les efforts de pionniers de Xerox pour la recherche et le développement du concept des interfaces d'utilisation visuelle ou graphique pour l'industrie de l'informatique. Sun détient une licence non exclusive de Xerox sur l'interface d'utilisation graphique Xerox, cette licence couvrant également les licenciés de Sun qui mettent en place l'interface d'utilisation graphique OPEN LOOK et qui, en outre, se conforment aux licences écrites de Sun.

Les produits qui font l'objet de cette publication et les informations qu'il contient sont régis par la legislation américaine en matière de contrôle des exportations et peuvent être soumis au droit d'autres pays dans le domaine des exportations et importations. Les utilisations finales, ou utilisateurs finaux, pour des armes nucléaires, des missiles, des armes chimiques ou biologiques ou pour le nucléaire maritime, directement ou indirectement, sont strictement interdites. Les exportations ou réexportations vers des pays sous embargo des Etats-Unis, ou vers des entités figurant sur les listes d'exclusion d'exportation américaines, y compris, mais de manière non exclusive, la liste de personnes qui font objet d'un ordre de ne pas participer, d'une façon directe ou indirecte, aux exportations des produits ou des services qui sont régis par la legislation américaine en matière de contrôle des exportations et la liste de ressortissants spécifiquement designés, sont rigoureusement interdites.

LA DOCUMENTATION EST FOURNIE "EN L'ETAT" ET TOUTES AUTRES CONDITIONS, DECLARATIONS ET GARANTIES EXPRESSES OU TACITES SONT FORMELLEMENT EXCLUES, DANS LA MESURE AUTORISEE PAR LA LOI APPLICABLE, Y COMPRIS NOTAMMENT TOUTE GARANTIE IMPLICITE RELATIVE A LA QUALITE MARCHANDE, A L'APTITUDE A UNE UTILISATION PARTICULIERE OU A L'ABSENCE DE CONTREFACON.

May 2006

Abstract

This book is intended for anyone responsible for setting up and administering ZFS file systems. Topics are described for both SPARC™ and x86 based systems, where appropriate.


Table of Contents

Preface
Who Should Use This Book
How This Book Is Organized
Related Books
Documentation, Support, and Training
Typographic Conventions
Shell Prompts in Command Examples
1. Solaris ZFS File System (Introduction)
What's New in ZFS?
Using ZFS to Clone Non-Global Zones and Other Enhancements
ZFS Backup and Restore Commands are Renamed
Recovering Destroyed Storage Pools
ZFS is Integrated With Fault Manager
New zpool clear Command
Compact NFSv4 ACL Format
File System Monitoring Tool (fsstat)
ZFS Web-Based Management
What Is ZFS?
ZFS Pooled Storage
Transactional Semantics
Checksums and Self-Healing Data
Unparalleled Scalability
ZFS Snapshots
Simplified Administration
ZFS Terminology
ZFS Component Naming Requirements
2. Getting Started With ZFS
ZFS Hardware and Software Requirements and Recommendations
Creating a Basic ZFS File System
Creating a ZFS Storage Pool
Creating a ZFS File System Hierarchy
3. ZFS and Traditional File System Differences
ZFS File System Granularity
ZFS Space Accounting
Out of Space Behavior
Mounting ZFS File Systems
Traditional Volume Management
New Solaris ACL Model
4. Managing ZFS Storage Pools
Components of a ZFS Storage Pool
Using Disks in a ZFS Storage Pool
Using Files in a ZFS Storage Pool
Virtual Devices in a Storage Pool
Replication Features of a ZFS Storage Pool
Mirrored Storage Pool Configuration
RAID-Z Storage Pool Configuration
Self-Healing Data in a Replicated Configuration
Dynamic Striping in a Storage Pool
Creating and Destroying ZFS Storage Pools
Creating a ZFS Storage Pool
Handling ZFS Storage Pool Creation Errors
Destroying ZFS Storage Pools
Managing Devices in ZFS Storage Pools
Adding Devices to a Storage Pool
Attaching and Detaching Devices in a Storage Pool
Onlining and Offlining Devices in a Storage Pool
Clearing Storage Pool Devices
Replacing Devices in a Storage Pool
Querying ZFS Storage Pool Status
Basic ZFS Storage Pool Information
ZFS Storage Pool I/O Statistics
Health Status of ZFS Storage Pools
Migrating ZFS Storage Pools
Preparing for ZFS Storage Pool Migration
Exporting a ZFS Storage Pool
Determining Available Storage Pools to Import
Finding ZFS Storage Pools From Alternate Directories
Importing ZFS Storage Pools
Recovering Destroyed ZFS Storage Pools
Upgrading ZFS Storage Pools
5. Managing ZFS File Systems
Creating and Destroying ZFS File Systems
Creating a ZFS File System
Destroying a ZFS File System
Renaming a ZFS File System
ZFS Properties
Read-Only ZFS Properties
Settable ZFS Properties
Querying ZFS File System Information
Listing Basic ZFS Information
Creating Complex ZFS Queries
Managing ZFS Properties
Setting ZFS Properties
Inheriting ZFS Properties
Querying ZFS Properties
Querying ZFS Properties for Scripting
Mounting and Sharing ZFS File Systems
Managing ZFS Mount Points
Mounting ZFS File Systems
Temporary Mount Properties
Unmounting ZFS File Systems
Sharing ZFS File Systems
ZFS Quotas and Reservations
Setting Quotas on ZFS File Systems
Setting Reservations on ZFS File Systems
6. Working With ZFS Snapshots and Clones
ZFS Snapshots
Creating and Destroying ZFS Snapshots
Displaying and Accessing ZFS Snapshots
Rolling Back to a ZFS Snapshot
ZFS Clones
Creating a ZFS Clone
Destroying a ZFS Clone
Saving and Restoring ZFS Data
Saving ZFS Data With Other Backup Products
Saving a ZFS Snapshot
Restoring a ZFS Snapshot
Remote Replication of ZFS Data
7. Using ACLs to Protect ZFS Files
New Solaris ACL Model
Syntax Descriptions for Setting ACLs
ACL Inheritance
ACL Property Modes
Setting ACLs on ZFS Files
Setting and Displaying ACLs on ZFS Files in Verbose Format
Setting ACL Inheritance on ZFS Files in Verbose Format
Setting and Displaying ACLs on ZFS Files in Compact Format
8. ZFS Advanced Topics
Emulated Volumes
Emulated Volumes as Swap or Dump Devices
Using ZFS on a Solaris System With Zones Installed
Adding ZFS File Systems to a Non-Global Zone
Delegating Datasets to a Non-Global Zone
Adding ZFS Volumes to a Non-Global Zone
Using ZFS Storage Pools Within a Zone
Property Management Within a Zone
Understanding the zoned Property
ZFS Alternate Root Pools
Creating ZFS Alternate Root Pools
Importing Alternate Root Pools
ZFS Rights Profiles
9. ZFS Troubleshooting and Data Recovery
ZFS Failure Modes
Missing Devices in a ZFS Storage Pool
Damaged Devices in a ZFS Storage Pool
Corrupted ZFS Data
Checking ZFS Data Integrity
Data Repair
Data Validation
Controlling ZFS Data Scrubbing
Identifying Problems in ZFS
Determining if Problems Exist in a ZFS Storage Pool
Understanding zpool status Output
System Reporting of ZFS Error Messages
Repairing a Damaged ZFS Configuration
Repairing a Missing Device
Physically Reattaching the Device
Notifying ZFS of Device Availability
Repairing a Damaged Device
Determining the Type of Device Failure
Clearing Transient Errors
Replacing a Device in a ZFS Storage Pool
Repairing Damaged Data
Identifying the Type of Data Corruption
Repairing a Corrupted File or Directory
Repairing ZFS Storage Pool-Wide Damage
Repairing an Unbootable System
Index

List of Tables

1. Typographic Conventions
2. Shell Prompts
5.1. ZFS Property Descriptions
5.2. Types of ZFS Datasets
5.3. Possible SOURCE Values (zfs get)
7.1. ACL Entry Types
7.2. ACL Access Privileges
7.3. ACL Inheritance Flags

List of Examples

7.1. Modifying Trivial ACLs on ZFS Files
7.2. Setting Explicit ACLs on ZFS Files
7.3. ACL Interaction With Permissions on ZFS Files
7.4. Restoring Trivial ACLs on ZFS Files
7.5. Default ACL Inheritance
7.6. Granting ACL Inheritance on Files and Directories
7.7. ACL Inheritance With ACL Mode Set to Passthrough
7.8. ACL Inheritance With ACL Mode Set to Discard
7.9. ACL Inheritance With ACL Inherit Mode Set to Noallow
7.10. Setting and Displaying ACLs in Compact Format