Bug 927172 - pool-build --overwrite can not format type xfs filesystem
Summary: pool-build --overwrite can not format type xfs filesystem
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libvirt
Version: unspecified
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Libvirt Maintainers
QA Contact:
URL:
Whiteboard:
: 927174 (view as bug list)
Depends On:
Blocks: 927174
TreeView+ depends on / blocked
 
Reported: 2013-03-25 09:30 UTC by Huang Wenlong
Modified: 2014-07-06 19:31 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 927174 (view as bug list)
Environment:
Last Closed: 2014-04-03 12:13:35 UTC
Embargoed:


Attachments (Terms of Use)

Description Huang Wenlong 2013-03-25 09:30:42 UTC
Description of problem:
pool-build --overwrite   can not format type xfs filesystem

Version-Release number of selected component (if applicable):
libvirt-0.10.2-18.el6_4.2.x86_64

How reproducible:
100

Steps to Reproduce:
1. prepare a fs ext3 partition
<pool type='fs'>
  <name>sda2</name>
  <source>
    <device path='/dev/sda2'/>
    <format type='xfs'/>
  </source>
  <target>
    <path>/var/lib/libvirt/images/sda2</path>
    <permissions>
      <mode>0755</mode>
      <owner>0</owner>
      <group>0</group>
    </permissions>
  </target>
</pool>

2. format sda2
#mkfs.ext3 -F /dev/sda2

3. define and build pool --overwrite
# virsh pool-define sda2-new.xml
Pool sda2 defined from sda2-new.xml

## virsh pool-build --overwrite sda2
error: Failed to build pool sda2
error: Failed to make filesystem of type 'xfs' on device '/dev/sda2': File exists


 
Actual results:
as steps

Expected results:
pool-build should succeed

Additional info:
GFS2 format also can not be formated via pool-build --overwrite

Comment 1 zhenfeng wang 2013-03-26 03:03:24 UTC
I just found there were several pool famats in libvirt.org,can pool-build --overwrite format these filesystem ? thanks

The following was the record in libivrt.org 
Valid pool format types

The filesystem pool supports the following formats:

    auto - automatically determine format
    ext2
    ext3
    ext4
    ufs
    iso9660
    udf
    gfs
    gfs2
    vfat
    hfs+
    xfs
    ocfs2

Comment 2 Osier Yang 2013-03-26 10:22:47 UTC
(In reply to comment #1)
> I just found there were several pool famats in libvirt.org,can pool-build
> --overwrite format these filesystem ? thanks

I don't think anyone have tried this, could you do it?

Comment 3 zhenfeng wang 2013-03-27 04:00:25 UTC
I just try it on both rhel6 and rhel7 , and got the same result as following,however I'm still not sure whether these pool format were supported by libvirt
libvirtd version:
for rhel6:
libvirt-0.10.2-18.el6_4.2.x86_64
for rhel7:
libvirt-1.0.3-1.el7.x86_64

1 These pool format can be formated via pool-build --overwrite or --no-overwrite
 ext2 ext3 ext4 vfat

2 These pool format  can not be formated via pool-build --overwrite 
auto ufs iso9660 udf gfs gfs2 hfs+ xfs ocfs2

they report the following error
#virsh pool-build sda2 --overwrite
error: Failed to build pool sda2
error: Failed to make filesystem of type 'auto' on device '/dev/sda2': File existserror: Failed to build pool sda2
error: Failed to make filesystem of type 'auto' on device '/dev/sda2': File exists

3. These pool format can not be formated via pool-build --no-overwrite

for pool format: iso9660 ufs udf gfs gfs2  xfs ocfs2,they report the following error
virsh pool-build sda2 --no-overwrite
error: Failed to build pool sda2
error: Failed to make filesystem of type 'ufs' on device '/dev/sda5': Inappropriate ioctl for device

for pool format: auto hfs+, they reported another error,as following:
virsh pool-build sda2 --no-overwrite
error: Failed to build pool sda2
error: Storage pool probe failed: Not capable of probing for filesystem of type hfs+

Comment 5 Ján Tomko 2014-04-03 10:25:01 UTC
*** Bug 927174 has been marked as a duplicate of this bug. ***

Comment 6 Ján Tomko 2014-04-03 12:13:35 UTC
Fixed upstream by:
commit 904e6e906be91c0518797ecee807fd2c03850f5c
Author:     Ján Tomko <jtomko>
CommitDate: 2014-04-03 14:10:28 +0200

    Use the force flag for mkfs -t xfs
    
    Without this, building an XFS pool on a formatted partition
    fails with --overwrite.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=927172

git describe: v1.2.3-37-g904e6e9


Note You need to log in before you can comment on or make changes to this bug.