Hi all
Several people are kind enough to share her/his thoughts about my "stat or ls" post. One of them even share this forum post. Quite neat I must say!
Basically they said that both "ls" and "stat" output are correct. One even compare it with "du" output (by default, "du" is using block size unit when showing file size).
What I might failed to stress was, the tests done in my last post was done on top of SELinux enabled-ext3 filesystem. "So what?" you might ask. Briefly maybe none. But my friend pointed that stat was accouting extra blocks that might (I say "might" because my friend is not so sure) contain metadata such as SELinux and ACL.
So far, I find it consistent that the used blocks reported in "ls -ls" is always half of one reported by "stat". It must be something related to return value of function I stated in my previous post. 1KiB? hmmmm......
PS: Further info regarding by block device and filesystem. Thanks to Justin Cook who pointed me to this neat tool:
# blockdev --getbsz /dev/sda3
4096
# blockdev --getss /dev/sda3
512
The first is my fs block size, the latter is my disk sector size.
regards,
Mulyadi Santosa.
A place where I share my daily experience in both technical and non technical issues. Expect to read Linux kernel related posts too.
Subscribe to:
Post Comments (Atom)
How to execute multiple commands directly as ssh argument?
Perhaps sometimes you need to do this: ssh user@10.1.2.3 ls It is easy understand the above: run ls after getting into 10.1.2.3 via ssh. Pi...
-
Ever saw something like below messages inside your KVM (Kernel Virtual Machine) guest's console? " BUG: soft lockup - CPU#0 stuck f...
-
Quick summary first: use gcc -save-temps ! Ever dig into Qemu (qemu.org) source code? OK, I assume you ever did that at least once... may ...
-
Dear readers This time I met interesting case, thus I think it is worth sharing it with you all. But first, big disclaimer. I AM NOT FREE ...
No comments:
Post a Comment