The reason for this is pretty simple - ZFS has absolutely no idea about your filesystem, and most filesystems delete files by updating a File Allocation Table or some such construct, not by going out and wiping out the blocks that had made up those files. Without some sort of semantics to understand what has happened, ZFS can't know that some of the blocks in your zvol are no longer being referenced by any file on the filesystem on top.
Enter SCSI Unmap. Support for this has been in COMSTAR for more than a year now, and the whole idea is that if your OS supports it, it can send down a SCSI UNMAP command that we can use to realize the blocks can be freed in the underlying disk. Except there's a problem. Very few operating systems/filesystems currently support this fully. Even when they do, they seem to only do so for normal operations, and often don't send down anything for metadata updates and such, so over time, you still get to a point where your filesystem on your client reads 39% full, and your zvol reads 100% full.
So, what's an admin to do? Well, that depends on the operating system you're dealing with. Also, all of the below absolutely rely on the fact that you have compress=on set on the zvol. Also, all of these are manual methods of clearing up the discrepancy between the zvol and the filesystem. None are perfect (there will pretty much always be some level of difference between the 'used' space on the zvol and the filesystem on top of it), but all of these should get you much closer to parity. If you want them to be automated, I leave that as a task for the reader. Please note that all of these utilities tend to cause a ton of throughput traffic as they do what they're doing - and can take hours and hours to complete depending on available bandwidth. Running one every night is probably impossible.
I also hope I don't have to mention that snapshots will sort of muck up this whole idea. You'll clear up space on the current dataset, but snapshots will just keep referring to the prior blocks until they're destroyed. If you have some sort of automatic snapshot taking/destroying mechanism (like AutoSnap in NexentaStor) then the effects on the overall zpool 'used space' will not be felt until the snapshots have rolled out, replaced by new ones. If you take permanent or semi-permanent snapshots by yourself, you'll have to remember that your zpool won't regain any of the space from this activity until you've killed all the snapshots made prior to running one of the below utilities.
Windows
The free answer is 'sdelete', provided by Microsoft. Link here: http://technet.microsoft.com/en-us/sysinternals/bb897443.aspx
Basically snag the 'sdelete' tool, and as an Administrator, run it with "sdelete -z C:" (replacing C: with whatever disk is the one with a zvol ultimately at the back) in a Command Prompt window.
Linux
The main two I see used are "secure-delete" and "zerofree". On Ubuntu, both are available. With secure-delete, you're looking for the 'sfill' utility, and you'll want to read the man page, I believe there's a way to reduce it to basically just zero filling. However, I use 'zerofree', which is very simple to use - install it, and just run 'zerofree <filesystem>' and it'll do the rest.
Mac OSX
Use the built-in functionality. Check this link: http://support.apple.com/kb/ht3680
Can client systems use the "TRIM" command, much like SSD drives need to know that blocks are no longer used?
ReplyDeleteThis is mostly a curiosity question, for which I'm somewhat out of my depth in asking because I don't have any SSDs that I use daily. I thought I had heard (don't have URLs, sorry) that zvols could reclaim space when they received TRIM directives.
داریوش
Deleteعارف
یاس
COMSTAR in illumos has SCSI UNMAP support, which in theory would do as you suggest. However, you won't often find that helping you, I'm afraid, as most clients don't support it (for instance, last I checked, Windows iSCSI initiator does not send down SCSI UNMAP commands).
ReplyDeleteThanks for the Informative Blog...
ReplyDeleteUV Gullas Medical College
Final year bsc project centres chennai
ReplyDeleteIEEE ns2 projects in chennai
Thank for Sharing!!!
ReplyDeleteBest IEEE 2019 Projects in chennai
ieee Project Titles 2019 Download
Latest ieee Paper Titles 2019
final year ieee projects 2019
ieee 2019 projects
Nice Post!!!
ReplyDeleteproject centers in chennai
phd project and phd projects centers in chennai
The best Internship and Inplant (or) IPT Training in Chennai
ReplyDeleteFree Internship Training in Chennai
Free Inplant Training in Chennai
Free IPT Training in Chennai
ReplyDeleteشركة تنظيف فلل بالدمام
شركة تنظيف بالدمام
شركة تنظيف سجاد بالدمام
شركة مكافحة حشرات بالخبر
شركة تنظيف بالخبر
شركة تنظيف المنازل بالدمام
شركة تنظيف مجالس بالدمام
شركة تنظيف بيارات بالدمام
very nice blog... UV Gullas College of Medicine
ReplyDeleteآهنگ جدید
ReplyDeleteپخش آهنگ
This is the most supportive blog which I have ever observed.
ReplyDeleteJava Training in Bangalore
Ui Development Training in Bangalore
your article is captivating and amazing getting material. Much appreciation to you for sharing your ability.
ReplyDeleteSAP training in Kolkata
Best SAP training in Kolkata
SAP training institute in Kolkata
I regularly wouldn't be so connected by any articles relating to this subject.
ReplyDeleteSAP training in Mumbai
Best SAP training in Mumbai
SAP training institute Mumbai
I am looking for these kind articles.
ReplyDeleteSEO services in kolkata
Best SEO services in kolkata
SEO company in kolkata
Best SEO company in kolkata
Top SEO company in kolkata
Top SEO services in kolkata
SEO services in India
SEO copmany in India
Thanks for your blogspot...
ReplyDeletePython Projects in Chennai
2020 2021 multimedia projects chennai
ieee vlsi projects
2020 2021 embedded systems projects chennai
Great nice post i Just came to your blog its helps me lot...
ReplyDeleteNovels Tamil
Novels Tamil
Tamil Novels
Tamil Novels Blog
Latest Tamil Novels Free Download
Latest Tamil Novels Free Download
Latest Tamil Novels Free Download
Ramanichandran Novels
Ramanichandran Tamil Novels
Muthulakshmi Raghavan Novels
Srikala Novels
Drilling consultants
ReplyDeleteOnline drilling consultancy
Thanks for sharing informative post. Keep on sharing such useful information. Looking for best tamil novels free download to improve your language skills, check out the popular novels below
ReplyDeleteMuthulakshmi Raghavan Novels
Mallika Manivannan Novels
Srikala Tamil Novels
Ramanichandran Novels
Sashi Murali novels
Rajesh Kumar Novels
ReplyDeleteBài viết rất hay! Quà tặng 24k chuyên cung cấp:
Đặt cúp đồng giá rẻ tại Hà Nội
Quà tặng vinh danh ở đâu chất lượng và uy tín
Hotline: 0866 866 711
indian visa
ReplyDeleteindian visa
indian visa online
I must thank you for your time to read this wonderful article!! Foreign visitors should apply for Turkey evisa online.
ReplyDeleteThank you for this work.. In urgency, the travelers want to apply for e visa, then he/she can apply for Azerbaijan urgent visa through this application you will get visa within few hours.
ReplyDeleteAttractive component of the material. I just stumbled across your web site and accession capital to say that I really enjoyed your site. With just a few clicks, foreign nationals can apply for a Kenya evisa application from their home. Fill the form with accurate and complete information about the passenger's data.
ReplyDeleteThis is a topic that’s near to my heart… Many thanks! Where are your contact details though? US citizens are eligible to apply for the Indian eVisa. You can apply for an emergency Indian visa for us citizen registration via mobile phone, computer or desk.
ReplyDeleteI definitely enjoy every little bit of it. It is a good website and good stock. I want to thank you. COVID-19 PCR test requirements to travel to Ethiopia, passengers must present a medical certificate showing a negative COVID-19 test result before boarding a flight to Ethiopia. You can read all info related to COVID-19 test for Ethiopia via visacent website.
ReplyDeleteI need to thank you for this very good read and i have bookmarked to check out new things from your post. Thank you very much for sharing such a useful article and will definitely save and revisit your site.
ReplyDeleteartificial intelligence internship | best final year projects for cse | internship certificate online | internship for mba finance students | internship meaning in tamil
I love to read this, thank you...Foreign nationals can get visas for India online. India visa application can be completed from home with the help of internet connection. In 5 to 10 minutes you can fill your form.
ReplyDeleteI love what you guys do too. Much clever work and reporting!Keep up the good work guys...Turkish visa for American citizens, You can apply online via Turkish visa website.
ReplyDeleteGreetings, Sir. Do you wish to apply for an India tourist visa? You can get more information on our information page about the Indian tourist visa. Read here..
ReplyDeletefujikura splicing machine
ReplyDelete