ZFS Volume Shrinking

Status
Not open for further replies.

JBlujeans

Dabbler
Joined
Nov 5, 2013
Messages
14
I was going through my data and doing a large cleanup. I was deleting several TBs of data and moving data between folders within FreeNAS, I noticed that my overall volume was decreasing within my Windows drive to the NAS. Definitely real-time correlations to large deletions of data and reduction of overall volume capacity within Win7 GUI.

I rebooted and also scrubbed the volume, but it seems to have lost the total capacity. I have five 4 TB drives, RaidZ1, so my total usable volume was around 14 TB. I have attached the volume from the zfs list command. From Win7 network drive it shows 1.36 TB free of 11.1 TB. I now have an alert from within FreeNAS that I am beyond the 80% threshold. I am running v9.2.1.5.

I appreciate your help. I looked around within the forum and I didn't see an exact answer to this type of phenomena.

[root@Zeus ~]# zfs list
NAME USED AVAIL REFER MOUNTPOINT
Zeus 12.9T 1.37T 9.78T /mnt/Zeus
Zeus/.system 3.93M 1.37T 268K /mnt/Zeus/.system
Zeus/.system/cores 230K 1.37T 230K /mnt/Zeus/.system/c
ores
Zeus/.system/samba4 1.69M 1.37T 1.69M /mnt/Zeus/.system/s
amba4
Zeus/.system/syslog 1.75M 1.37T 1.75M /mnt/Zeus/.system/s
yslog
Zeus/Jails 1.57G 1.37T 396K /mnt/Zeus/Jails
Zeus/Jails/.warden-template-pluginjail 807M 1.37T 807M /mnt/Zeus/Jails/.wa
rden-template-pluginjail
Zeus/Jails/minidlna_2 802M 1.37T 1.56G /mnt/Zeus/Jails/min
idlna_2
[root@Zeus ~]# ^C

[root@Zeus ~]#
 

Yatti420

Wizard
Joined
Aug 12, 2012
Messages
1,437
Do you have snapshots running? Also when you mean volume do you mean Zpool as a whole or do you have pool with zvol or datasets within? As doing datasets and zvols stop space from being reported from correctly.

Edit: Can you post the output of zfs list in code tags..

Sent from my SGH-I257M using Tapatalk 2
 

solarisguy

Guru
Joined
Apr 4, 2014
Messages
1,125
@JBlujeans, please execute these four commands:
Code:
zpool list
zfs get all Zeus | egrep 'NAME|used|available|ref|compress|quota|reservation|recordsize|copies|dedup|written'
zfs get all Zeus/.system | egrep 'NAME|used|available|ref|compress|quota|reservation|recordsize|copies|dedup|written'
zfs get all Zeus/Jail | egrep 'NAME|used|available|ref|compress|quota|reservation|recordsize|copies|dedup|written'

Please execute them either using Shell in the GUI or using SSH. Then please share with us the output, while enclosing output of each command inside a separate pair of [CODE] [/CODE] tags. When you use these CODE tags, the output is easier to read, like in the example below. Thank you!
Code:
[root@Zeus ~]# zfs list
NAME                                    USED  AVAIL  REFER  MOUNTPOINT
Zeus                                   12.9T  1.37T  9.78T  /mnt/Zeus
Zeus/.system                           3.93M  1.37T  268K   /mnt/Zeus/.system
Zeus/.system/cores                      230K  1.37T  230K   /mnt/Zeus/.system/cores
Zeus/.system/samba4                    1.69M  1.37T  1.69M  /mnt/Zeus/.system/samba4
Zeus/.system/syslog                    1.75M  1.37T  1.75M  /mnt/Zeus/.system/syslog
Zeus/Jails                             1.57G  1.37T  396K   /mnt/Zeus/Jails
Zeus/Jails/.warden-template-pluginjail  807M  1.37T  807M   /mnt/Zeus/Jails/.warden-template-pluginjail
Zeus/Jails/minidlna_2                   802M  1.37T  1.56G  /mnt/Zeus/Jails/minidlna_2
[root@Zeus ~]#
P.S.
You may want to read http://forums.freenas.org/index.php?threads/usable-space-after-creating-new-raidz2-volume.19587/ or at least (referenced there) http://web.archive.org/web/20140403...s.org/ritk/zfs-4k-aligned-space-overhead.html
 

JBlujeans

Dabbler
Joined
Nov 5, 2013
Messages
14
Thanks again for your help. I do have a single Zpool and I am running snapshots. If I read it correctly, it looks like I have 3.11TB of snapshots? Obviously, I don't have that set correctly. What is the recommended frequency and time length for snapshots? If this is the issue, what I don't understand is how the deletions would cause a significant increase in the size of snapshots. Perhaps it is the constant change that creates different snapshots and has increased that particular volume due to the large change?

I'll also read through the thread provided and I have run the four shell commands. Thanks for the code tag direction, I didn't realize there was a function for that.

Code:
[root@Zeus ~]# zpool list                                                     
NAME  SIZE  ALLOC  FREE    CAP  DEDUP  HEALTH  ALTROOT                       
Zeus  18.1T  16.1T  1.99T    88%  1.00x  ONLINE  /mnt                         


Code:
[root@Zeus ~]# zfs get all Zeus | egrep 'NAME|used|available|ref|compress|quota|
reservation|recordsize|copies|dedup|written'                                   
NAME  PROPERTY              VALUE                  SOURCE                     
Zeus  used                  12.9T                  -                           
Zeus  available            1.37T                  -                           
Zeus  referenced            9.78T                  -                           
Zeus  compressratio        1.00x                  -                           
Zeus  quota                none                  default                     
Zeus  reservation          none                  default                     
Zeus  recordsize            128K                  default                     
Zeus  compression          lz4                    local                       
Zeus  copies                1                      default                     
Zeus  refquota              none                  default                     
Zeus  refreservation        none                  default                     
Zeus  usedbysnapshots      3.11T                  -                           
Zeus  usedbydataset        9.78T                  -                           
Zeus  usedbychildren        2.95G                  -                           
Zeus  usedbyrefreservation  0                      -                           
Zeus  dedup                off                    default                     
Zeus  refcompressratio      1.00x                  -                           
Zeus  written              122M                  -                           
Zeus  logicalused          13.0T                  -                           
Zeus  logicalreferenced    9.84T                  - 


Code:
[root@Zeus ~]# zfs get all Zeus/.system | egrep 'NAME|used|available|ref|compres
s|quota|reservation|recordsize|copies|dedup|written'                           
NAME          PROPERTY              VALUE                  SOURCE             
Zeus/.system  used                  3.86M                  -                   
Zeus/.system  available            1.37T                  -                   
Zeus/.system  referenced            268K                  -                   
Zeus/.system  compressratio        5.95x                  -                   
Zeus/.system  quota                none                  default             
Zeus/.system  reservation          none                  default             
Zeus/.system  recordsize            128K                  default             
Zeus/.system  compression          lz4                    inherited from Zeus 
Zeus/.system  copies                1                      default             
Zeus/.system  refquota              none                  default             
Zeus/.system  refreservation        none                  default             
Zeus/.system  usedbysnapshots      0                      -                   
Zeus/.system  usedbydataset        268K                  -                   
Zeus/.system  usedbychildren        3.60M                  -                   
Zeus/.system  usedbyrefreservation  0                      -                   
Zeus/.system  dedup                off                    default             
Zeus/.system  refcompressratio      1.00x                  -                   
Zeus/.system  written              268K                  -                   
Zeus/.system  logicalused          14.2M                  -                   
Zeus/.system  logicalreferenced    45K                    - 


Code:
[root@Zeus ~]# zfs get all Zeus/Jails | egrep 'NAME|used|available|ref|compress|
quota|reservation|recordsize|copies|dedup|written'                             
NAME        PROPERTY              VALUE                  SOURCE               
Zeus/Jails  used                  1.91G                  -                     
Zeus/Jails  available            1.37T                  -                     
Zeus/Jails  referenced            396K                  -                     
Zeus/Jails  compressratio        7.11x                  -                     
Zeus/Jails  quota                none                  default               
Zeus/Jails  reservation          none                  default               
Zeus/Jails  recordsize            128K                  default               
Zeus/Jails  compression          lz4                    inherited from Zeus   
Zeus/Jails  copies                1                      default               
Zeus/Jails  refquota              none                  default               
Zeus/Jails  refreservation        none                  default               
Zeus/Jails  usedbysnapshots      0                      -                     
Zeus/Jails  usedbydataset        396K                  -                     
Zeus/Jails  usedbychildren        1.91G                  -                     
Zeus/Jails  usedbyrefreservation  0                      -                     
Zeus/Jails  dedup                off                    default               
Zeus/Jails  refcompressratio      1.00x                  -                     
Zeus/Jails  written              396K                  -                     
Zeus/Jails  logicalused          9.25G                  -                     
Zeus/Jails  logicalreferenced    57.5K                  -   
 

solarisguy

Guru
Joined
Apr 4, 2014
Messages
1,125
What is the recommended frequency and time length for snapshots?
That entirely depends on your needs. From my experience reading this forum, people keep snapshots for too long considering the size of their storage.
If this is the issue, what I don't understand is how the deletions would cause a significant increase in the size of snapshots.
That is precisely how snapshots work!

Let me give you an example. You have 4TB of data and 8TB dataset = 4TB used. Snapshot gives no change in usage, snapshot data consists entirely of pointers to real data = 4TB used. You delete 2TB of data (one file or many). there is no change in usage = 4TB used! The data did not move, but now it belongs only to the snapshot. 4TB used would decrease only after the snapshot expires (get deleted). To sum up: you have 8TB dataset, but only room for another 4TB of data.

A corollary from the above, when you have snapshots and you get to a point that you need to get some free space, deleting/expiring snapshots has to be considered.
 

JBlujeans

Dabbler
Joined
Nov 5, 2013
Messages
14
Thanks again for your help, I appreciate it and it now makes sense that the large change resulted in the snapshot taking up additional space. I will go through the snapshots and delete unnecessary versions along with realigning my snapshot frequency and duration.

Even though I have been running FreeNAS for several years, I always end up learning something new once I make a mistake - I wish it was the other way around, but the mistakes create learning opportunities.

Thanks again-
 
Status
Not open for further replies.
Top