LVM with dmraid

When adding a new disk for a customer running CentOS 4.7 on severely old hardware, I bumped into something I’ve never had happening to me before. Basically the system wouldn’t let me create the Physical Volume and gave me this message:

[root@gwyneth ~]# pvcreate /dev/hdc1
Can't open /dev/hdc1 exclusively. Mounted filesystem?

hdc1 was obviously not mounted or in any other way used. Or so I thought. As I was flicking through the loaded kernel modules, I saw the dm_* modules being loaded and I was quite sure I knew what it was at that point. dmraid is hogging the disk. I verified that dmraid was indeed aware of the new disk with:

[root@gwyneth ~]# dmraid -r
/dev/hdc: pdc, "pdc_hceidaeha", mirror, ok, 78125000 sectors, data@ 0

So deactivating the (in)appropriate RAID set:

[root@gwyneth ~]# dmraid -a no pdc
[root@gwyneth ~]# pvcreate /dev/hdc1
Physical volume "/dev/hdc1" successfully created

Obviously, if you currently aren’t or don’t plan on ever run any software RAID setup (which you shouldn’t on a server in my opinion), you do best in removing the dmraid package altogether to avoid the same or similar problems in the future.

About Erik Ljungstrom

I'm Erik Ljungstrom and I work in a datacenter as a technical team leader. In this blog I will mostly jot down things I consider noteworthy things I encounter in my work. For more information, please see http://northernmost.org
This entry was posted in Sundry sysadmin and tagged , . Bookmark the permalink.

3 Responses to LVM with dmraid

  1. XianfengXiu says:

    haha~ you help me~ thanks

  2. XianfengXiu says:

    [root@localhost ~]# dmraid -a no
    [root@localhost ~]# man dmraid
    [root@localhost ~]# pvcreate /dev/hda1
    Physical volume “/dev/hda1″ successfully created

    WOW~ Good~

  3. Chaim Kraue says:

    Thank you. Another person saved by your post.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>