Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I deleted a large file (many gigs) from a Solaris system and it didn't seem to recover the amount of space on the zpool equal to the size of the file. Is there any reason that I wouldn't see this space immediately? What steps are involved in the deletion of files in a ZFS?

share|improve this question

1 Answer 1

up vote 9 down vote accepted

There are several possibilities for the space freed not equaling the size of the file.

  • Compression - you might have compression turned on on the filesystem, and the file may have been compressed.
  • Sparse files - if the file created was a sparse file, then any contiguous blank areas of the file will take up almost no space on the drive, and so deleting the file won't recover the amount of space you might think.
  • Snapshots - I suspect this is the reason for what you're seeing. If you have a snapshot that references that file, then the data is still in use and won't be recovered. You need to remove any snapshots to completely recover the space. If the file changed since you made the snapshot, then you will recover part of the space (the amount changed since the snapshot), but the unchanged parts of the file are still referenced by the snapshot itself.
  • Dedup - This is a newer feature that you probably don't have enabled, but I'm including it as a possibility. Dedup finds blocks that are identical and only stores them once. If you delete a file that references one of these blocks, then you won't recover the space as it is being referenced by another file.
share|improve this answer
    
Be very careful when using the dedup option. Distributions like FreeNAS typically have FAQs on why ZFS is terribly slow when running dedup: it takes about 5MB of memory 1GB of space to dedup, so if you have 5TB of space, you might need 25GB ram to use it efficiently. See this writeup: constantin.glez.de/blog/2011/07/zfs-dedupe-or-not-dedupe –  memnoch_proxy Nov 7 '13 at 5:26

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.