# pvcreate  Can't open /dev/xxx exclusively.  Mounted fs ?

**URL:** <https://forums.suse.com/t/pvcreate-cant-open-dev-xxx-exclusively-mounted-fs/30077>\
**Category:** SLES Configure-Administer\
**Created:** [July 21, 2017, 7:02pm UTC](https://forums.suse.com/t/pvcreate-cant-open-dev-xxx-exclusively-mounted-fs/30077 "2017-07-21T19:02:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![berndgsflinux](https://avatars.discourse-cdn.com/v4/letter/b/6a8cbe/32.png) [@berndgsflinux](https://forums.suse.com/u/berndgsflinux)\
**Post date:** [July 21, 2017, 7:02pm UTC](https://forums.suse.com/t/pvcreate-cant-open-dev-xxx-exclusively-mounted-fs/30077/1 "2017-07-21T19:02:54Z")

</div>

Hi,

i have a HP Raid controller with a RAID 5 configuration. A lot of the disk space was not used until now. I want to add the unused space to a volume group. With fdisk i created a further partition:

[CODE]ha-idg-2:~ # fdisk -l

Disk /dev/cciss/c0d0: 1200.2 GB, 1200186941440 bytes  
255 heads, 32 sectors/track, 287269 cylinders, total 2344115120 sectors  
Units = sectors of 1 \* 512 = 512 bytes  
Sector size (logical/physical): 512 bytes / 512 bytes  
I/O size (minimum/optimal): 512 bytes / 512 bytes  
Disk identifier: 0x00032ae8

```
       Device Boot Start End Blocks Id System

```

/dev/cciss/c0d0p1 2048 618663935 309330944 8e Linux LVM  
/dev/cciss/c0d0p2 618663936 622856191 2096128 82 Linux swap / Solaris  
/dev/cciss/c0d0p3 \* 622856192 623884287 514048 83 Linux  
/dev/cciss/c0d0p4 623884288 2344115119 860115416 8e Linux LVM  
[/CODE]

c0d0p4 has just been created, i cahnged the type to 8e.

But i can’t create the respective physical volume:

`ha-idg-2:~ # pvcreate -dv /dev/cciss/c0d0p4
pvcreate Can't open /dev/cciss/c0d0p4 exclusively. Mounted filesystem?`

A mounted fs is surely not the reason, the partition is freshly created. Partprobe didn’t help.  
I found out that device-mapper feels responsible for this device:

[CODE]Disk /dev/mapper/3600508b1001c5037520913a9b581d78d: 1200.2 GB, 1200186941440 bytes  
255 heads, 63 sectors/track, 145914 cylinders, total 2344115120 sectors  
Units = sectors of 1 \* 512 = 512 bytes  
Sector size (logical/physical): 512 bytes / 512 bytes  
I/O size (minimum/optimal): 512 bytes / 512 bytes  
Disk identifier: 0x00032ae8

```
                                    Device Boot Start End Blocks Id System

```

/dev/mapper/3600508b1001c5037520913a9b581d78d\_part1 2048 618663935 309330944 8e Linux LVM  
/dev/mapper/3600508b1001c5037520913a9b581d78d\_part2 618663936 622856191 2096128 82 Linux swap / Solaris  
/dev/mapper/3600508b1001c5037520913a9b581d78d\_part3 \* 622856192 623884287 514048 83 Linux[/CODE]

That’s exact the same layout as for /dev/cciss/c0d0, except partition 4.  
Strange. I thought that dm is reponsible for logical volumes, RAID, multipath, but not for plain partitions.  
I tried to force device-mapper to rescan the disk, so that it knows about the new partition.  
I tried /etc/init.d/boot.device-mapper stop and afterwards start, but it still does not see the new partition.

Then i tried kpartx to reread the disk, and it created new entries in /dev/mapper:

`ha-idg-2:~ # ll /dev/mapper/
total 0
lrwxrwxrwx 1 root root 7 Jul 21 17:13 3600508b1001c5037520913a9b581d78d -> ../dm-0
lrwxrwxrwx 1 root root 7 Jul 21 17:13 3600508b1001c5037520913a9b581d78d_part1 -> ../dm-2
lrwxrwxrwx 1 root root 7 Jul 21 17:13 3600508b1001c5037520913a9b581d78d_part2 -> ../dm-3
lrwxrwxrwx 1 root root 7 Jul 21 17:13 3600508b1001c5037520913a9b581d78d_part3 -> ../dm-4
lrwxrwxrwx 1 root root 7 Jul 21 17:13 3600c0ff00012824b04af7a5201000000 -> ../dm-1
lrwxrwxrwx 1 root root 8 Jul 21 17:25 c0d0p1 -> ../dm-10
lrwxrwxrwx 1 root root 8 Jul 21 17:25 c0d0p2 -> ../dm-11
lrwxrwxrwx 1 root root 8 Jul 21 17:25 c0d0p3 -> ../dm-12 <==============
lrwxrwxrwx 1 root root 8 Jul 21 17:25 c0d0p4 -> ../dm-13`

now it works:

[CODE]ha-idg-2:~ # pvcreate -dv /dev/mapper/c0d0p4

pvcreate Set up physical volume for “/dev/mapper/c0d0p4” with 1720230832 available sectors  
pvcreate Zeroing start of device /dev/mapper/c0d0p4  
pvcreate Writing physical volume data to disk “/dev/mapper/c0d0p4”  
pvcreate Wiping cache of LVM-capable devices  
pvcreate Found duplicate PV pffUbBgEXgVeDgbDYO0J0tkHpZyFanUg: using /dev/mapper/c0d0p1 not /dev/mapper/3600508b1001c5037520913a9b581d78d\_part1  
pvcreate Physical volume “/dev/mapper/c0d0p4” successfully created[/CODE]

It says that it found one pv twice (partition 1), probably because i have now a new entry /dev/cciss/c0d0p1 pointing to the same pv.

Is this the right procedure ? Or is there a way to have a /dev/mapper/3600508b1001c5037520913a9b581d78d\_part4 ?  
That would be more consistent.

Bernd

---

<div class="post-metadata">

**Author:** ![Automatic\_Reply](https://avatars.discourse-cdn.com/v4/letter/a/ecb155/32.png) [@Automatic\_Reply](https://forums.suse.com/u/Automatic_Reply)\
**Post date:** [July 26, 2017, 7:30am UTC](https://forums.suse.com/t/pvcreate-cant-open-dev-xxx-exclusively-mounted-fs/30077/2 "2017-07-26T07:30:28Z")

</div>

berndgsflinux,

It appears that in the past few days you have not received a response to your  
posting. That concerns us, and has triggered this automated reply.

These forums are peer-to-peer, best effort, volunteer run and that if your issue  
is urgent or not getting a response, you might try one of the following options:

- Visit [http://www.suse.com/support](http://www.suse.com/support) and search the knowledgebase and/or check all  
the other support options available.
- Open a service request: [https://www.suse.com/support](https://www.suse.com/support)
- You could also try posting your message again. Make sure it is posted in the  
correct newsgroup. ([http://forums.suse.com](http://forums.suse.com))

Be sure to read the forum FAQ about what to expect in the way of responses:  
[http://forums.suse.com/faq.php](http://forums.suse.com/faq.php)

If this is a reply to a duplicate posting or otherwise posted in error, please  
ignore and accept our apologies and rest assured we will issue a stern reprimand  
to our posting bot…

Good luck!

Your SUSE Forums Team  
[http://forums.suse.com](http://forums.suse.com)
