使用virsh为linux kvm虚拟机添加disk

1.用dd的方式生成虚拟磁盘
[root@node13 vm]# dd if=/dev/zero of=/home/vm/node53.img bs=1024k count=102400

2.将虚拟磁盘热添加到虚拟机

[root@node13 vm]# virsh attach-disk node53 /home/vm/node53.img vdc  --subdriver=raw
Disk attached successfully

3.在虚拟机中查看新添加的磁盘

[root@node53 ~]#fdisk -l

 

Disk /dev/vda: 10.7GB, 10737418240 bytes

16 heads, 63sectors/track, 20805 cylinders

Units = cylinders of1008 * 512 = 516096 bytes

Sector size(logical/physical): 512 bytes / 512 bytes

I/O size(minimum/optimal): 512 bytes / 512 bytes

Disk identifier:0x0001ce1f

 

   Device Boot      Start         End      Blocks  Id  System

/dev/vda1   *          3       16256     8192000  83  Linux

Partition 1 does notend on cylinder boundary.

/dev/vda2           16257       20320    2048000   82  Linux swap / Solaris

Partition 2 does notend on cylinder boundary.

 

Disk /dev/vdb: 26.8GB, 26843545600 bytes

16 heads, 63sectors/track, 52012 cylinders

Units = cylinders of1008 * 512 = 516096 bytes

Sector size(logical/physical): 512 bytes / 512 bytes

I/O size(minimum/optimal): 512 bytes / 512 bytes

Disk identifier:0xf7a9f37a

   Device Boot      Start         End      Blocks  Id  System

/dev/vdb1               1       52012   26214016+  83  Linux

Disk /dev/vdc: 107.4GB, 107374182400 bytes

16 heads, 63sectors/track, 208050 cylinders

Units = cylinders of1008 * 512 = 516096 bytes

Sector size(logical/physical): 512 bytes / 512 bytes

I/O size(minimum/optimal): 512 bytes / 512 bytes

Disk identifier:0x00000000

Disk /dev/vdcdoesn't contain a valid partition table


 

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值