Bug 578123 - virt-df numbers don't match numbers from 'df' inside the guest
Summary: virt-df numbers don't match numbers from 'df' inside the guest
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libguestfs
Version: unspecified
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Richard W.M. Jones
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-03-30 10:05 UTC by Richard W.M. Jones
Modified: 2010-05-12 12:22 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2010-05-12 12:22:12 UTC
Embargoed:


Attachments (Terms of Use)

Description Richard W.M. Jones 2010-03-30 10:05:46 UTC
[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 15:19:42 UTC
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 14:10:11 UTC
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 07:43:45 UTC
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 23:46:55 UTC
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.