G gdf New Member Joined Mar 1, 2022 Messages 29 Reaction score 2 Credits 287 Apr 7, 2022 #1 I touched a holefile using the truncate function,the length of file is 1G. however,df command does not show as old space usage - 1G, it does not chang at all. Could anybody make it clear? Thank you!
I touched a holefile using the truncate function,the length of file is 1G. however,df command does not show as old space usage - 1G, it does not chang at all. Could anybody make it clear? Thank you!
forester Well-Known Member Joined Mar 5, 2022 Messages 544 Reaction score 320 Credits 3,829 Apr 7, 2022 #2 Are you speaking of File Holes?
OP G gdf New Member Joined Mar 1, 2022 Messages 29 Reaction score 2 Credits 287 Apr 8, 2022 #3 forester said: Are you speaking of File Holes? Click to expand... Yeah! By using system call : truncate(fd,length). I do not know how to check how much space actually allocated to the File Hole!
forester said: Are you speaking of File Holes? Click to expand... Yeah! By using system call : truncate(fd,length). I do not know how to check how much space actually allocated to the File Hole!
forester Well-Known Member Joined Mar 5, 2022 Messages 544 Reaction score 320 Credits 3,829 Apr 8, 2022 #4 I am learning from this thread, as well. It looks like it has to do with block size Some references -- https://unix.stackexchange.com/questions/436314/how-to-get-the-physical-size-of-a-file-in-linux https://www.howtouselinux.com/post/check-file-size-in-linux https://www.howtogeek.com/450366/how-to-get-the-size-of-a-file-or-directory-in-linux/ Maybe give us a synopsis hen you figure it out, as a suggestion!
I am learning from this thread, as well. It looks like it has to do with block size Some references -- https://unix.stackexchange.com/questions/436314/how-to-get-the-physical-size-of-a-file-in-linux https://www.howtouselinux.com/post/check-file-size-in-linux https://www.howtogeek.com/450366/how-to-get-the-size-of-a-file-or-directory-in-linux/ Maybe give us a synopsis hen you figure it out, as a suggestion!
OP G gdf New Member Joined Mar 1, 2022 Messages 29 Reaction score 2 Credits 287 Apr 8, 2022 #5 Thanks for useful links! Maybe I know how filehole work...