首页 > 代码库 > pvcreate出错: Can't open /dev/sdb7 exclusively. Mounted filesystem?

pvcreate出错: Can't open /dev/sdb7 exclusively. Mounted filesystem?

环境:VMware Workstation

      Centos7.2 x64

出现故障:

    在两块磁盘上划分两个分区做PV(Physical Volume):

修改两个分区ID为8e

pvcreate /dev/sdb7 /dev/sdc7 

 Can‘t open /dev/sdb7 exclusively.  Mounted filesystem?

因为这两块磁盘之前用来做过软Raid5,所以先卸载Raid5,然后删除。

umount /dev/md5

mdadm -S /dev/md5 //停止md5

rm /dev/md5    //删除md5

再次

pvcreate /dev/sdb7 /dev/sdc7 

  Can‘t open /dev/sdb7 exclusively.  Mounted filesystem?

检查/etc/fstab文件,发现在该文件中有/dev/md5的项目,删除该项目

pvcreate /dev/sdb7 /dev/sdc7 

WARNING: linux_raid_member signature detected on /dev/sdb7 at offset 4096. Wipe it? [y/n]: y

  Wiping linux_raid_member signature on /dev/sdb7.

  Physical volume "/dev/sdb7" successfully created

创建成功!

还有很多问题不明白,在停止md5,rm /dev/md5以后,使用命令cat /proc/mdstat还可以看到Raid信息,期望大神看到可以解答一下,万分感谢!

本文出自 “玩Linux” 博客,请务必保留此出处http://xiaolizi007.blog.51cto.com/4006583/1881988

pvcreate出错: Can't open /dev/sdb7 exclusively. Mounted filesystem?