ZFS Shortcuts for Noobs

by Henry Pepper

Introduction

Purpose

This topic is ZFS for newbies.

The basic stuff you need to get started, and using it to play around with.

Scope

References

About ZFS

Creation

Creating a pool, in a slice

Instructions

# zpool create taz /dev/dsk/c0t0d0s4

Discussion

'taz' is the name of the pool being created.
'/dev/dsk/c0t0d0s4' is the name of the slice.

Creating a file system

By default, when you create a pool, it is mounted as a file system under root. In this example, the file system will be mounted as '/taz'. For many cases, this is sufficient.

In some cases, you may wish to change the policies for a file system under the pool. For example, you might want to set a quota or make the file system read-only. In that case, you can create additional file systems and change their policies.

# zfs create taz/image_storage
# zfs set quota=15g taz/image_storage
# zfs set readonly=on taz/image_storage

The policies are set via properties.  The list of available properties depends on the version of ZFS in use. You can see the available policies by using the _zfs get_ subcommand.  For convenience, policies are inherited from the parent file system.

# zfs get all taz/image_storage

Administration

Listing the ZFS file systems

# zfs list
NAME                USED  AVAIL  REFER  MOUNTPOINT
taz                98.5K  42.6G    18K  /taz
taz/image_storage    18K  15.0G    18K  /taz/image_storage

zpool status

# zpool status taz
  pool: taz
 state: ONLINE
 scrub: none requested
config:

        NAME        STATE     READ WRITE CKSUM
        taz         ONLINE       0     0     0
          c1t0d0s7  ONLINE       0     0     0

errors: No known data errors

Mounting a zfs file system.

Troubleshooting

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.

Sign up or Log in to add a comment or watch this page.


The individuals who post here are part of the extended Sun Microsystems community and they might not be employed or in any way formally affiliated with Sun Microsystems. The opinions expressed here are their own, are not necessarily reviewed in advance by anyone but the individual authors, and neither Sun nor any other party necessarily agrees with them.

Copyright 1994-2009 Sun Microsystems, Inc.
Powered by Atlassian Confluence
Sun Guidelines on Public Discourse Privacy Policy Terms of Use Trademarks Site Map Employment Investor Relations Contact