Bug 578123 - virt-df numbers don't match numbers from 'df' inside the guest
virt-df numbers don't match numbers from 'df' inside the guest
Status: CLOSED UPSTREAM
Product: Virtualization Tools
Classification: Community
Component: libguestfs (Show other bugs)
unspecified
All Linux
low Severity medium
: ---
: ---
Assigned To: Richard W.M. Jones
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2010-03-30 06:05 EDT by Richard W.M. Jones
Modified: 2010-05-12 08:22 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-05-12 08:22:12 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Richard W.M. Jones 2010-03-30 06:05:46 EDT
[Notes:
(1) We wouldn't expect the numbers to exactly match
(2) Originally reported by Rita Wu ]

>> [root@dhcp-66-83-61 ~]# df -h                                                
>> Filesystem            Size  Used Avail Use% Mounted on                       
>> /dev/mapper/VolGroup00-LogVol00                                              
>>                       11G  2.5G  7.7G  25% /                                 
>> /dev/hda1              99M   13M   82M  14% /boot                            
>> tmpfs                1006M     0 1006M   0% /dev/shm                         
>>                                                                              
>>                                                                              
>> [root@dhcp-65-82 ~]# virt-df RHEL-Server-5.5-64-2.qcow2 -h                   
>> Filesystem                                Size       Used  Available  Use%   
>> RHEL-Server-5.5-64-2.qcow2:/dev/VolGroup00/LogVol00                          
>>                                         10.6G       2.4G       7.7G 27.4%    
>> RHEL-Server-5.5-64-2.qcow2:/dev/vda1     98.7M      12.3M      81.4M 17.6%   
>>                                                                              

We can get to the raw numbers using 'stat -f' inside
the guest and guestfish outside:

In the guest:

>   stat -f /                                                                   
>   stat -f /boot                                                               

At the same time on the host:

>   guestfish --ro -i RHEL-Server-5.5-64-2.qcow2                                
>     statvfs /                                                                 
>     statvfs /boot                                                             

The numbers from Rita's box:

*************************************************
[root@dhcp-66-83-61 ~]# stat -f /
File: "/"
ID: 0 Namelen: 255 Type: ext2/ext3
Block size: 4096 Fundamental block size: 4096
Blocks: Total: 2785260 Free: 2143397 Available: 1999628
Inodes: Total: 2877952 Free: 2768362
[root@dhcp-66-83-61 ~]# stat -f /boot
File: "/boot"
ID: 0 Namelen: 255 Type: ext2/ext3
Block size: 1024 Fundamental block size: 1024
Blocks: Total: 101086 Free: 88539 Available: 83320
Inodes: Total: 26104 Free: 26070

***************************************************
[root@dhcp-65-82 rwu]# guestfish --ro -i RHEL-Server-5.5-64.qcow2
...
><fs> statvfs /                                                                 
bsize: 4096
frsize: 4096
blocks: 2785260
bfree: 2143396
bavail: 1999627
files: 2877952
ffree: 2768362
favail: 2768362
fsid: 7314991891090550097
flag: 0
namemax: 255
><fs> statvfs /boot                                                             
bsize: 1024
frsize: 1024
blocks: 101086
bfree: 88539
bavail: 83320
files: 26104
ffree: 26070
favail: 26070
fsid: -2087154354
flag: 0
namemax: 255


Version-Release number of selected component (if applicable):

1.0.88
Comment 1 Richard W.M. Jones 2010-03-30 11:19:42 EDT
The following upstream commit should fix this:
http://git.annexia.org/?p=libguestfs.git;a=commitdiff;h=29c78cc979297b95407a5956b4caa34240a2f5a8
Comment 2 Fedora Update System 2010-04-09 10:10:11 EDT
libguestfs-1.2.1-1.fc13 has been submitted as an update for Fedora 13.
http://admin.fedoraproject.org/updates/libguestfs-1.2.1-1.fc13
Comment 3 Fedora Update System 2010-04-13 03:43:45 EDT
libguestfs-1.2.2-1.fc13 has been submitted as an update for Fedora 13.
http://admin.fedoraproject.org/updates/libguestfs-1.2.2-1.fc13
Comment 4 Fedora Update System 2010-04-30 19:46:55 EDT
libguestfs-1.2.2-1.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.