Bug 161514 - Permission denied when trying to create filesystem on logical volume
Summary: Permission denied when trying to create filesystem on logical volume
Alias: None
Product: Fedora
Classification: Fedora
Component: lvm2
Version: 4
Hardware: i386
OS: Linux
Target Milestone: ---
Assignee: Alasdair Kergon
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 2005-06-23 20:58 UTC by rich turner
Modified: 2007-11-30 22:11 UTC (History)
3 users (show)

Fixed In Version: old
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2007-01-10 17:43:32 UTC
Type: ---

Attachments (Terms of Use)

Description rich turner 2005-06-23 20:58:02 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050511 Firefox/1.0.4 SUSE/1.0.4-1.1

Description of problem:
after creating a new logical volume, i attempt to create a filesystem on that logical volume and receive the following error message:
mkfs.ext2 /dev/stbackupvg/stbackuplv
mke2fs 1.37 (21-Mar-2005)
Could not stat /dev/testvg/testlv --- Permission denied

if i use the /dev/dm- name for the device (/dev/dm-0 in this case) i am able to create the filesystem. both the /dev/testvg and /dev/dm-0 have the same major/minor numbers. i do notice that they have different selinux policies, so this may be a selinux issue rather than a lvm2 issue.

# ls -lZ /dev/testvg/testlv
brw-rw----  root     disk     root:object_r:device_t           /dev/mapper/stbackupvg-stbackuplv
# ls -lZ /dev/dm-0
brw-r-----  root     disk     system_u:object_r:fixed_disk_device_t /dev/dm-0

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

How reproducible:

Steps to Reproduce:
1.pvcreate -ff -y /dev/hda2
2.vgcreate -s 16M -p 16 -l 32 /dev/testvg /dev/hda2
3.vgchange -ay testvg
4.lvcreate -l 2383 -n testlv testvg /dev/hda2
5.mkfs.ext2 /dev/testvg/testlv

Actual Results:  mkfs.ext2 /dev/stbackupvg/stbackuplv
mke2fs 1.37 (21-Mar-2005)
Could not stat /dev/testvg/testlv --- Permission denied

Expected Results:  i would have expected it to create the filesystem on the device

Additional info:

i had no problems creating the filesystem on /dev/testvg/testlv when i rebooted the system with selinux=0

Comment 1 rich turner 2005-06-23 21:03:01 UTC
you will see some inconsistencies in device naming as i copied and pasted them
into the bug report. stbackupvg can be replaced with testvg, and stbackuplv can
be replaced with testlv. sorry for not reviewing it before submitting it.

Comment 2 Alasdair Kergon 2007-01-10 17:43:32 UTC
I believe this got fixed - there were several similar reports.

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