[Bug 1723162] Re: du reports wrong file size for certain files

Stephan 1723162 at bugs.launchpad.net
Thu Oct 12 15:59:32 UTC 2017


One line version for convenience:

$ dd if=/dev/zero of=test.img bs=1M count=4096 && dd if=/dev/zero of=test.img bs=1M count=4096 && du -sh test.img
4096+0 records in
4096+0 records out
4294967296 bytes (4.3 GB, 4.0 GiB) copied, 2.53702 s, 1.7 GB/s
4096+0 records in
4096+0 records out
4294967296 bytes (4.3 GB, 4.0 GiB) copied, 2.61288 s, 1.6 GB/s
8.0G	test.img

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to coreutils in Ubuntu.
https://bugs.launchpad.net/bugs/1723162

Title:
  du reports wrong file size for certain files

Status in coreutils package in Ubuntu:
  New

Bug description:
  I'm running coreutils 8.26-3ubuntu4 on artful amd64, kernel
  4.13.0-12-generic. The file system in use is XFS on LVM2 on top of
  LUKS (discard enabled).

  Steps to reproduce:
  1. Create a 4GB file with dd
  2. Overwrite this file with another 4GB file using dd
  3. Run stat and du -h on the file

  Expected behavior: du should report the file as 4GB
  Observed behavior: du shows the file as 8GB size

  Attachment shows detailed log.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/coreutils/+bug/1723162/+subscriptions



More information about the foundations-bugs mailing list