Linux挂载LVM分区的方法

来源:互联网 发布:sql架构 编辑:程序博客网 时间:2024/06/05 10:37

#fdisk -l
[root@localhost /]# fdisk -l
Disk /dev/sda: 36.7 GB, 36778545152 bytes
255 heads, 63 sectors/track, 4471 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot      Start         End      Blocks   Id System
/dev/sda1   *           1          13      104391   83 Linux
/dev/sda2              14        2463    19679625   83 Linux
/dev/sda3            2464        3949    11936295   83 Linux
/dev/sda4            3950        4471     4192965    5 Extended
/dev/sda5            3950        4471     4192933+ 82 Linux swap / Solaris
Disk /dev/sdb: 73.4 GB, 73407868928 bytes
255 heads, 63 sectors/track, 8924 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot      Start         End      Blocks   Id System
/dev/sdb1   *           1        8924    71681998+ 8e Linux LVM
Disk /dev/sdc: 36.7 GB, 36703934464 bytes
255 heads, 63 sectors/track, 4462 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot      Start         End      Blocks   Id System
/dev/sdc1   *           1          13      104391   83 Linux
/dev/sdc2              14        4462    35736592+ 8e Linux LVM
[root@localhost /]# pvs
PV         VG         Fmt Attr PSize PFree
/dev/sdb1             lvm2 --   68.36G 68.36G
/dev/sdc2 VolGroup00 lvm2 a-   34.06G 32.00M

sdc2就是我要挂接的
[root@localhost /]# vgscan
Reading all physical volumes. This may take a while...
Found volume group "VolGroup00" using metadata type lvm2

[root@localhost /]# lvscan
inactive            '/dev/VolGroup00/LogVol00' [32.09 GB] inherit
inactive           '/dev/VolGroup00/LogVol01' [1.94 GB] inherit
可以看到新修改的VolGroup00是inactive状态

[root@localhost /]# vgchange -a y
2 logical volume(s) in volume group "VolGroup00" now active
[root@localhost /]# lvscan
ACTIVE            '/dev/VolGroup00/LogVol00' [32.09 GB] inherit
ACTIVE            '/dev/VolGroup00/LogVol01' [1.94 GB] inherit
好了,现在可以挂载了

[root@localhost /]# mount -t ext3 /dev/VolGroup00/LogVol00 /d1

在创建LV时出现的错误
/proc/misc: No entry for device-mapper found Is device-mapper driver missing from kernel?Failure to communicate with kernel device-mapper driver.
解决:modprobe dm-mod