0
[yotsu@fedora ttyid:2 czw maj 10 19:25:32 ~]$ df -B4K /dev/mapper/fedora-home
System plików            4K-bl użyte dostępne %uż. zamont. na
/dev/mapper/fedora-home 625612 27690   561212   5% /home
[yotsu@fedora ttyid:2 czw maj 10 19:25:41 ~]$ stat -f /home -c "%a %b %f"
561212 625612 597922
[yotsu@fedora ttyid:2 czw maj 10 19:26:07 ~]$ stat -f /dev/mapper/fedora-home -c "%a %b %f"
251736 251736 251736

Why does using stat -f on /dev/mapper/fedora-home give me different values than using it on the directory where its mounted? Which one should I trust?

  • What is the output of stat -f /dev -c "%a %b %f" ? – Mark Plotnick May 10 '18 at 17:47
  • [yotsu@fedora ttyid:0 czw maj 10 19:48:42 ~]$ stat -f /dev -c "%a %b %f" 251736 251736 251736 So its exactly the same, but why does it work like this? – Yotsuya May 10 '18 at 17:50
0

stat -f /dev/mapper/fedora-home is giving you the stats for the /dev filesystem. This is the expected behaviour. It sounds like you don't want that command.

$ stat -f /dev/mapper/alan_dell_2016-home 
  File: "/dev/mapper/alan_dell_2016-home"
    ID: 0        Namelen: 255     Type: tmpfs
Block size: 4096       Fundamental block size: 4096
Blocks: Total: 1002045    Free: 1002045    Available: 1002045
Inodes: Total: 1002045    Free: 1001462
$ df /dev
Filesystem     1K-blocks  Used Available Use% Mounted on
devtmpfs         4008180     0   4008180   0% /dev
  • Seems to be the case, df -B4K /dev reports identical stats. Thanks for help! – Yotsuya May 10 '18 at 17:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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