Quantcast
Channel: 钻戒 and 仁豆米
Viewing all articles
Browse latest Browse all 290

kvm虚机的修复一例

$
0
0

同事扩容kvm的硬盘,结果写坏了kvm虚机上的/etc/fstab,虚机重启爬不起来了,需要修复。

到网上拷贝一个systemrescuecd-x86-4.7.3.iso的系统恢复盘,拷过去

然后编辑虚机:

virsh edit vis-16-45-23  

给虚机增加一个iso虚拟光驱

    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/export/kvm/systemrescuecd-x86-4.7.3.iso'/>
      <target dev='hdc' bus='ide'/>
      <readonly/>
      <address type='drive' controller='0' bus='1' target='0' unit='0'/>
    </disk>

然后启动顺序增加cdrom为第一位:

    <boot dev='cdrom'/>
    <boot dev='hd'/>

重启进入systemrescuecd,mount出硬盘,修改fstab,重启恢复!!!


Viewing all articles
Browse latest Browse all 290

Trending Articles