I use UBIFS for rootfs. I would like to check the size of each direcotries in /.

When I checked with du command, it shows larger than mtd size. Would you tell me the way how can I check the correct size of each directories?


$ du -sh /
508M /

Physical Erase Block (PEB) is 128KB. Logical Erase Block (LEB) of UBI is 124KB.

mtdinfo command shows as follows:
Name:                           rootfs
Type:                           nand
Eraseblock size:                131072 bytes, 128.0 KiB
Amount of eraseblocks:          3664 (480247808 bytes, 458.0 MiB)
Minimum input/output unit size: 2048 bytes
Sub-page size:                  2048 bytes
OOB size:                       64 bytes
Character device major/minor:   90:8
Bad blocks are allowed:         true
Device is writable:             true

Amount of eraseblocks is 458MB, but du command shows 508MB. It is strange. Why du shows larger size?


$df -h
Filesystem      Size  Used Avail Use% Mounted on
ubi0:rootfs     400M  274M  126M  69% /
devtmpfs         89M   28K   89M   1% /dev
tmpfs           249M  144K  249M   1% /run
tmpfs           249M  156K  249M   1% /var/volatile
  • Not all files on your ubifs at /. – Ipor Sircer Jul 9 '18 at 10:22
  • Thank you. I know all files are not in / and some are in RAMdisk. I added the result of "df -h". Please check it. – user8257918 Jul 9 '18 at 11:10
  • Related - unix.stackexchange.com/questions/120311/… – slm Jul 9 '18 at 18:30
  • Thanks. I read it and the other article in stackexchange. However I could not understand how I can know the correct max size and usage. – user8257918 Jul 10 '18 at 10:05

Your Answer

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

Browse other questions tagged or ask your own question.