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"
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: lvm2   
(Show other bugs)
Version: 4.0
Hardware: x86_64 Linux
Target Milestone: ---
: ---
Assignee: Alasdair Kergon
QA Contact:
Depends On:
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:
Story Points: ---
Clone Of:
Last Closed: 2005-03-21 15:39:46 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2005:192 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
--- 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 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.


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