It appears that with --apparent-size, du adds the "size" of the directories to the total as well. On most filesystems this is the block size, or the amount of metadata space the directory is using. On CephFS, this size is fabricated to be the size sum of all sub-files. i.e. a cheap/free 'du -sh $folder' $ stat /homes/mozes/tmp/sbatten File: '/homes/mozes/tmp/sbatten' Size: 138286 Blocks: 0 IO Block: 65536 directory Device: 0h/0d Inode: 1099523094368 Links: 1 Access: (0755/drwxr-xr-x) Uid: (163587/ mozes) Gid: (163587/mozes_users) Access: 2016-01-19 00:12:23.331201000 -0600 Modify: 2015-10-14 13:38:01.098843320 -0500 Change: 2015-10-14 13:38:01.098843320 -0500 Birth: - $ stat /tmp/sbatten/ File: '/tmp/sbatten/' Size: 4096 Blocks: 8 IO Block: 4096 directory Device: 803h/2051d Inode: 9568257 Links: 2 Access: (0755/drwxr-xr-x) Uid: (163587/ mozes) Gid: (163587/mozes_users) Access: 2016-01-19 00:12:23.331201000 -0600 Modify: 2015-10-14 13:38:01.098843320 -0500 Change: 2016-01-19 00:17:29.658902081 -0600 Birth: - $ du -s --apparent-size -B1 /homes/mozes/tmp/sbatten 276572 /homes/mozes/tmp/sbatten $ du -s -B1 /homes/mozes/tmp/sbatten 147456 /homes/mozes/tmp/sbatten $ du -s -B1 /tmp/sbatten 225280 /tmp/sbatten $ du -s --apparent-size -B1 /tmp/sbatten 142382 /tmp/sbatten Notice how the apparent-size version is *exactly* the Size from the stat + the size from the "proper" du? -- Adam On Mon, Jan 18, 2016 at 11:45 PM, Francois Lafont <flafdivers@xxxxxxx> wrote: > On 19/01/2016 05:19, Francois Lafont wrote: > >> However, I still have a question. Since my previous message, supplementary >> data have been put in the cephfs and the values have changes as you can see: >> >> ~# du -sh /mnt/cephfs/ >> 1.2G /mnt/cephfs/ >> >> ~# du --apparent-size -sh /mnt/cephfs/ >> 6.4G /mnt/cephfs/ >> >> You can see that the difference between "disk usage" and "apparent size" >> has really increased and it seems to me curious that only sparse files can >> explain this difference (in my mind, sparse files are very specific files >> and here the files are essentially images which doesn't seem to me potential >> sparse files). I'm not completely sure but I think that same files are put in >> the cephfs directory. >> >> Do you think it's possible that the sames file present in different directories >> of the cephfs are stored in only one object in the cephfs pool? >> >> This is my feeling when I see the difference between "apparent size" and >> "disk usage" which has increased. Am I wrong? > > In fact, I'm not so sure. Here another information, where /backups is a XFS partition: > > ~# du --apparent-size -sh /mnt/cephfs/0/5/05286c08-2270-41e7-8055-64eae169bd46/data/ > 2.8G /mnt/cephfs/0/5/05286c08-2270-41e7-8055-64eae169bd46/data/ > > ~# du -sh /mnt/cephfs/0/5/05286c08-2270-41e7-8055-64eae169bd46/data/ > 701M /mnt/cephfs/0/5/05286c08-2270-41e7-8055-64eae169bd46/data/ > > ~# cp -r /mnt/cephfs/0/5/05286c08-2270-41e7-8055-64eae169bd46/data/ /backups/test > > ~# du -sh /backups/test > 701M /backups/test > > ~# du --apparent-size -sh /backups/test > 701M /backups/test > > So I definitively don't understand of du --apparent-size -sh... > > > -- > François Lafont > _______________________________________________ > ceph-users mailing list > ceph-users@xxxxxxxxxxxxxx > http://lists.ceph.com/listinfo.cgi/ceph-users-ceph.com _______________________________________________ ceph-users mailing list ceph-users@xxxxxxxxxxxxxx http://lists.ceph.com/listinfo.cgi/ceph-users-ceph.com