0% found this document useful (0 votes)
489 views

ZFS Solaris Command Line Reference (Cheat Sheet)

The document provides a reference cheat sheet of common ZFS command line commands in Solaris for managing ZFS pools, file systems, snapshots, clones and more. It lists commands for creating, destroying, mounting, sharing, taking snapshots and sending/receiving them for backup. It also covers commands for pool I/O statistics, maintenance tasks and importing/exporting pools.

Uploaded by

RAZU
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
489 views

ZFS Solaris Command Line Reference (Cheat Sheet)

The document provides a reference cheat sheet of common ZFS command line commands in Solaris for managing ZFS pools, file systems, snapshots, clones and more. It lists commands for creating, destroying, mounting, sharing, taking snapshots and sending/receiving them for backup. It also covers commands for pool I/O statistics, maintenance tasks and importing/exporting pools.

Uploaded by

RAZU
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

1/11/2017 Solaris 

ZFS command line reference (Cheat sheet)

THE GEEK DIARY SOLARIS VXVM VCS LINUX INTERVIEW QUESTIONS ORACLE

BLOG POST

The Geek Diary  ➢  Solaris  ➢  ZFS  ➢  Solaris ZFS command line reference (Cheat sheet)

Solaris ZFS command line reference (Cheat sheet)

Pool Related Commands

# zpool create datapool c0t0d0 Create a basic pool named datapool

# zpool create ­f datapool c0t0d0 Force the creation of a pool

# zpool create ­m /data datapool c0t0d0 Create a pool with a different mount point than the
default.

# zpool create datapool raidz c3t0d0 c3t1d0 c3t2d0 Create RAID­Z vdev pool

# zpool add datapool raidz c4t0d0 c4t1d0 c4t2d0 Add RAID­Z vdev to pool datapool

# zpool create datapool raidz1 c0t0d0 c0t1d0 Create RAID­Z1 pool
c0t2d0 c0t3d0 c0t4d0 c0t5d0

# zpool create datapool raidz2 c0t0d0 c0t1d0 Create RAID­Z2 pool
c0t2d0 c0t3d0 c0t4d0 c0t5d0

# zpool create datapool mirror c0t0d0 c0t5d0 Mirror c0t0d0 to c0t5d0

# zpool create datapool mirror c0t0d0 c0t5d0 disk c0t0d0 is mirrored with c0t5d0 and disk
mirror c0t2d0 c0t4d0 c0t2d0 is mirrored withc0t4d0

# zpool add datapool mirror c3t0d0 c3t1d0 Add new mirrored vdev to datapool

# zpool add datapool spare c1t3d0 Add spare device c1t3d0 to the datapool

## zpool create ­n geekpool c1t3d0 Do a dry run on pool creation

Show Pool Information

# zpool status ­x Show pool status

# zpool status ­v datapool Show individual pool status in verbose mode

# zpool list Show all the pools

# zpool list ­o name,size Show particular properties of all the pools (here, name and size)

http://thegeekdiary.com/solaris­zfs­command­line­reference­cheat­sheet/ 1/6
1/11/2017 Solaris ZFS command line reference (Cheat sheet)

# zpool list ­Ho name Show all pools without headers and columns

File-system/Volume related commands

# zfs create datapool/fs1 Create file­system fs1 under datapool

# zfs create ­V 1gb datapool/vol01 Create 1 GB volume (Block device) in datapool

# zfs destroy ­r datapool destroy datapool and all datasets under it.

# zfs destroy ­fr datapool/data destroy file­system or volume (data) and all related snapshots

Set ZFS file system properties

# zfs set quota=1G datapool/fs1 Set quota of 1 GB on filesystem fs1

# zfs set reservation=1G datapool/fs1 Set Reservation of 1 GB on filesystem fs1

# zfs set mountpoint=legacy Disable ZFS auto mounting and enable mounting through
datapool/fs1 /etc/vfstab.

# zfs set sharenfs=on datapool/fs1 Share fs1 as NFS

# zfs set compression=on Enable compression on fs1
datapool/fs1

File-system/Volume related commands

# zfs create datapool/fs1 Create file­system fs1 under datapool

# zfs create ­V 1gb datapool/vol01 Create 1 GB volume (Block device) in datapool

# zfs destroy ­r datapool destroy datapool and all datasets under it.

# zfs destroy ­fr datapool/data destroy file­system or volume (data) and all related snapshots

Show file system info

# zfs list List all ZFS file system

# zfs get all datapool” List all properties of a ZFS file system

Mount/Umount Related Commands

# zfs set mountpoint=/data datapool/fs1 Set the mount­point of file system fs1 to /data

# zfs mount datapool/fs1 Mount fs1 file system

# zfs umount datapool/fs1 Umount ZFS file system fs1

# zfs mount ­a Mount all ZFS file systems

http://thegeekdiary.com/solaris­zfs­command­line­reference­cheat­sheet/ 2/6
1/11/2017 Solaris ZFS command line reference (Cheat sheet)

# zfs umount ­a Umount all ZFS file systems

ZFS I/O performance

# zpool iostat 2 Display ZFS I/O Statistics every 2 seconds

# zpool iostat ­v 2 Display detailed ZFS I/O statistics every 2 seconds

ZFS maintenance commands

# zpool scrub datapool Run scrub on all file systems under data pool

# zpool offline ­t datapool c0t0d0 Temporarily offline a disk (until next reboot)

# zpool online Online a disk to clear error count

# zpool clear Clear error count without a need to the disk

Import/Export Commands

# zpool import List pools available for import

# zpool import ­a Imports all pools found in the search directories

# zpool import ­d To search for pools with block devices not located in /dev/dsk

# zpool import ­d /zfs datapool Search for a pool with block devices created in /zfs

# zpool import oldpool newpool Import a pool originally named oldpool under new name newpool

# zpool import 3987837483 Import pool using pool ID

# zpool export datapool Deport a ZFS pool named mypool

# zpool export ­f datapool Force the unmount and deport of a ZFS pool

Snapshot Commands
Combine the send and receive operation

# zfs snapshot datapool/fs1@12jan2014 Create a snapshot named 12jan2014 of the fs1
filesystem

# zfs list ­t snapshot List snapshots

# zfs rollback ­r datapool/fs1@10jan2014 Roll back to 10jan2014 (recursively destroy
intermediate snapshots)

# zfs rollback ­rf datapool/fs1@10jan2014 Roll back must and force unmount and remount

# zfs destroy datapool/fs1@10jan2014 Destroy snapshot created earlier

http://thegeekdiary.com/solaris­zfs­command­line­reference­cheat­sheet/ 3/6
1/11/2017 Solaris ZFS command line reference (Cheat sheet)

# zfs send datapool/fs1@oct2013 > Take a backup of ZFS snapshot locally
/geekpool/fs1/oct2013.bak
# zfs receive anotherpool/fs1 < Restore from the snapshot backup backup taken
/geekpool/fs1/oct2013.bak

# zfs send datapool/fs1@oct2013 | zfs receive
anotherpool/fs1

# zfs send datapool/fs1@oct2013 | ssh node02 “zfs Send the snapshot to a remote system node02
receive testpool/testfs”

Clone Commands

# zfs clone datapool/fs1@10jan2014 /clones/fs1 Clone an existing snapshot

# zfs destroy datapool/fs1@10jan2014 Destroy clone

SHARE THIS

Facebook Twitter Google+ Buffer Pin It Email

Filed Under: ZFS

Some more articles you might also be interested in …


1. How to replace a disk under ZFS in Solaris
2. How To Use ‘zpool split’ to Split rpool in solaris 11 (SPARC)
3. How to add Additional Storage Space Created from Dynamic LUN Expansion in ZFS
online
4. How to install a ZFS boot block in solaris
5. How To Delete Files on a ZFS Filesystem that is 100% Full
6. How To Use ‘zpool split’ to Split rpool in solaris 11 (x86/x64)
7. ZFS Tutorials : Creating ZFS snapshot and clones
8. Solaris ZFS : How to import 2 pools that have the same names
9. How to mount the zfs rpool while booted from CD [SPARC]
10. How to find zpool version and filesystem version in Solaris

About Sandeep
India based Unix Admin, Cloud Evangelist and a
Virtualization lover. I am Sandeep Patil. I work as a Unix

http://thegeekdiary.com/solaris­zfs­command­line­reference­cheat­sheet/ 4/6
1/11/2017 Solaris ZFS command line reference (Cheat sheet)

Administrator and love playing around with Linux, Solaris
and various other virtualization and HA solutions. The
Geek Diary blog is all about howtos, basics and concepts
on various Linux/UNIX related topics. I hope you find the
blog useful. 
Follow The blog On : Twitter, Facebook, Google+

Search this website …

Enter your email here

SIGN UP NOW

 
737 182
Fans Followers

 
513 295
Subscribers Followers

CHEAT SHEETS SOLARIS INTERVIEW QUESTIONS

LDOMs (OVM for SPARC) Command line The ultimate Solaris Volume Manager (SVM)
reference interview questions

http://thegeekdiary.com/solaris­zfs­command­line­reference­cheat­sheet/ 5/6
1/11/2017 Solaris ZFS command line reference (Cheat sheet)

Solaris Volume Manager (SVM) command line The ultimate Solaris zones (containers) interview
reference questions

Solaris ZFS command line reference The ultimate Solaris networking interview
questions
RHEL 7 – RHCSA Notes (Cheat Sheets)
The ultimate ZFS interview questions
CentOS / RHEL 7 : firewalld Cheat Sheet HARDWARE CHEAT SHEETS

Most Commonly used ALOM commands

Most Commonly used ILOM commands

Most Commonly used LOM commands

Most commonly used XSCF commands

Most Commonly used RSC commands

How to login into console from ILOM, ALOM,
LOM, ELOM, XSCF, RSC

Archives Contact Us Copyright

http://thegeekdiary.com/solaris­zfs­command­line­reference­cheat­sheet/ 6/6

You might also like