![]() | Oracle System Handbook - ISO 7.0 May 2018 Internal/Partner Edition | ||
|
|
![]() |
||||||||||||||||
Solution Type Technical Instruction Sure Solution 1591868.1 : Sun Storage 7000 Unified Storage System: How To understand snapshot usage
This document indicates how to read and understand the snapshot usage for a share. In this Document
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. GoalImportant 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 :
Under the BUI, one can read a snapshot usage as follows :
# 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
# 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.
# 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.
# 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
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 SpaceAttachments This solution has no attachment |
||||||||||||||||
|