Bug 1679840
| Summary: | xfs_info fails when mounted device name is specified as argument | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 8 | Reporter: | Yuki Okada <yuokada> |
| Component: | xfsprogs | Assignee: | Eric Sandeen <esandeen> |
| Status: | CLOSED ERRATA | QA Contact: | Zorro Lang <zlang> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 8.0 | CC: | dwysocha, rhandlin, tbecker, xzhou, yuokada |
| Target Milestone: | rc | Flags: | pm-rhel:
mirror+
|
| Target Release: | 8.0 | ||
| Hardware: | Unspecified | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2019-11-05 22:30:49 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: | |||
The man page is clear that the argument to the xfs_info command is the mount point, not the device. So what is considered to be a bug here? Apologies, I see that the manpage has changed. Let me look into this. Ok, I believe the intent here may have been that a block device can be queried with xfs_info only if it is unmounted, but that restriction is not made clear in the manpage. On the other hand, opening a mounted block device readonly /may/ be safe to gather geometry information. I'll discuss this with other upstream maintainers, thank you for the bug report. We may have a workable patch to automatically query the proper device based on mounted state, this will need to be worked out upstream. Built in xfsprogs-5.0.0-1.el8 Reproduced on xfsprogs xfsprogs-4.19.0-2.el8:
# rpm -q xfsprogs
xfsprogs-4.19.0-2.el8.x86_64
# mount /dev/loop0 /mnt/scratch
# xfs_info /mnt/scratch
meta-data=/dev/loop0 isize=512 agcount=4, agsize=327680 blks
= sectsz=512 attr=2, projid32bit=1
= crc=1 finobt=1, sparse=1, rmapbt=0
= reflink=1
data = bsize=4096 blocks=1310720, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0, ftype=1
log =internal log bsize=4096 blocks=2560, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
# xfs_info /dev/loop0
xfs_info: /dev/loop0 contains a mounted filesystem
fatal error -- couldn't initialize XFS library
Test passed on xfsprogs-5.0.0-1.el8:
# rpm -q xfsprogs
xfsprogs-5.0.0-1.el8.x86_64
# mount /dev/loop0 /mnt/scratch
# xfs_info /mnt/scratch
meta-data=/dev/loop0 isize=512 agcount=4, agsize=327680 blks
= sectsz=512 attr=2, projid32bit=1
= crc=1 finobt=1, sparse=1, rmapbt=0
= reflink=1
data = bsize=4096 blocks=1310720, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0, ftype=1
log =internal log bsize=4096 blocks=2560, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
# xfs_info /dev/loop0
meta-data=/dev/loop0 isize=512 agcount=4, agsize=327680 blks
= sectsz=512 attr=2, projid32bit=1
= crc=1 finobt=1, sparse=1, rmapbt=0
= reflink=1
data = bsize=4096 blocks=1310720, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0, ftype=1
log =internal log bsize=4096 blocks=2560, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
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/RHBA-2019:3628 |
Description of problem: xfs_info fails with "contains a mounted filesystem" error when a mounted device name is specified as an argument. It works without error if a mount point is specified. $ mount | grep "type xfs" /dev/mapper/rhel-root on / type xfs (rw,relatime,seclabel,attr2,inode64,noquota) /dev/sda1 on /boot type xfs (rw,relatime,seclabel,attr2,inode64,noquota) $ xfs_info /dev/mapper/rhel-root xfs_info: /dev/mapper/rhel-root contains a mounted filesystem fatal error -- couldn't initialize XFS library $ xfs_info / meta-data=/dev/mapper/rhel-root isize=512 agcount=4, agsize=1113856 blks = sectsz=512 attr=2, projid32bit=1 = crc=1 finobt=1, sparse=1, rmapbt=0 = reflink=1 data = bsize=4096 blocks=4455424, imaxpct=25 = sunit=0 swidth=0 blks naming =version 2 bsize=4096 ascii-ci=0, ftype=1 log =internal log bsize=4096 blocks=2560, version=2 = sectsz=512 sunit=0 blks, lazy-count=1 realtime =none extsz=4096 blocks=0, rtextents=0 According to xfs_info(8), both mount-point and block-device can be specified. SYNOPSIS xfs_info [ -t mtab ] [ mount-point | block-device | file-image ] xfs_info -V Version-Release number of selected component (if applicable): xfsprogs-4.18.0-3.el8.x86_64 kernel-4.18.0-32.el8.x86_64 How reproducible: 100% Steps to Reproduce: 1. Run "xfs_info <mounted device name which contains XFS>" Actual results: Fails with following error. xfs_info: XXX contains a mounted filesystem fatal error -- couldn't initialize XFS library Expected results: Returns XFS information. Additional info: In RHEL 7.6 (xfsprogs-4.5.0-18.el7.x86_64, kernel-3.10.0-957.el7.x86_64), xfs_info works even if a mounted device name is specified. $ mount | grep "type xfs" /dev/mapper/rhel-root on / type xfs (rw,relatime,seclabel,attr2,inode64,noquota) /dev/sda1 on /boot type xfs (rw,relatime,seclabel,attr2,inode64,noquota) $ xfs_info /dev/mapper/rhel-root meta-data=/dev/mapper/rhel-root isize=512 agcount=4, agsize=1113856 blks = sectsz=512 attr=2, projid32bit=1 = crc=1 finobt=0 spinodes=0 data = bsize=4096 blocks=4455424, imaxpct=25 = sunit=0 swidth=0 blks naming =version 2 bsize=4096 ascii-ci=0 ftype=1 log =internal bsize=4096 blocks=2560, version=2 = sectsz=512 sunit=0 blks, lazy-count=1 realtime =none extsz=4096 blocks=0, rtextents=0