Linux下挂载LVM遇到卷组同名的解决方法(2)

[root@locallhost ~]# vgs -v
    Finding all volume groups
    Finding volume group "VolGroup00"
    Archiving volume group "VolGroup00" metadata (seqno 3).
    Archiving volume group "VolGroup00" metadata (seqno 3).
    Creating volume group backup "/etc/lvm/backup/VolGroup00" (seqno 3).
    Finding volume group "VolGroup00"
    Archiving volume group "VolGroup00" metadata (seqno 3).
    Archiving volume group "VolGroup00" metadata (seqno 3).
    Creating volume group backup "/etc/lvm/backup/VolGroup00" (seqno 3).
  VG         Attr   Ext    #PV #LV #SN VSize   VFree VG UUID
  VolGroup00 wz--n- 32.00M   1   2   0 232.78G    0  bAydq6-rv9e-wCa0-iK2f-zFWn-UBUr-4AR3Ct
  VolGroup00 wz--n- 32.00M   1   2   0  74.41G    0  YHLmkq-b1xS-UzAS-Y3nv-6vaX-2Xou-GScvk0

查到数据盘的uuid是bAydq6-rv9e-wCa0-iK2f-zFWn-UBUr-4AR3Ct,改卷组名的时候用uuid,如下:

[root@locallhost ~]# vgrename bAydq6-rv9e-wCa0-iK2f-zFWn-UBUr-4AR3Ct aaalvm
  Volume group "VolGroup00" successfully renamed to "aaalvm"

ok了,改完再vgs看下:

[root@locallhost ~]# vgs
  VG         #PV #LV #SN Attr   VSize   VFree
  VolGroup00   1   2   0 wz--n-  74.41G    0
  aaalvm       1   2   0 wz--n- 232.78G    0

没问题了,再lvscan下:

[root@locallhost ~]# lvscan
  inactive          '/dev/aaalvm/LogVol00' [228.84 GB] inherit
  inactive          '/dev/aaalvm/LogVol01' [3.94 GB] inherit
  ACTIVE            '/dev/VolGroup00/LogVol00' [70.47 GB] inherit
  ACTIVE            '/dev/VolGroup00/LogVol01' [3.94 GB] inherit

已经看到新改名的卷组是inactive了,2个分区LogVol00和LogVol01,用vgchange加载我们该名过的aaalvm卷组:

[root@locallhost ~]# vgchange -ay /dev/aaalvm
  2 logical volume(s) in volume group "aaalvm" now active

提示active状态成功,最后mount文件系统:

[root@locallhost ~]# ls /dev/aaalvm/
LogVol00  LogVol01
[root@locallhost ~]# mount /dev/aaalvm/LogVol00 /aaaa/
[root@locallhost ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
                       69G  2.7G   63G   5% /
/dev/hda1              99M   12M   82M  13% /boot
tmpfs                1010M     0 1010M   0% /dev/shm
/dev/mapper/aaalvm-LogVol00
                      222G  111G  100G  53% /aaaa
[root@locallhost ~]# mount /dev/aaalvm/LogVol01 /bbb/
/dev/aaalvm/LogVol01 looks like swapspace - not mounted
mount: you must specify the filesystem type

LogVol01是swap分区,不用挂载。把/bin/mount /dev/aaalvm/LogVol00 /aaaa/写入rc.local里面,让每次开机自动挂载,也可以写到fstab里面,但是如果写错出问题可能导致进不了系统,所以建议写rc.local。

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/23591.html