linux - `du -sh` produces different results on different machines for the same folder -


i used rsync sync 1 machine machine(so think should same folder containing same set of files--and contain files)

when du -sh on original machine, produces:

4.0m   . 

but on computer, produces:

3.5m   . 

when ls -lh in folder on both machines, results same each file.

i asked somebody, told me use du -bc, time results same now.

the original server running "suse linux enterprise server 11 sp2" , computer running ubuntu 12.04.

so seems there difference in implementation of du -sh? or why different same set of files?

du counts disk usage, not file size.

differences in how filesystem allocate storages file may cause disk usage differ same set of files.

some possible reasons why disk usage may differ, not exhaustive list:

  1. you use different filesystem (e.g. ext4 vs btrfs)
  2. the filesystem configured differently (e.g. different block size, journaling options, filesystem compression)
  3. allocation strategy used filesystem
  4. sparse file may appear larger uses smaller disk size
  5. hardlinks shares space on disk

Comments

Popular posts from this blog

sequelize.js - Sequelize group by with association includes id -

android - Robolectric "INTERNET permission is required" -

java - Android raising EPERM (Operation not permitted) when attempting to send UDP packet after network connection -