我正在尝试添加一个物理卷,用于添加卷组,从而在其中添加 LV。遗憾的是,我收到了以下错误。
[root@server ~]# pvcreate /dev/sdb1
Device /dev/sdb1 not found (or ignored by filtering).
[root@server ~]# fdisk -l /dev/sdb
WARNING: GPT (GUID Partition Table) detected on '/dev/sdb'! The util fdisk doesn't support GPT. Use GNU Parted.
Disk /dev/sdb: 19966.2 GB, 19966213488640 bytes
255 heads, 63 sectors/track, 2427420 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Device Boot Start End Blocks Id System
/dev/sdb1 1 267350 2147483647+ ee GPT
我将非常感激您提供的任何帮助。这是我第一次添加 pv,在研究这个问题时,我没有发现任何有用的信息。
操作系统是 centos 6 - 64位
筛选器
# By default we accept every block device:
filter = [ "a/.*/" ]
# Exclude the cdrom drive
# filter = [ "r|/dev/cdrom|" ]
# When testing I like to work with just loopback devices:
# filter = [ "a/loop/", "r/.*/" ]
# Or maybe all loops and ide drives except hdc:
# filter =[ "a|loop|", "r|/dev/hdc|", "a|/dev/ide|", "r|.*|" ]
# Use anchors if you want to be really specific
# filter = [ "a|^/dev/hda8$|", "r/.*/" ]
分手:
parted /dev/sdb "unit s" "print"
Model: Adaptec AdaptecRAID5 (scsi)
Disk /dev/sdb: 38996510720s
Sector size (logical/physical): 512B/512B
Partition Table: gpt
答案1
答案2
我发现我要么需要重新启动服务器,要么运行“partprobe /dev/sdaX”,以便 pvcreate 能够正确获知分区信息。
此外,fdisk 不了解 lvm,因此它会发出有关分区的错误,这让我认为存在更大的问题,但事实并非如此。
答案3
块设备类型也可能是一个问题。如果您运行pvcreate
并-vvvv
看到类似“跳过:无法识别的 LVM 设备类型 251”的错误,那么您必须将魔法数字添加到允许的设备列表中。
只需查找设备类型的数字/proc/devices
并将其添加到devices
lvm 配置部分/etc/lvm/lvm.conf
,例如:
types = [ "bcache", 251 ]
就这样,现在您就可以pvcreate
按预期使用。
答案4
您的 parted 输出显示您没有任何分区,因此/dev/sdb1
不存在。您需要先创建分区。