ZBLOG

virsh attach-disk

virsh attach-disk is a command used in the Virtualization environment to attach a new disk or hard drive to a virtual machine. It is part of the virsh CLI (Command Line Interface) tool, which can be used to manage and configure virtual machines using KVM (Kernel-based Virtual Machine) hypervisor.

The syntax for the command is:

virsh attach-disk –subdriver –persistent

: The name of the virtual machine to which the disk will be attached. : The source path of the disk/hard drive that will be attached. : The target location on the virtual machine where the disk/hard drive will be mounted. –subdriver: This specifies the sub-driver to be used for attaching the disk. –persistent: This option makes sure that the attached disk remains attached even after a reboot.

For example, the following command attaches a new hard drive named “mydisk.img” to a virtual machine named “myvm”:

virsh attach-disk myvm /path/to/mydisk.img vdb –subdriver=qemu –persistent

This command attaches the disk image located at /path/to/mydisk.img as /dev/vdb on the virtual machine “myvm”. The subdriver option is set to qemu and the persistent option is enabled so that the disk remains attached even after a reboot.

本站部分文章来源于网络,版权归原作者所有,如有侵权请联系站长删除。
转载请注明出处:https://sdn.0voice.com/?id=281

分享:
扫描分享到社交APP
上一篇
下一篇
发表列表
游客 游客
此处应有掌声~
评论列表

还没有评论,快来说点什么吧~

联系我们

在线咨询: 点击这里给我发消息

微信号:3007537140

上班时间: 10:30-22:30

关注我们
x

注册

已经有帐号?