Skip to main content
7 events
when toggle format what by license comment
May 3, 2017 at 11:52 comment added Stéphane Chazelas As far as I can tell, truncating open files does reclaim space on XFS as well. Tested with both normal file and file allocated with fallocate on Linux 4.9. Can you please clarify under what filesystem and condition truncating a file does not reclaim space?
Mar 21, 2013 at 6:09 comment added dotancohen Thank you Peter. I am glad that you address the "why" in this post.
Mar 20, 2013 at 12:53 comment added peterph The file system may keep the blocks allocated to save time later (especially if the file still remains open), especially when it was big enough before truncating. At least that's what XFS seems to be doing.
Mar 20, 2013 at 11:22 comment added Stéphane Chazelas What makes you say that truncating a file will not reclaim preallocated blocks? Truncating is meant to deallocate data, I don't thing there's any ambiguity with that.
Mar 20, 2013 at 10:14 comment added jofel As Linux supports sparse files on most file systems, the behaviour is well-defined and the disk driver can really free disk space. I have tested it for ext3 and ext4, and it works like Stephane wrote.
Mar 20, 2013 at 8:48 history edited peterph CC BY-SA 3.0
added 210 characters in body
Mar 20, 2013 at 8:42 history answered peterph CC BY-SA 3.0