Bug 1525262
Summary: | virt-df displays zeros for filesystems with block size =512 | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | Richard W.M. Jones <rjones> |
Component: | libguestfs | Assignee: | Richard W.M. Jones <rjones> |
Status: | CLOSED ERRATA | QA Contact: | Virtualization Bugs <virt-bugs> |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | 7.5 | CC: | ptoscano, rjones, stenavin, xchen |
Target Milestone: | rc | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | libguestfs-1.38.0-1.el7 | Doc Type: | If docs needed, set a value |
Doc Text: | Story Points: | --- | |
Clone Of: | 1525241 | Environment: | |
Last Closed: | 2018-10-30 07:45:24 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: | |||
Bug Depends On: | 1525241, 1551055 | ||
Bug Blocks: |
Description
Richard W.M. Jones
2017-12-12 22:25:17 UTC
I can't reproduce it with: libguestfs-1.36.10-4.el7.x86_64 Could you help to check the steps: # qemu-img create -f qcow2 fstest.qcow2 100M # guestfish -a fstest.qcow2 ><fs> run ><fs> part-disk /dev/sda mbr ><fs> mkfs fat /dev/sda1 blocksize:512 ><fs> list-filesystems /dev/sda1: vfat ><fs> blockdev-getbsz /dev/sda1 512 ><fs> quit [root@dhcp-66-71-68 ~]# virt-df -a fstest.qcow2 Filesystem 1K-blocks Used Available Use% fstest.qcow2:/dev/sda1 102056 0 102056 0% Anything that I misunderstand ? Thank you ! You need to have ’bsize’ < 1024 to see the bug. In the case above the blocksize is 2048: ><fs> part-disk /dev/sda mbr ><fs> mkfs fat /dev/sda1 blocksize:512 ><fs> list-filesystems /dev/sda1: vfat ><fs> mount /dev/sda1 / ><fs> statvfs / bsize: 2048 <----- [...] In the original bug there is an attached filesystem which demonstrates the problem, and it's probably easiest just to use that: https://bugzilla.redhat.com/show_bug.cgi?id=1525241#c0 (In reply to Richard W.M. Jones from comment #3) > You need to have ’bsize’ < 1024 to see the bug. In the case > above the blocksize is 2048: > > ><fs> part-disk /dev/sda mbr > ><fs> mkfs fat /dev/sda1 blocksize:512 > ><fs> list-filesystems > /dev/sda1: vfat > ><fs> mount /dev/sda1 / > ><fs> statvfs / > bsize: 2048 <----- > [...] > > In the original bug there is an attached filesystem which demonstrates > the problem, and it's probably easiest just to use that: > > https://bugzilla.redhat.com/show_bug.cgi?id=1525241#c0 Thank you very much, I've reproduced it with the attached filesystem, but I still want to know how did you set bsize to 512? I thought "mkfs fat /dev/sda1 blocksize:512" did this thing, but actually it didn't. Reproduced with package: libguestfs-1.36.10-4.el7.x86_64 1. Download the filesystem attached in: https://bugzilla.redhat.com/show_bug.cgi?id=1525241#c0 2. # guestfish -a disk.qcow2 ><fs> run ><fs> mount /dev/sda1 / ><fs> statvfs / bsize: 512 frsize: 512 blocks: 199600 bfree: 199599 bavail: 199599 files: 0 ffree: 0 favail: 0 fsid: 2049 flag: 4096 namemax: 1530 ><fs> exit 3. # virt-df -a disk.qcow2 Filesystem 1K-blocks Used Available Use% disk.qcow2:/dev/sda1 0 0 0 1% The 1K-blocks is 0 , which is wrong. (In reply to Xianghua Chen from comment #4) > Thank you very much, I've reproduced it with the attached filesystem, but I > still want to know how did you set bsize to 512? > > I thought "mkfs fat /dev/sda1 blocksize:512" did this thing, but actually it > didn't. This is a bug: https://bugzilla.redhat.com/show_bug.cgi?id=1527003 (In reply to Xianghua Chen from comment #4) > ... but I still want to know how did you set bsize to 512? For example: 1. qemu-img create -f raw fat.raw 100M 2. losetup /dev/loop0 fat.raw 3. fdisk /dev/loop0 <<EOF o n w EOF 4. mkfs.fat /dev/loop0p1 -s 1 -S 512 -F 32 5. guestfish --ro -a fat.raw <<EOF run mount /dev/sda1 / statvfs / EOF Output: bsize: 512 frsize: 512 ... This was fixed upstream with commit d3afdb6e3edbfe031aac86c14df60c530781ace5 which is in libguestfs >= 1.37.36. Verified with package: libguestfs-1.38.0-1.el7.x86_64 Steps: 1. Create a image with block size smaller than 1K # qemu-img create -f raw fat.raw 100M # losetup /dev/loop0 fat.raw # fdisk /dev/loop0 <<EOF o n w EOF # mkfs.fat /dev/loop0 -s 1 -S 512 -F 32 # guestfish --ro -a fat.raw <<EOF run mount /dev/sda / statvfs / EOF Output: bsize: 512 frsize: 512 blocks: 201616 bfree: 201615 bavail: 201615 files: 0 ffree: 0 favail: 0 fsid: 2048 flag: 4096 namemax: 1530 2. # virt-df -a disk.qcow2 Filesystem 1K-blocks Used Available Use% fat.raw:/dev/sda 100808 0 100807 1% So verified. Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHEA-2018:3021 |