Red Hat Enterprise Linux 7 installation failed with LVM on MD device with "Can't open /dev/md/1 exclusively. Mounted filesystem?" from pvcreate command

Solution Verified - Updated -

Issue

  • I had a problem to install Red Hat Enterprise Linux 7 with kickstart. The installation stopped on the way.
  • I configured the LVM on MD raid in kickstart file as below.
part raid.01 --size=512 --ondisk=sda
part raid.02 --size=131072 --grow --ondisk=sda
part raid.03 --size=512 --ondisk=sdb
part raid.04 --size=131072 --grow --ondisk=sdb

raid /boot --fstype=ext4 --level=1 --device=md0 raid.01 raid.03 
raid pv.01 --fstype=ext4 --level=1 --device=md1 raid.02 raid.04 
volgroup vg_root pv.01 
logvol / --fstype=ext4 --name=lv_root --vgname=vg_root --size=16384 
logvol swap --fstype=swap --name=lv_swap --vgname=vg_root --size=8192 
  • I found the following error in /tmp/program.log.
    ~~
    XX:XX:XX,XXX INFO program: Running... lvm pvcreate --config devices { preferred_names=["^/dev/mapper/", "^/dev/md/", "^/dev/sd"] } /dev/md/1
    XX:XX:XX,XXX INFO program: Can't open /dev/md/1 exclusively. Mounted filesystem?
    XX:XX:XX,XXX DEBUG program: Return code: 5
    ~~~
  • How can I avoid this problem?

Environment

Red Hat Enterprise Linux 7

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.