pgcreate /dev/sdb 提示 Device /dev/sdb excluded by a filter解决办法

在创建pv卷报错Device /dev/sdb excluded by a filter,原因就是无法找到分区表导致,需要重建下分区表,这次是不知道操作顺序还是虚拟机新增的磁盘有问题,导致无法进行逻辑卷创建

问题的解决办法就是删除卷后重新创建逻辑卷后即可

问题如下

fdisk-l /dev/sdb
输入(创建新分区) :n;
输入(主扇区):p
输入(1): 1 #起始扇区
输入回车:取默认值
输入回车:取默认值
输入:w 保存退出

[root@localhost indices]# fdisk /dev/sdc
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0x5799aeba.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won’t be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

WARNING: The size of this disk is 2.2 TB (2199023255552 bytes).
DOS partition table format can not be used on drives for volumes
larger than (2199023255040 bytes) for 512-byte sectors. Use parted(1) and GUID
partition table format (GPT).

WARNING: DOS-compatible mode is deprecated. It’s strongly recommended to
switch off the mode (command ‘c’) and change display units to
sectors (command ‘u’).

Command (m for help): n #new 新分区
Command action
e extended
p primary partition (1-4)
p #选择主扇区
Partition number (1-4): 1 #起始扇区
First cylinder (1-267349, default 1): #这里直接回车表示取默认值1
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-267349, default 267349): #这里由于es需要的存储空间比较大,所以2个T的空间我都加上了,正常可以按照需求修改扇区大小
Using default value 267349

Command (m for help): w #保存退出
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.

而后pvcreate 创建逻辑卷报错

pvcreate /dev/sdb
Device /dev/sdb excluded by a filter.

解决办法如下:
fdisk -l
参看磁盘情况,需要扩容的盘dev/dsdb 还存在

重建分区和再次创建卷的时候擦除签名信息
parted /dev/sdb
输入:mklabel msdos
输入: Yes
输入:quit

重建就完成了;

pvcreate /dev/sdb
输入:y

会提示 : 物理卷 dev/sdb 成功创建

后面就是正常流程的扩容

1.后创建物理卷,使用pvcreate /dev/sdb (这一步在之前已完成)

2.使用vgscan查看 物理卷组 名称

3。使用 vgextend centos /dev/sdb
将刚才增加的物理扇区加载到卷组中,需要确认在vgscan卷组名字,有些会是“centos”或者“VolGroup”

4.增加卷组的大小
使用lvextend -l +100%FREE /dev/centos/root

*后面路径为需要扩容的路径

提示 逻辑卷成功已经扩容成功,就完成了

确认扩容情况;
使用df -h查看空间扩充情况

没有扩容成功的话需要同步一下文件系统

resize2fs -f /dev/mapper/centos-root

使用df -h查看空间扩充情况

  • 0
    点赞
  • 24
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值