Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Linux reports incorrect file size in object store.

Using OpenStack Swift (Havana) on ARM platform running Fedora 19, noticing that Linux is reporting incorrect file size with the command "df -hP" and "du -sh" after uploading a file.

Mount options for object store:

$ mount |grep sda

/dev/sda on /data type xfs (rw,noatime,nodiratime,seclabel,attr2,nobarrier,inode64,noquota)

Create new file: 50M

$ dd if=/dev/zero of=/data/50M bs=10M count=5

State of the object store:

$ df -hP /data

Filesystem Size Used Avail Use% Mounted on /dev/sda 7.5G 83M 7.5G 1% /data

$ du -sh /data/50M

50M /data/50M

Upload the file to object store:

$ swift -v -V 2.0 -A http://127.0.0.1:25250/v2.0 -U admin:admin -K password upload Test /data/50M

State of the object store after upload:

$ df -hP /data

Filesystem Size Used Avail Use% Mounted on

/dev/sda 7.5G 1.2G 6.4G 16% /data

Show file size in object store:

$ find /srv/1/node/store/objects/ -name *.data |xargs du -sh

1.1G /srv/1/node/store/objects/473/cb1/7661c56b746713c79df51ca09926ccb1/1395323452.56928.data

$ find /srv/1/node/store/objects/ -name *.data |xargs ls -llAh

50M /srv/1/node/store/objects/473/cb1/7661c56b746713c79df51ca09926ccb1/1395323452.56928.data

Why would these commands (above) show two different sizes?

FYI - I tried the same experiment on a x86 platform and file size reported correctly (50M) by both commands.

Any help would be much appreciated.

Thanks, J