在Fedora 9里试图挂载另外一块硬盘,其中的一个分区是LVM2格式的,不能直接:“mount /dev/sdb3 /mnt/sdb3”,查找挂载方法破费了一番周折,记录如下,以备不时之需。
1、pvs
[root@localhost yuanbor]# /sbin/pvs
WARNING: Duplicate VG name VolGroup00: Existing tWwhxK-0M8r-sqhQ-VW7m-0BYv-BPkO-pgBRM8 (created here) takes precedence over 7kU450-LaPn-afEa-iWGw-xiqD-Tmwe-ohpL3f
PV VG Fmt Attr PSize PFree
/dev/sda2 VolGroup00 lvm2 a- 33.97G 32.00M
/dev/sdb3 VolGroup00 lvm2 a- 36.78G 32.00M
这个比较惨,两个VG名字重了,下面将第二个VG修改名字。
2、vgrename
[root@localhost yuanbor]#/sbin/vgrename 7kU450-LaPn-afEa-iWGw-xiqD-Tmwe-ohpL3f /dev/VolGroup01
WARNING: Duplicate VG name VolGroup00: Existing tWwhxK-0M8r-sqhQ-VW7m-0BYv-BPkO-pgBRM8 (created here) takes precedence over 7kU450-LaPn-afEa-iWGw-xiqD-Tmwe-ohpL3f
Volume group "VolGroup00" successfully renamed to "VolGroup01"
[root@localhost yuanbor]# /sbin/pvs
PV VG Fmt Attr PSize PFree
/dev/sda2 VolGroup00 lvm2 a- 33.97G 32.00M
/dev/sdb3 VolGroup01 lvm2 a- 36.78G 32.00M
3、lvscan
[root@localhost sdb3]# /sbin/lvscan
inactive '/dev/VolGroup01/LogVol00' [34.81 GB] inherit
inactive '/dev/VolGroup01/LogVol01' [1.94 GB] inherit
ACTIVE '/dev/VolGroup00/LogVol00' [32.00 GB] inherit
ACTIVE '/dev/VolGroup00/LogVol01' [1.94 GB] inherit
可以看到新修改的VolGroup01是inactive状态。
4、vgchange
[root@localhost sdb3]# /sbin/vgchange -ay /dev/VolGroup01
2 logical volume(s) in volume group "VolGroup01" now active
[root@localhost mnt]# /sbin/lvscan
ACTIVE '/dev/VolGroup01/LogVol00' [34.81 GB] inherit
ACTIVE '/dev/VolGroup01/LogVol01' [1.94 GB] inherit
ACTIVE '/dev/VolGroup00/LogVol00' [32.00 GB] inherit
ACTIVE '/dev/VolGroup00/LogVol01' [1.94 GB] inherit
好了,现在可以挂载了。
5、mount
[root@localhost mnt]# mount /dev/VolGroup01/LogVol00 /mnt/sdb3