Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
For bugs related to Red Hat Enterprise Linux 5 product line. The current stable release is 5.10. For Red Hat Enterprise Linux 6 and above, please visit Red Hat JIRA https://issues.redhat.com/secure/CreateIssue!default.jspa?pid=12332745 to report new issues.

Bug 454928

Summary: kpartx doesn't work on large volumes
Product: Red Hat Enterprise Linux 5 Reporter: Chris St. Pierre <cstpierr>
Component: device-mapper-multipathAssignee: Ben Marzinski <bmarzins>
Status: CLOSED ERRATA QA Contact: Cluster QE <mspqa-list>
Severity: medium Docs Contact:
Priority: low    
Version: 5.2CC: agk, bmarzins, bmr, christophe.varoqui, cmarthal, dwysocha, edamato, egoggin, heinzm, junichi.nomura, kueda, lmb, mbroz, prockai, ralph, tranlan
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-01-20 22:09:29 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 Chris St. Pierre 2008-07-10 20:11:00 UTC
Description of problem:

kpartx errors out on files 2Gb or larger (on 32-bit) or 8Gb or larger (on 64-bit) 
with the cryptic error:

failed to stat() <filename>

Giving it the -v flag does not give any more output.

I have replicated this on Fedora 8 and 9 as well.

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

kpartx-0.4.7-17.el5

How reproducible:

Every time.

Steps to Reproduce:

1. Create a file 2Gb or larger on a 32-bit system, or 8Gb or larger on a 64-bit 
system.
2. Run kpartx on it.
3. Fail!
  
Actual results:

Fails to stat:

# dd if=/dev/zero of=2g.img bs=1024M count=2
2+0 records in
2+0 records out
2147483648 bytes (2.1 GB) copied, 45.3624 seconds, 47.3 MB/s
# kpartx -l 2g.img
failed to stat() 2g.img

Expected results:

It works with files just under 2Gb:

# dd if=/dev/zero of=almost2g.img bs=1000M count=2
2+0 records in
2+0 records out
2097152000 bytes (2.1 GB) copied, 45.1009 seconds, 46.5 MB/s
# kpartx -l almost2g.img

Additional info:

The results I pasted were from a 32-bit machine.  It works exactly the same with 
a 8Gb threshold on 64-bit machines.

This really sucks, since kpartx _would be_ a great tool for working with virtual 
machines, if it worked on large files.  But we use 10 Gb files for our VMs (which 
is even smaller than a lot of people), so we can't mount them on 32- or 64-bit 
systems.

If there's a workaround we can use in the mean time, I'd appreciate that, too.

This has been reported to CentOS as well, but without any activity: http://
bugs.centos.org/view.php?id=2882

Comment 1 RHEL Program Management 2008-07-14 19:13:30 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.

Comment 2 Ben Marzinski 2008-08-26 03:51:21 UTC
Fixed. Kpartx now uses the 64bit versions of the file access functions.

Comment 5 errata-xmlrpc 2009-01-20 22:09:29 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHEA-2009-0232.html