Sun Microsystems, Inc.  Oracle System Handbook - ISO 7.0 May 2018 Internal/Partner Edition
   Home | Current Systems | Former STK Products | EOL Systems | Components | General Info | Search | Feedback

Asset ID: 1-71-1591868.1
Update Date:2018-01-05
Keywords:

Solution Type  Technical Instruction Sure

Solution  1591868.1 :   Sun Storage 7000 Unified Storage System: How To understand snapshot usage  


Related Items
  • Sun ZFS Storage 7320
  •  
  • Sun Storage 7210 Unified Storage System
  •  
  • Sun Storage 7410 Unified Storage System
  •  
  • Sun ZFS Storage 7420
  •  
  • Sun Storage 7310 Unified Storage System
  •  
  • Sun ZFS Storage 7120
  •  
  • Sun Storage 7110 Unified Storage System
  •  
Related Categories
  • PLA-Support>Sun Systems>DISK>ZFS Storage>SN-DK: 7xxx NAS
  •  


This document indicates how to read and understand the snapshot usage for a share.

In this Document
Goal
Solution
References


Applies to:

Sun ZFS Storage 7120 - Version All Versions to All Versions [Release All Releases]
Sun ZFS Storage 7320 - Version All Versions to All Versions [Release All Releases]
Sun Storage 7110 Unified Storage System - Version All Versions to All Versions [Release All Releases]
Sun ZFS Storage 7420 - Version All Versions to All Versions [Release All Releases]
Sun Storage 7210 Unified Storage System - Version All Versions to All Versions [Release All Releases]
7000 Appliance OS (Fishworks)
To get an holistic picture, Understanding How ZFS Calculates Used Space (Doc ID 1369456.1) can be read as well.

Goal

Important note :

This document provides some zfs commands that could be run from the Solaris shell. These are given as examples to match with what the ZFS appliance really does. Customers are not allowed to enter the Solaris shell :

+-----------------------------------------------------------------------------+
|  You are entering the operating system shell.  By confirming this action in |
|  the appliance shell you have agreed that THIS ACTION MAY VOID ANY SUPPORT  |
|  AGREEMENT.  If you do not agree to this -- or do not otherwise understand  |
|  what you are doing -- you should type "exit" at the shell prompt.  EVERY   |
|  COMMAND THAT YOU EXECUTE HERE IS AUDITED, and support personnel may use    |
|  this audit trail to substantiate invalidating your support contract.  The  |
|  operating system shell is NOT a supported mechanism for managing this      |
|  appliance, and COMMANDS EXECUTED HERE MAY DO IRREPARABLE HARM.             |
|                                                                             |
|  NOTHING SHOULD BE ATTEMPTED HERE BY UNTRAINED SUPPORT PERSONNEL UNDER ANY  |
|  CIRCUMSTANCES.  This appliance is a non-traditional operating system       |
|  environment, and expertise in a traditional operating system environment   |
|  in NO WAY constitutes training for supporting this appliance.  THOSE WITH  |
|  EXPERTISE IN OTHER SYSTEMS -- HOWEVER SUPERFICIALLY SIMILAR -- ARE MORE    |
|  LIKELY TO MISTAKENLY EXECUTE OPERATIONS HERE THAT WILL DO IRREPARABLE      |
|  HARM.  Unless you have been explicitly trained on supporting this          |
|  appliance via the operating system shell, you should immediately return    |
|  to the appliance shell.                                                    |
|                                                                             |
|  Type "exit" now to return to the appliance shell.                          |
+-----------------------------------------------------------------------------+

 

For illustration, we will use a share (fredfs001), create 3 files and 3 snapshots.

We will see how the BUI behaves when deleting 2 files and 1 snapshot. As we know the ZFS appliance is based on ZFS, some `zfs list` command outputs are provided.

Note that, the BUI UNIQUE column equals to ZFS USED column.

Example filesystem activity :

  • 110MB file creation : file110m
  • snap1 taken
  • 120MB file creation : file120m
  • snap2 taken
  • 150MB file creation : file150m
  • snap3 taken

Under the BUI, one can read a snapshot usage as follows :

capture showing all snapshots for fredfs001 share 

 

 

# zfs list -t all -o name,volsize,used,referenced,reservation,refreservation,usedbyrefreservation,usedbysnapshots | egrep "NAME|fredfs001"
NAME                                 VOLSIZE   USED  REFER  RESERV  REFRESERV  USEDREFRESERV  USEDSNAP
pool1/local/fredproj/fredfs001             -   380M   380M    none       none              0       39K
pool1/local/fredproj/fredfs001@snap1       -    19K   110M       -          -              -         -
pool1/local/fredproj/fredfs001@snap2       -    20K   230M       -          -              -         -
pool1/local/fredproj/fredfs001@snap3       -      0   380M       -          -              -         -

 

Solution

  • file110m deletion

capture after file110m deletion

 

 

# rm file110m
# zfs list -t all -o name,volsize,used,referenced,reservation,refreservation,usedbyrefreservation,usedbysnapshots | egrep "NAME|fredfs001"
NAME                                 VOLSIZE   USED  REFER  RESERV  REFRESERV  USEDREFRESERV  USEDSNAP
pool1/local/fredproj/fredfs001             -   380M   270M    none       none              0      110M
pool1/local/fredproj/fredfs001@snap1       -    19K   110M       -          -              -         -
pool1/local/fredproj/fredfs001@snap2       -    20K   230M       -          -              -         -
pool1/local/fredproj/fredfs001@snap3       -    20K   380M

file110m is part of USEDSNAP and is shared among all the snapshots. The UNIQUE/USED column reports small values only. If we delete 1 snapshot, we just free a few KB from the pool.

 

  • file120m deletion

capture after file120m deletion

 

 

# rm file120m
# zfs list -t all -o name,volsize,used,referenced,reservation,refreservation,usedbyrefreservation,usedbysnapshots | egrep "NAME|fredfs001"
NAME                                 VOLSIZE   USED  REFER  RESERV  REFRESERV  USEDREFRESERV  USEDSNAP
pool1/local/fredproj/fredfs001             -   380M   150M    none       none              0      230M
pool1/local/fredproj/fredfs001@snap1       -    19K   110M       -          -              -         -
pool1/local/fredproj/fredfs001@snap2       -    20K   230M       -          -              -         -
pool1/local/fredproj/fredfs001@snap3       -    20K   380M       -          -              -         -

UNIQUE/USED column values did not change.

 

  • snap2 deletion

capture after snap2 deletion

 

 

# zfs destroy pool1/local/fredproj/fredfs001@snap2
# zfs list -t all -o name,volsize,used,referenced,reservation,refreservation,usedbyrefreservation,usedbysnapshots | egrep "NAME|fredfs001"
NAME                                 VOLSIZE   USED  REFER  RESERV  REFRESERV  USEDREFRESERV  USEDSNAP
pool1/local/fredproj/fredfs001             -   380M   150M    none       none              0      230M
pool1/local/fredproj/fredfs001@snap1       -    19K   110M       -          -              -         -
pool1/local/fredproj/fredfs001@snap3       -   120M   380M       -          -              -         -

fredfs001       = file150m
fredfs001@snap1 = file110m
fredfs001@snap3 = file110m + file120m + file150 and is the only dataset referencing file120m, hence UNIQUE/USED col = 120M for snap3.

If we destroy  fredfs001@snap3, we will be able to free some space from the pool (ie, 120M).

 

This matches with what is written is the ZFS administration Guide :

USEDSNAP :

Identifies the amount of disk space that is consumed by snapshots of this dataset, which would be freed if all of this dataset's snapshots were destroyed. Note that this is not the sum of the snapshots' used properties, because disk space can be shared by multiple snapshots.

To sum-up :

UNIQUE value (USED column under 'zfs list') for a snapshot provides data size used uniquely by the snapshot.

If a snapshot references some data referenced by other snapshots, this is considered as shared data.

Shared data is not reported by the UNIQUE/USED value as it is not unique to the snapshot. Deleting the snapshot would not free this shared-data.

 

References

<NOTE:1369456.1> - Understanding How ZFS Calculates Used Space

Attachments
This solution has no attachment
  Copyright © 2018 Oracle, Inc.  All rights reserved.
 Feedback