4

I am using Digi embedded linux module which is having 8MB flash and 16MB RAM.

My partition table is as below:

enter image description here

SO, I got 4.4MB for rootfs. And 2MB for UserFS.

When I run ‘df -ah’, I get following output.

enter image description here

However, when I run ‘du -sh’ on root, I have 4M in /lib and 3M in /usr. Both are under root. However, the root is only 4.4M.

I have checked for symbolic link and can confirm that the files are physically present on /lib and /usr.

enter image description here

I deleted some of the library files(netsnmp) under /lib, which was close to 2M, but the available size on /dev/root only increased by ~390K(from 408K to 792K).

enter image description here

This suggests that the /lib/libnetsnmp* were stored somewhere else. I am not sure where those files were saved. Any ideas?

Also, please note that the rootfs image size is 4M. And this is shown correctly in df -ah command on /dev/root filesystem.

user3033152
  • 125
  • 1
  • 2
  • 8

3 Answers3

1

JFFS2 has transparent compression built in if I recall correctly. Executables compress pretty well.

Corey Mutter
  • 336
  • 2
  • 7
0

if the file is in use. you can't delete it really. you can use lsof | grep deleted to find them.

DDDBA
  • 11
  • 2
-1

Probably it is due to the existence of hard-links in the root filesystem. Each hard-link will be shown as a normal file, but all hard-links will point to the same inode, so physically there is only one copy of the file in the hard-disk. You can see a good definition of soft-link and hard-link in this link.

EDIT: You can search for hard-links using this command (taken from this answer):

find . -samefile /path/to/file
Community
  • 1
  • 1
AwkMan
  • 670
  • 6
  • 18
  • I believe it is not to do with links. the filenames in /lib are all lib*.so files. The filenames in /usr are all the mib files. – user3033152 Sep 15 '16 at 12:38
  • I don't think the hard-link is the reason. `du` won't count the hard-linked files twice or more. – kamae Jul 15 '20 at 14:05