Bug 151657 - "pvcreate /dev/device" at LVM2 ends up in "close failed: Bad file descriptor"
Summary: "pvcreate /dev/device" at LVM2 ends up in "close failed: Bad file descriptor"
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: lvm2
Version: 4.0
Hardware: x86_64
OS: Linux
medium
high
Target Milestone: ---
: ---
Assignee: Alasdair Kergon
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2005-03-21 15:21 UTC by Robert Scheck
Modified: 2007-11-30 22:07 UTC (History)
1 user (show)

Fixed In Version: RHBA-2005-192
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2005-03-21 15:39:46 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2005:192 0 low SHIPPED_LIVE lvm2 bug fix and enhancement update 2005-06-09 04:00:00 UTC

Description Robert Scheck 2005-03-21 15:21:29 UTC
Description of problem:
"pvcreate /dev/device" at LVM2 ends in "close failed: Bad file descriptor":

--- snipp ---
# pvcreate /dev/sda
/dev/sda: close failed: Bad file descriptor
/dev/sda: close failed: Bad file descriptor
/dev/sda: close failed: Bad file descriptor
/dev/sda: close failed: Bad file descriptor
[...endless...]
--- snapp ---

If I use a partition, for example /dev/sda1, everything works, but even the 
man page of pvcreate tells:

--- snipp ---
Example
       Initialize  partition  #4  on the third SCSI disk and the entire fifth
       SCSI disk for later use by LVM:

       pvcreate /dev/sdc4 /dev/sde
--- snapp ---

Version-Release number of selected component (if applicable):
lvm2-2.00.31-1.0.RHEL4

How reproducible:
Everytime, see below.

Steps to Reproduce:
1. pvcreate /dev/sda
2. Get "close failed: Bad file descriptor"
  
Actual results:
"pvcreate /dev/device" at LVM2 ends up in "close failed: Bad file descriptor".

Expected results:
"pvcreate /dev/device" without partition specificating should work. Otherwise
the man page of pvcreate should be corrected immediately.

Comment 1 Alasdair Kergon 2005-03-21 15:39:46 UTC
If a device /dev/sda is partitioned into /dev/sda1, /dev/sda2 etc. then you
*must* only use /dev/sda1, /dev/sda2 etc. for data - never /dev/sda.  You either
create and use partitions on a device or you don't.

If you want to use /dev/sda directly (and lose all the data on the partitions)
you must remove the partition table first (e.g. use fdisk to delete all the
partitions then write zeros to the first sector of the device).

The endless looping was fixed in 2.00.32 (included in RHEL4 update 1).


Comment 2 Tim Powers 2005-06-09 12:30:01 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 the 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/RHBA-2005-192.html



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