Bug 1166057
| Summary: | btrfs filesystem will not work well if you create the filesystem with multiple disks at the same time, such as: mkfs-btrfs "/dev/sda1 /dev/sdb1" | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Lingfei Kong <lkong> |
| Component: | libguestfs | Assignee: | Richard W.M. Jones <rjones> |
| Status: | CLOSED ERRATA | QA Contact: | Virtualization Bugs <virt-bugs> |
| Severity: | low | Docs Contact: | |
| Priority: | low | ||
| Version: | 7.1 | CC: | leiwang, linl, mbooth, ptoscano, wshi, xchen |
| Target Milestone: | rc | ||
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | libguestfs-1.31.7-2.el7.x86_64 | Doc Type: | Bug Fix |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2016-11-03 17:47:30 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: | 1218766 | ||
| Bug Blocks: | 1288337, 1301891 | ||
|
Description
Lingfei Kong
2014-11-20 10:54:53 UTC
(In reply to Lingfei Kong from comment #0) > ><fs> mkfs-btrfs "/dev/sda1 /dev/sdb1" As also mentioned in mkfs.btrfs(8), this will create a filesystem spanning across the specified devices, which in the above case are stored in: > ><fs> sparse test-btrfs-devices-1.img 1G > ><fs> sparse test-btrfs-devices-2.img 1G So later when doing: > 2. #guestfish -a test-btrfs-devices-1.img > ><fs> run > 100% > ⟦▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ > ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒⟧ --:-- > ><fs> trace 1 > ><fs> list-filesystems > [...] > libguestfs: error: btrfs_subvolume_list: /dev/sda1 on <internal> (options: > ''): mount: wrong fs type, bad option, bad superblock on /dev/sda1, > missing codepage or helper program, or other error > > In some cases useful info is found in syslog - try > dmesg | tail or so. ... and ... > #guestfish -a test-btrfs-devices-2.img run : list-filesystems > libguestfs: error: btrfs_subvolume_list: /dev/sda1 on <internal> (options: > ''): mount: wrong fs type, bad option, bad superblock on /dev/sda1, > missing codepage or helper program, or other error > > In some cases useful info is found in syslog - try > dmesg | tail or so. ... they fails because the filesystem they hold is just a part of the spanned btrfs filesystem. You can also verify with debug sh "btrfs filesystem show -d" the devices used for any btrfs filesystem. Having both the devices allows using the filesystem correctly: $ guestfish -a test-btrfs-devices-1.img -a test-btrfs-devices-2.img run : list-filesystems /dev/sda1: btrfs /dev/sdb1: btrfs It seems the "btrfs filesystem show" command could be the only one giving this information, and its output is less than ideal to parse... > Expected results: > At step 2, can get the filesystem in test-btrfs-devices-1.img, > test-btrfs-devices-21.img and the filesystem is works well. Definitely you cannot use any of the two without the other as well. (In reply to Pino Toscano from comment #1) > Having both the devices allows using the filesystem correctly: > > $ guestfish -a test-btrfs-devices-1.img -a test-btrfs-devices-2.img run : > list-filesystems > /dev/sda1: btrfs > /dev/sdb1: btrfs > I tried this way, but also got the same error: Here are the steps: Step 1: #guestfish ><fs> sparse test-btrfs-devices-1.img 1G ><fs> sparse test-btrfs-devices-2.img 1G ><fs> run ><fs> part-disk /dev/sda mbr ><fs> part-disk /dev/sdb mbr ><fs> mkfs-btrfs "/dev/sda1 /dev/sdb1" ><fs> trace 1 ><fs> list-filesystem libguestfs: trace: list_filesystems libguestfs: trace: feature_available "lvm2" libguestfs: trace: feature_available = 1 libguestfs: trace: feature_available "ldm" libguestfs: trace: feature_available = 0 libguestfs: trace: list_devices libguestfs: trace: list_devices = ["/dev/sda", "/dev/sdb"] libguestfs: trace: list_partitions libguestfs: trace: list_partitions = ["/dev/sda1", "/dev/sdb1"] libguestfs: trace: list_md_devices libguestfs: trace: list_md_devices = [] libguestfs: trace: part_to_dev "/dev/sda1" libguestfs: trace: part_to_dev = "/dev/sda" libguestfs: trace: part_to_dev "/dev/sdb1" libguestfs: trace: part_to_dev = "/dev/sdb" libguestfs: trace: vfs_type "/dev/sda1" libguestfs: trace: vfs_type = "btrfs" libguestfs: trace: btrfs_subvolume_list "/dev/sda1" libguestfs: trace: btrfs_subvolume_list = <struct guestfs_btrfssubvolume_list *> libguestfs: trace: vfs_type "/dev/sdb1" libguestfs: trace: vfs_type = "btrfs" libguestfs: trace: btrfs_subvolume_list "/dev/sdb1" libguestfs: trace: btrfs_subvolume_list = <struct guestfs_btrfssubvolume_list *> libguestfs: trace: lvs libguestfs: trace: lvs = [] libguestfs: trace: list_filesystems = ["/dev/sda1", "btrfs", "/dev/sdb1", "btrfs"] /dev/sda1: btrfs /dev/sdb1: btrfs ><fs> quit Step 2: #guestfish -a test-btrfs-devices-1.img -a test-btrfs-devices-2.img ><fs> run ><fs> trace 1 ><fs> list-filesystems libguestfs: trace: list_filesystems libguestfs: trace: feature_available "lvm2" libguestfs: trace: feature_available = 1 libguestfs: trace: feature_available "ldm" libguestfs: trace: feature_available = 0 libguestfs: trace: list_devices libguestfs: trace: list_devices = ["/dev/sda", "/dev/sdb"] libguestfs: trace: list_partitions libguestfs: trace: list_partitions = ["/dev/sda1", "/dev/sdb1"] libguestfs: trace: list_md_devices libguestfs: trace: list_md_devices = [] libguestfs: trace: part_to_dev "/dev/sda1" libguestfs: trace: part_to_dev = "/dev/sda" libguestfs: trace: part_to_dev "/dev/sdb1" libguestfs: trace: part_to_dev = "/dev/sdb" libguestfs: trace: vfs_type "/dev/sda1" libguestfs: trace: vfs_type = "btrfs" libguestfs: trace: btrfs_subvolume_list "/dev/sda1" libguestfs: trace: btrfs_subvolume_list = NULL (error) libguestfs: error: btrfs_subvolume_list: /dev/sda1 on <internal> (options: ''): mount: wrong fs type, bad option, bad superblock on /dev/sda1, missing codepage or helper program, or other error In some cases useful info is found in syslog - try dmesg | tail or so. libguestfs: trace: list_filesystems = NULL (error) When run 'list-filesystems' guestfish will call btrfs_subvolume_list, but i didn't create any subvolume. At Step 1, btrfs_subvolume_list will run successfully and output: libguestfs: trace: btrfs_subvolume_list = <struct guestfs_btrfssubvolume_list *> <no subvolume> But at Step 2, btrfs_subvolume_list failed to run. I don't know why list-filesystems will call btrfs_subvolume_list first. > It seems the "btrfs filesystem show" command could be the only one giving > this information, and its output is less than ideal to parse... > > > Expected results: > > At step 2, can get the filesystem in test-btrfs-devices-1.img, > > test-btrfs-devices-21.img and the filesystem is works well. > > Definitely you cannot use any of the two without the other as well. Is there any way i can use btrfs in test-btrfs-devices-1.img and test-btrfs-devices-2.img again after i quit guestfish? Thanks! Here's the two line reproducer:
$ guestfish -N part:1G -N part:1G mkfs-btrfs "/dev/sda1 /dev/sdb1" : list-filesystems
$ guestfish -a test1.img -a test2.img run : list-filesystems
On Fedora 22:
$ rpm -q libguestfs
libguestfs-1.29.12-1.fc22.x86_64
$ guestfish -N part:1G -N part:1G mkfs-btrfs "/dev/sda1 /dev/sdb1" : list-filesystems
/dev/sda1: btrfs
/dev/sdb1: btrfs
$ guestfish -a test1.img -a test2.img run : list-filesystems
/dev/sda1: btrfs
/dev/sdb1: btrfs
(No bug)
On RHEL 7.1:
$ rpm -q libguestfs
libguestfs-1.28.1-1.14.el7.x86_64
$ guestfish -N part:1G -N part:1G mkfs-btrfs "/dev/sda1 /dev/sdb1" : list-filesystems
/dev/sda1: btrfs
/dev/sdb1: btrfs
$ guestfish -a test1.img -a test2.img run : list-filesystems
libguestfs: error: btrfs_subvolume_list: /dev/sda1 on <internal> (options: ''): mount: wrong fs type, bad option, bad superblock on /dev/sda1,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so.
So yes I agree that there is a bug on RHEL 7.
Verified with the packages: libguestfs-1.32.5-6.el7.x86_64 Verify steps: 1. Create 2 guest image with btrfs: # guestfish -N part:1G -N part:1G mkfs-btrfs "/dev/sda1 /dev/sdb1" : list-filesystems /dev/sda1: btrfs /dev/sdb1: btrfs # guestfish -a test1.img -a test2.img run : list-filesystems /dev/sda1: btrfs /dev/sdb1: btrfs Command finished successfully. 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://rhn.redhat.com/errata/RHSA-2016-2576.html |