LVM学习逻辑卷管理创建逻辑卷遇到的问题
1 实验环境
系统内核发行版本CentOS 2.6.32-754.2.1.el6.x86_64 CentOS release 6.10 (Final)
由于是最小化安装没有xfs命令,yum安装如下包支持此命令
[root@www ~]# yum install xfsprogs
Loaded plugins: fastestmirror, security
Setting up Install Process
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package xfsprogs.x86_64 0:3.1.1-20.el6 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
======================================================================================================
Package Arch Version Repository Size
======================================================================================================
Installing:
xfsprogs x86_64 3.1.1-20.el6 base 725 k
Transaction Summary
======================================================================================================
Install 1 Package(s)
Total download size: 725 k
Installed size: 3.2 M
Is this ok [y/N]: y
Downloading Packages:
xfsprogs-3.1.1-20.el6.x86_64.rpm | 725 kB 00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : xfsprogs-3.1.1-20.el6.x86_64 1/1
Verifying : xfsprogs-3.1.1-20.el6.x86_64 1/1
Installed:
xfsprogs.x86_64 0:3.1.1-20.el6
Complete!
2 用gdisk分区对/dev/sdb分区然后再删除后遇到以下问题
[root@www ~]# pvcreate /dev/sdb
Device /dev/sdb not found (or ignored by filtering).
3 解决方法
开始尝试使用partprobe /dev/sdb但是没有用处,后来用如下命令解决.
[root@www ~]# dd if=/dev/urandom of=/dev/sdb bs=512 count=64
64+0 records in
64+0 records out
32768 bytes (33 kB) copied, 0.0513912 s, 638 kB/s
[root@www ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sr0 11:0 1 4.3G 0 rom
sda 8:0 0 20G 0 disk
├─sda1 8:1 0 200M 0 part /boot
├─sda2 8:2 0 1G 0 part [SWAP]
└─sda3 8:3 0 18.8G 0 part /
sdb 8:16 0 1G 0 disk
sdc 8:32 0 1G 0 disk
sdd 8:48 0 1G 0 disk
sde 8:64 0 1G 0 disk
[root@www ~]# pvcreate /dev/sdb
Physical volume "/dev/sdb" successfully created
[root@www ~]#
[root@www ~]# pvs
PV VG Fmt Attr PSize PFree
/dev/sdb lvm2 ---- 1.00g 1.00g
/dev/sdc lvm2 ---- 1.00g 1.00g
/dev/sdd lvm2 ---- 1.00g 1.00g
为什么会报如上的错误呢,我现在还没有搞清楚.
[root@www ~]# vgcreate storage /dev/sdb /dev/sdc /dev/sdd
Volume group "storage" successfully created
[root@www ~]# vgs
VG #PV #LV #SN Attr VSize VFree
storage 3 0 0 wz--n- 2.99g 2.99g
[root@www ~]# pvs
PV VG Fmt Attr PSize PFree
/dev/sdb storage lvm2 a--u 1020.00m 1020.00m
/dev/sdc storage lvm2 a--u 1020.00m 1020.00m
/dev/sdd storage lvm2 a--u 1020.00m 1020.00m