Bug 151657 - "pvcreate /dev/device" at LVM2 ends up in "close failed: Bad file descriptor"
"pvcreate /dev/device" at LVM2 ends up in "close failed: Bad file descriptor"
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: lvm2 (Show other bugs)
x86_64 Linux
medium Severity high
: ---
: ---
Assigned To: Alasdair Kergon
Depends On:
  Show dependency treegraph
Reported: 2005-03-21 10:21 EST by Robert Scheck
Modified: 2007-11-30 17:07 EST (History)
1 user (show)

See Also:
Fixed In Version: RHBA-2005-192
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-03-21 10:39:46 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Robert Scheck 2005-03-21 10:21:29 EST
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
--- snapp ---

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

--- snipp ---
       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):

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 10:39:46 EST
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 08:30:01 EDT
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.


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