Xenserver内的虚拟机有一台被黑掉了,然后修复后重启了下,然后就磁盘只读了,各种修复无果!
最后的思路新装一台同样的虚拟机,是把磁盘挂载到这个虚拟机下,取出数据,然后重新部署恢复!
然后在控制台查看磁盘挂载情况 fdisk -l
虽然显示了挂载的磁盘,但是因为之前的磁盘是通过lvm挂载的,显然不可以直接挂载/dev/xvdb.
后来通过lvdisplay 发现都在NOT available状态
[root@localhost opt]# lvdisplay
--- Logical volume ---
LV Path /dev/VolGroup/lv_root
LV Name lv_root
VG Name VolGroup
LV UUID rd662f-FPWf-eps4-iNiZ-dLQf-ZHDD-yK1QoT
LV Write Access read/write
LV Creation host, time localhost.localdomain, 2013-12-09 10:38:45 +0800
LV Status NOT available
LV Size 50.00 GiB
Current LE 12800
Segments 1
Allocation inherit
Read ahead sectors auto
--- Logical volume ---
LV Path /dev/VolGroup/lv_home
LV Name lv_home
VG Name VolGroup
LV UUID ZkVwiB-pCwz-d2eo-jgGq-4FiD-FpOV-pAOkW8
LV Write Access read/write
LV Creation host, time localhost.localdomain, 2013-12-09 10:39:11 +0800
LV Status NOT available
LV Size 21.71 GiB
Current LE 5558
Segments 1
Allocation inherit
Read ahead sectors auto
--- Logical volume ---
LV Path /dev/VolGroup/lv_swap
LV Name lv_swap
VG Name VolGroup
LV UUID k3MdfG-l6sJ-iYq2-RdMm-kpI3-Sxh3-0TZ5t8
LV Write Access read/write
LV Creation host, time localhost.localdomain, 2013-12-09 10:39:23 +0800
LV Status NOT available
LV Size 7.80 GiB
Current LE 1996
Segments 1
Allocation inherit
Read ahead sectors auto
[root@localhost opt]# vgdisplay 查看vg状态
vgscan //扫描所有磁盘得到卷组信息
[root@localhost opt]# vgchange -ay #vgchange -ay //激活系统所有卷组vg
[root@localhost opt]# lvdisplay
--- Logical volume ---
LV Path /dev/VolGroup/lv_root
LV Name lv_root
VG Name VolGroup
LV UUID rd662f-FPWf-eps4-iNiZ-dLQf-ZHDD-yK1QoT
LV Write Access read/write
LV Creation host, time localhost.localdomain, 2013-12-09 10:38:45 +0800
LV Status available
# open 0
LV Size 50.00 GiB
Current LE 12800
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:0
然后再次查看fdisk -l 已经显示出老服务器的卷组信息了
最后就可以愉快的挂载和传输数据了!
mount /dev/mapper/VolGroup-lv_root /bak
操作虽然简单,但花了很久时间琢磨,尤其是无法显示老服务器卷组信息,因而无法挂载的问题!特此记录!
转载请注明:梦绘设计 » xenserver技术 » xenserver虚拟机挂掉-紧急数据恢复
版权声明
本站《作品展示》类文章均为原创,转载必须注明出处,技术分享类文章部分来源于网络,版权归原作者所有,若侵权请留言。