Skip to contentSkip to conversation

check disk usage

DISCUSSION Xiaogeng (Shawn) Jin 3 participants 4 messages Oct 17, 2002 – Oct 18, 2002 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

Hi,

My root filesystem is jffs2, which is mounted by kernel getting booting parameters "root=/dev/mtdblock3 rw" from the command line. I noticed that running 'df -k' only shows the usage of those devices that are mounted explicitly by 'mount' command but not the root filesystem. The following is the result of 'df -k' running on busybox-0.60.2.

# df -k
Filesystem           1k-blocks      Used Available Use% Mounted on
/dev/mtdblock0           16384       688     15696   4% /usr
/dev/mtdblock1           16384      5836     10548  36% /home
/dev/mtdblock2           16384       652     15732   4% /var

On a regular linux system, e.g. RedHat, we do get information about the usage of the root filesytem, right?

Is this a problem? If it's is, is it related to jffs2 or busybox?

Thanks,

Shawn.

#1 lore raw
Quoted 14 lines · Xiaogeng (Shawn) Jin

Hi,

My root filesystem is jffs2, which is mounted by kernel getting booting parameters "root=/dev/mtdblock3 rw" from the command line. I noticed that running 'df -k' only shows the usage of those devices that are mounted explicitly by 'mount' command but not the root filesystem. The following is the result of 'df -k' running on busybox-0.60.2.

# df -k
Filesystem           1k-blocks      Used Available Use% Mounted on
/dev/mtdblock0           16384       688     15696   4% /usr
/dev/mtdblock1           16384      5836     10548  36% /home
/dev/mtdblock2           16384       652     15732   4% /var
Quoted 4 lines

On a regular linux system, e.g. RedHat, we do get information about the usage of the root filesytem, right?

Is this a problem? If it's is, is it related to jffs2 or busybox?

Have you checked the strace output of df -k? As far as I can see, it looks in /proc/mounts. Maybe this is of some help to you.

Regards,
Tino

Signature · 4 lines
[email protected]
dipl.-inf.                        Innominate Security Technologies AG
software engineer                                   networking people
tel: +49.30.6392-3308                      http://www.innominate.com/
#2 lore raw

Haven't used busybox in a while, but when using "the real thing" the following applies, and it might apply to busybox mount as well:

This problem is caused by a /etc/mtab not beeing in synch with your actual mounts.

There is two ways to go about this

a) Propely set up /etc/mtab when booting. This is done by when having /etc/mtab writeable, clear it, and then redo all mounts done up to that point by using the -f option to only update /etc/mtab.

b) Do not use a real /etc/mtab. Link it to /proc/mounts. For details and limitations of not using a mtab see the mount(1) man page.. almost all setups can work just fine without a real mtab.

Regards
Henrik

Quoted 19 lines · Xiaogeng (Shawn) Jin
Quoted 18 lines

Hi,

My root filesystem is jffs2, which is mounted by kernel getting booting parameters "root=/dev/mtdblock3 rw" from the command line. I noticed that running 'df -k' only shows the usage of those devices that are mounted explicitly by 'mount' command but not the root filesystem. The following is the result of 'df -k' running on busybox-0.60.2.

# df -k
Filesystem           1k-blocks      Used Available Use% Mounted on
/dev/mtdblock0           16384       688     15696   4% /usr
/dev/mtdblock1           16384      5836     10548  36% /home
/dev/mtdblock2           16384       652     15732   4% /var

On a regular linux system, e.g. RedHat, we do get information about the usage of the root filesytem, right?

Is this a problem? If it's is, is it related to jffs2 or busybox?

#3 lore raw
Quoted 3 lines

b) Do not use a real /etc/mtab. Link it to /proc/mounts. For details and limitations of not using a mtab see the mount(1) man page.. almost all setups can work just fine without a real mtab.

Thanks a lot. I did in this way to solve the problem.

Shawn.