coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: df command reports incorrect usage


From: Bob Proulx
Subject: Re: df command reports incorrect usage
Date: Mon, 21 Mar 2022 15:22:17 -0600

Fariya F wrote:
> My eMMC device has a partition which reports the below output from df -h
> command:
>
> Filesystem       Size  Used Avail Use% Mounted on
> /dev/mmcblk2p3    16Z   16Z   84M 100% /data

Since the df command is simply reporting back on what the Linux kernel
reports, and the kernel is reporting data from the file system, this
looks to be a problem with the file system.  Since this looks like an
SD card it seems likely that the SD card is not happy.  It would be a
good idea to test the SD card to see if it has failed.

It would be useful to know at least some information in addition to
this output.  What is the specific version of df?

    df --version

What kernel version are you using.

    uname -a

Since df is asking for the file system information from the kernel it
would be useful to know what answer the kernel provided.

    strace -v -e statfs /bin/df -h /data

On my system I see the following from a couple of different examples.
Just to provide something to show what would be useful.

    rwp@angst:/tmp$ strace -v -e statfs /bin/df -hT /data
    statfs("/data", {f_type=MSDOS_SUPER_MAGIC, f_bsize=16384, f_blocks=2044, 
f_bfree=857, f_bavail=857, f_files=0, f_ffree=0, f_fsid={val=[45826, 0]}, 
f_namelen=1530, f_frsize=16384, f_flags=ST_VALID|ST_RDONLY|ST_RELATIME}) = 0
    Filesystem     Type  Size  Used Avail Use% Mounted on
    /dev/mmcblk0p2 vfat   32M   19M   14M  59% /data
    +++ exited with 0 +++

    root@angst:~# strace -v -e statfs /bin/df -hT /data
    statfs("/data", {f_type=EXT2_SUPER_MAGIC, f_bsize=4096, f_blocks=1924651, 
f_bfree=673176, f_bavail=579409, f_files=496784, f_ffree=417167, 
f_fsid={val=[961623697, 1875516586]}, f_namelen=255, f_frsize=4096, 
f_flags=ST_VALID|ST_RELATIME}) = 0
    Filesystem         Type  Size  Used Avail Use% Mounted on
    /dev/mapper/v1-var ext3  7.4G  4.8G  2.3G  69% /data
    +++ exited with 0 +++

I looked specifically at the statfs(2) system call here as it provides
the majority of the information.  This is for a Linux kernel system.
However if your system is much different then different information
might be displayed or might be needed.

Bob



reply via email to

[Prev in Thread] Current Thread [Next in Thread]