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.
Posted in Sundry sysadmin
September 12th, 2008 at 4:43 pm
haha~ you help me~ thanks
September 12th, 2008 at 4:45 pm
[root@localhost ~]# dmraid -a no
[root@localhost ~]# man dmraid
[root@localhost ~]# pvcreate /dev/hda1
Physical volume “/dev/hda1″ successfully created
WOW~ Good~
April 18th, 2009 at 4:00 am
Thank you. Another person saved by your post.