The backing objects are most likely sparse and the diff extents just represent the maximum offset written within each backing object. Calculating the size of an image composed over potentially hundreds of thousands of backing objects is not a cheap operation, so it's best to consider this (and output from rbd du) as a rough upper bound and not a exact-to-the-byte disk size estimate. On Thu, Dec 29, 2016 at 4:23 AM, xxhdx1985126 <xxhdx1985126@xxxxxxx> wrote: > Hi, everyone. > > Recently, I've got a need to check the real size of an rbd image. I followed the instructions in "http://ceph.com/planet/rbd-image-real-size/". the result is shown as follows: > > [xuxuehan@localhost ~]$ rbd diff xxh_pool/clone_test_img2 > Offset Length Type > 0 4194304 data > 4194304 4190208 data > 8388608 4182016 data > 12582912 4194304 data > 16777216 4194304 data > 20971520 4194304 data > 25165824 4186112 data > 29360128 4190208 data > 33554432 4194304 data > 37748736 4190208 data > 41943040 4194304 data > 46137344 4186112 data > 50331648 4186112 data > 54525952 4194304 data > 58720256 4190208 data > 62914560 4194304 data > > > However, I checked the file size of the object "rbd_data.1bfad6b8b4567.0000000000000001" which belongs to clone_test_img2, and the result is as follows: > > [xuxuehan@hdp2384 ~]$ du /home/ceph/software/ceph/var/lib/ceph/osd/ceph-2/current/1.154_head/rbd\\udata.1bfad6b8b4567.0000000000000001* > 2020 /home/ceph/software/ceph/var/lib/ceph/osd/ceph-2/current/1.154_head/rbd\udata.1bfad6b8b4567.0000000000000001__head_A2511954__1 > > As shown above, the bytes changed observed in the result of "rbd diff" is about 4MB, while the real disk space usage observed by "du" is only about 2MB. Why are they so different? > > Please help me, thanks:-) > _______________________________________________ > ceph-users mailing list > ceph-users@xxxxxxxxxxxxxx > http://lists.ceph.com/listinfo.cgi/ceph-users-ceph.com -- Jason _______________________________________________ ceph-users mailing list ceph-users@xxxxxxxxxxxxxx http://lists.ceph.com/listinfo.cgi/ceph-users-ceph.com