Bug 690819

Summary: mkfs fails creating a filesytem on a disk device when using a disk with 'ide' interface
Product: [Community] Virtualization Tools Reporter: Marek Goldmann <mgoldman>
Component: libguestfsAssignee: Richard W.M. Jones <rjones>
Status: CLOSED UPSTREAM QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: mbooth, virt-maint
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-03-25 14:35:05 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Marek Goldmann 2011-03-25 14:12:35 UTC
Description of problem:

See summary. The issue doesn't exists when using a virtio interface for disk.

Version-Release number of selected component (if applicable):

libguestfs-1.8.2-1.fc14.x86_64

><fs> add-drive-with-if build/appliances/i686/centos/5/jeos-centos/ec2-plugin/tmp/jeos-centos.ec2 ide
add_drive_with_if "build/appliances/i686/centos/5/jeos-centos/ec2-plugin/tmp/jeos-centos.ec2" "ide" = 0
><fs> launch 
launch[00000ms] febootstrap-supermin-helper --verbose -f checksum '/usr/lib64/guestfs/supermin.d' x86_64

[SNIP]

><fs> mkfs 'ext3' /dev/sda
mkfs "ext3" "/dev/sda"send_to_daemon: 0x18b2480 g->state = 3, n = 64
proc 138 (readdir) took 0.00 seconds
recv_from_daemon: 0x18b2480 g->state = 3, size_rtn = 0x7fff53d1b13c, buf_rtn = 0x7fff53d1b130
mkfs -t ext3 /dev/sda
mke2fs 1.41.12 (17-May-2010)
guestfsd: error: ext3: /dev/sda: mke2fs 1.41.12 (17-May-2010)
 = -1 (error)
libguestfs: error: mkfs: ext3: /dev/sda: mke2fs 1.41.12 (17-May-2010)
><fs>

Comment 1 Richard W.M. Jones 2011-03-25 14:15:13 UTC
In fact mkfs.ext3 asks a question when asked to create
a filesystem on /dev/sda (not on /dev/vda though!)

/dev/sda is entire device, not just one partition!
Proceed anyway? (y,n) 

The way forward is to special-case this by running
mke2fs (not mkfs) with the -F option.

Comment 3 Richard W.M. Jones 2011-03-25 14:43:07 UTC
This one is also needed for RHEL 5:
http://git.annexia.org/?p=libguestfs.git;a=commitdiff;h=a0e3b2183733c7440ad017c4ffe361935672339b