Bug 1000428
Summary: | virt-format uses wrong partition type for vfat filesystems | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | Gerd Hoffmann <kraxel> |
Component: | libguestfs | Assignee: | Richard W.M. Jones <rjones> |
Status: | CLOSED CURRENTRELEASE | QA Contact: | Virtualization Bugs <virt-bugs> |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | 7.0 | CC: | bfan, leiwang, lkong, wshi |
Target Milestone: | rc | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | libguestfs-1.22.6-5.el7 | Doc Type: | Bug Fix |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2014-06-13 12:48:50 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: |
Description
Gerd Hoffmann
2013-08-23 12:39:48 UTC
Doh. We fixed the same problem in virt-make-fs too ... (In reply to Gerd Hoffmann from comment #0) > While being at it: Having a --label=<text> cmd line switch (to specify a > volume label for the filesystem) would be great too. Wanna have a separate > RFE bug for this? Don't worry, I'll fix them both. Fixed upstream in the following commits: https://github.com/libguestfs/libguestfs/commit/d432ab2b5a965110bab542bfd397785eee9753dd https://github.com/libguestfs/libguestfs/commit/c46e41cb3c41f6283e0350cac6ef0b9178ed3941 https://github.com/libguestfs/libguestfs/commit/e17cd73fb7e3d7ce5e28f51c8451033f48a39153 https://github.com/libguestfs/libguestfs/commit/a75ca610b80614253f8a9d9828a97dc61d919b8a Can reproduce with libguestfs-tools-c-1.22.5-3.el7.x86_64 Steps to reproduce: 1. qemu-img create -f qcow2 test.img 100M 2. virt-format --add test.img --format=qcow2 --partition=mbr --filesystem=vfat 3. attach image as usb disk to windows guest Result: usbstick doesn't show up in Windows Explorer (In reply to Lingfei Kong from comment #4) > Can reproduce with libguestfs-tools-c-1.22.5-3.el7.x86_64 > > Steps to reproduce: > 1. qemu-img create -f qcow2 test.img 100M > 2. virt-format --add test.img --format=qcow2 --partition=mbr > --filesystem=vfat > 3. attach image as usb disk to windows guest When attaching the image, did you ensure the format is set to qcow2? If you set it to raw then Windows would just see a qcow2 header, everything would be completely broken. > Result: > usbstick doesn't show up in Windows Explorer Can you run: virt-filesystems -a test.img --all --long -h The output should show that the MBR byte is set to 0b. For examples see: https://github.com/libguestfs/libguestfs/commit/d432ab2b5a965110bab542bfd397785eee9753dd (In reply to Richard W.M. Jones from comment #5) > When attaching the image, did you ensure the format is set > to qcow2? If you set it to raw then Windows would just see > a qcow2 header, everything would be completely broken. Yes, I specified the format as qcow2 in the steps showed in commnet #4, here is the command I used to attach the image file: /usr/libexec/qemu-kvm -m 1024 -name "VM" -drive file=/root/win.img -usbdevice disk:format=qcow2:/test.img > Can you run: > > virt-filesystems -a test.img --all --long -h > > The output should show that the MBR byte is set to 0b. I checked the image file(showed in comment #4, it is created with command: virt-format --add test.img --format=qcow2 --partition=mbr --filesystem=vfat ) with virt-filesystems tool, the following is the output: [host]#virt-filesystems -a test.img --all --long -h Name Type VFS Label MBR Size Parent /dev/sda1 filesystem vfat - - 100M - /dev/sda1 partition - - 83 100M /dev/sda /dev/sda device - - - 100M - It shows the MBR byte is 83 not 0b. I'm just reading back more closely. It looks like you have correctly reproduced the original problem with 1.22.5. The bug should be fixed in libguestfs >= 1.22.6-5.el7. Verified it with libguestfs-1.22.6-15.el7 Steps to verify: 1. #qemu-img create -f qcow2 test.img 100M 2. #virt-format --add test.img --format=qcow2 --partition=mbr --filesystem=vfat 3. attach image as usb disk to windows guest #/usr/libexec/qemu-kvm -m 1024 -name "VM" -drive file=/var/lib/libvirt/images/vm1.img -usbdevice disk:format=qcow2:/root/lkong/test.img -vnc :0 4. # virt-filesystems -a test.img --all --long -h Name Type VFS Label MBR Size Parent /dev/sda1 filesystem vfat - - 100M - /dev/sda1 partition - - 0b 100M /dev/sda /dev/sda device - - - 100M - Result: 1. usbstick shows up in Windows Explorer. 2. It shows the MBR byte is 0b in step 4. So, this bug is fixed. This request was resolved in Red Hat Enterprise Linux 7.0. Contact your manager or support representative in case you have further questions about the request. |