We have moved to a new Sailfish OS Forum. Please start new discussions there.
3

android_storage/DCIM/.thumbnails/.thumbdata3 inconsistent file size [answered]

asked 2016-05-06 04:09:16 +0300

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

updated 2016-05-07 02:36:32 +0300

SebM gravatar image

Hi,

When "rsyncing" the DCIM directory to my SD card, I noticed the ~/android_storage/DCIM/.thumbnails/.thumbdata3--1967290299 (anormally big) file was being transfered but what I don't understand is this :

$ ls -l android_storage/DCIM/.thumbnails/.thumbdata3--1967290299 
-rw-rw-r-- 1 root nemo 967472298 2016-05-05 19:09 android_storage/DCIM/.thumbnails/.thumbdata3--1967290299
$ stat -c %s android_storage/DCIM/.thumbnails/.thumbdata3--1967290299
967472298
$ du android_storage/DCIM/.thumbnails/.thumbdata3--1967290299 
64K android_storage/DCIM/.thumbnails/.thumbdata3--1967290299

Both ls and stat report the same size, why does du only report 64K for the same file ?

edit retag flag offensive reopen delete

The question has been closed for the following reason "the question is answered, an answer was accepted" by SebM
close date 2016-05-07 01:46:07.513134

Comments

Maybe gigabyte digit is ignored by shell, because if you divide 967290299 by 1048576 you get 922,48 ~ 923M. Must fix this immedieate.

alloj ( 2016-05-06 14:31:33 +0300 )edit

@alloj This "967290299" number is contained inside the file name.

My question is why does du report a size of 64KiB ?

SebM ( 2016-05-06 14:38:31 +0300 )edit

So real size of file is 923M?

alloj ( 2016-05-06 14:58:12 +0300 )edit

Yes, the real file size is 967472298

$ python -c "print 967472298.0/2**20"
922.653482437

And here is what my Ubuntu sees through sshfs :

$ df -hT ~/jollaNemoHome
Filesystem       Type        Size  Used Avail Use% Mounted on
nemo@jolla-wlan: fuse.sshfs   14G  6,5G  7,0G  49% /home/sebastien/jollaNemoHome
$ du ~/jollaNemoHome/android_storage/DCIM/.thumbnails/.thumbdata3--1967290299 
944800  /home/sebastien/jollaNemoHome/android_storage/DCIM/.thumbnails/.thumbdata3--1967290299

The coreutils on Sailfish OS 2.0 are quite old, that's maybe why their du has this bug, don't you think ?

SebM ( 2016-05-06 15:03:18 +0300 )edit

1 Answer

Sort by » oldest newest most voted
1

answered 2016-05-07 00:38:04 +0300

Self-Perfection gravatar image

Looks like an ordinary sparse file. du reports "disk usage" in other words this file occupies just 64KiB on disk. Most of it is not allocated and should return zeroes on read attempt. Trivial check: hexdump -C "$FILENAME" | less

edit flag offensive delete publish link more

Comments

You are absolutely right :

$ du --help | grep apparent
      --apparent-size   print apparent sizes, rather than disk usage; although
                          the apparent size is usually smaller, it may be
  -b, --bytes           equivalent to `--apparent-size --block-size=1'
$ du -b android_storage/DCIM/.thumbnails/.thumbdata3--1967290299
967472298   android_storage/DCIM/.thumbnails/.thumbdata3--1967290299

Thanks man :)

SebM ( 2016-05-07 01:45:18 +0300 )edit

Question tools

Follow
2 followers

Stats

Asked: 2016-05-06 04:09:16 +0300

Seen: 622 times

Last updated: May 07 '16