Linux下挂载LVM碰到卷组同名的办理办法[Linux安全]
本文“Linux下挂载LVM碰到卷组同名的办理办法[Linux安全]”是由七道奇为您精心收集,来源于网络转载,文章版权归文章作者所有,本站不对其观点以及内容做任何评价,请读者自行判断,以下是其具体内容:
blog:blog.vfocus.net
周末朋友的服务器硬盘出问题了,让IDC的人挂了个IDE硬盘把系统安装好,然后再挂上从前的SATA硬盘,想把数据倒腾出来,后果哥们发现他搞不定,给我打电话告急.我远程上去看了下,发现2块盘系统做的都是LVM分区格局8e,不是ext3的83,难怪他不会挂载,并且还有个问题就是卷组都是默许安装的同一个名字VolGroup00. [root@locallhost ~]# pvs hda2是新系统盘74G多,sda2是老数据盘232G多.卷组名称一样,因为2个系统安装的时刻都是默许安装的. [root@locallhost ~]# vgs 我们先用vgrename改卷组名: [root@locallhost ~]# vgrename VolGroup00 aaalvm 直接报有同名,需求用uuid.查uuid可以用vgdisplay或vgs -v: [root@locallhost ~]# vgdisplay --- Volume group --- [root@locallhost ~]# vgs -v 查到数据盘的uuid是bAydq6-rv9e-wCa0-iK2f-zFWn-UBUr-4AR3Ct,改卷组名的时刻用uuid,以下: [root@locallhost ~]# vgrename bAydq6-rv9e-wCa0-iK2f-zFWn-UBUr-4AR3Ct aaalvm ok了,改完再vgs看下: [root@locallhost ~]# vgs 没问题了,再lvscan下: [root@locallhost ~]# lvscan 已经看到新改名的卷组是inactive了,2个分区LogVol00和LogVol01,用vgchange加载我们该名过的aaalvm卷组: [root@locallhost ~]# vgchange -ay /dev/aaalvm 提醒active状况成功,最后mount文件系统: [root@locallhost ~]# ls /dev/aaalvm/ LogVol01是swap分区,不用挂载.把/bin/mount /dev/aaalvm/LogVol00 /aaaa/写入rc.local里面,让每次开机自动挂载,也可以写到fstab里面,但是假如写错出问题大概招致进不了系统,所以倡议写rc.local.
PV VG Fmt Attr PSize PFree
/dev/hda2 VolGroup00 lvm2 a- 74.41G 0
/dev/sda2 VolGroup00 lvm2 a- 232.78G 0
VG #PV #LV #SN Attr VSize VFree
VolGroup00 1 2 0 wz--n- 232.78G 0
VolGroup00 1 2 0 wz--n- 74.41G 0
Found more than one VG called VolGroup00. Please supply VG uuid.
--- Volume group ---
VG Name VolGroup00
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 3
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 2
Open LV 2
Max PV 0
Cur PV 1
Act PV 1
VG Size 232.78 GB
PE Size 32.00 MB
Total PE 7449
Alloc PE / Size 7449 / 232.78 GB
Free PE / Size 0 / 0
VG UUID bAydq6-rv9e-wCa0-iK2f-zFWn-UBUr-4AR3Ct
VG Name VolGroup00
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 3
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 2
Open LV 2
Max PV 0
Cur PV 1
Act PV 1
VG Size 74.41 GB
PE Size 32.00 MB
Total PE 2381
Alloc PE / Size 2381 / 74.41 GB
Free PE / Size 0 / 0
VG UUID YHLmkq-b1xS-UzAS-Y3nv-6vaX-2Xou-GScvk0
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
Volume group "VolGroup00" successfully renamed to "aaalvm"
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
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
2 logical volume(s) in volume group "aaalvm" now active
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
本篇文章根源于 Vitter's Blog
以上是“Linux下挂载LVM碰到卷组同名的办理办法[Linux安全]”的内容,如果你对以上该文章内容感兴趣,你可以看看七道奇为您推荐以下文章:
本文地址: | 与您的QQ/BBS好友分享! |