Hi, The version of df command is 1.85. Kernel version 4.9.31
The fsck check on that partition succeeds. I am able to use the partition, create files etc. However df reports incorrectly the size and used percentage. Output from strace command is as follows; statfs64("/data", 88, {f_type="EXT2_SUPER_MAGIC", f_bsize=1024, f_blocks=18446744073659310077, f_bfree=87628, f_bavail=80460, f_files=25688, f_ffree=25189, f_fsid={-1446355608, 1063639410}, f_namelen=255, f_frsize=1024, f_flags=4128}) = 0 As can be seen, value of f_blocks is a huge one. How can we get this corrected and where is the corruption because of which this value goes wrong? I am badly stuck up on this! Help is greatly appreciated. Regards On Tue, 22 Mar, 2022, 2:52 am Bob Proulx, <b...@proulx.com> wrote: > 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 >