KVM 安装配置和常见操作(5)

2019-08-02 00:24

Disk /dev/vda: 53.7 GB, 53687091200 bytes, 104857600 sectors Units = sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk label type: dos

Disk identifier: 0x00077acf

Device Boot Start End Blocks Id System /dev/vda1 * 2048 411647 204800 83 Linux /dev/vda2 411648 84297727 41943040 83 Linux

/dev/vda3 84297728 88492031 2097152 82 Linux swap / Solaris

/dev/vda4 88492032 104857599 8182784 5 Extended /dev/vda5 88494080 104857599 8181760 8e Linux LVM

Disk /dev/sda: 107.4 GB, 107374182400 bytes, 209715200 sectors Units = sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk label type: dos

Disk identifier: 0x96647275

Device Boot Start End Blocks Id System

/dev/sda1 2048 209715199 104856576 8e Linux LVM

Disk /dev/mapper/centosvar-var: 8376 MB, 8376025088 bytes, 16359424 sectors Units = sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes

[root@localhost ~]# pvcreate /dev/sda1

Physical volume \[root@localhost ~]# pvs

PV VG Fmt Attr PSize PFree /dev/sda1 lvm2 --- 100.00g 100.00g /dev/vda5 centosvar lvm2 a-- 7.80g 0 [root@localhost ~]# df -h

Filesystem Size Used Avail Use% Mounted on /dev/vda2 40G 1.8G 36G 5% /

devtmpfs 488M 0 488M 0% /dev

tmpfs 497M 0 497M 0% /dev/shm tmpfs 497M 6.6M 490M 2% /run

tmpfs 497M 0 497M 0% /sys/fs/cgroup /dev/vda1 190M 99M 78M 56% /boot /dev/mapper/centosvar-var 7.8G 813M 7.0G 11% /var

tmpfs 100M 0 100M 0% /run/user/0 [root@localhost ~]# vgextend centosvar /dev/sda1 Volume group \[root@localhost ~]# pvs

PV VG Fmt Attr PSize PFree /dev/sda1 centosvar lvm2 a-- 100.00g 100.00g /dev/vda5 centosvar lvm2 a-- 7.80g 0 [root@localhost ~]# vgs

VG #PV #LV #SN Attr VSize VFree centosvar 2 1 0 wz--n- 107.80g 100.00g

[root@localhost ~]# lvextend -l +100%FREE /dev/centosvar/var

Size of logical volume centosvar/var changed from 7.80 GiB (1997 extents) to 107.80 GiB (27596 extents).

Logical volume var successfully resized.

###如果是xfs格式的磁盘需要使用xfs_growfs命令扩展,否则使用resize2fs 命令扩展###### [root@localhost ~]# xfs_info /dev/centosvar/var

meta-data=/dev/mapper/centosvar-var isize=256 agcount=4, agsize=511232 blks = sectsz=512 attr=2, projid32bit=1 = crc=0 finobt=0

data = bsize=4096 blocks=2044928, imaxpct=25 = sunit=0 swidth=0 blks naming =version 2 bsize=4096 ascii-ci=0 ftype=0

log =internal bsize=4096 blocks=2560, version=2

= sectsz=512 sunit=0 blks, lazy-count=1 realtime =none extsz=4096 blocks=0, rtextents=0 [root@localhost ~]# xfs_growfs /dev/centosvar/var

meta-data=/dev/mapper/centosvar-var isize=256 agcount=4, agsize=511232 blks = sectsz=512 attr=2, projid32bit=1 = crc=0 finobt=0

data = bsize=4096 blocks=2044928, imaxpct=25 = sunit=0 swidth=0 blks naming =version 2 bsize=4096 ascii-ci=0 ftype=0

log =internal bsize=4096 blocks=2560, version=2

= sectsz=512 sunit=0 blks, lazy-count=1 realtime =none extsz=4096 blocks=0, rtextents=0 data blocks changed from 2044928 to 28258304

[root@localhost ~]# df -h

Filesystem Size Used Avail Use% Mounted on /dev/vda2 40G 1.8G 36G 5% /

devtmpfs 488M 0 488M 0% /dev

tmpfs 497M 0 497M 0% /dev/shm tmpfs 497M 6.6M 490M 2% /run

tmpfs 497M 0 497M 0% /sys/fs/cgroup /dev/vda1 190M 99M 78M 56% /boot /dev/mapper/centosvar-var 108G 815M 107G 1% /var

tmpfs 100M 0 100M 0% /run/user/0 [root@localhost ~]#

KVM 中Windows虚拟机磁盘网卡优化virtio驱动

1:默认情况下安装好Windows虚拟机,采用普通的驱动,即硬盘和网卡都采用默认配置情况下,硬盘是 ide 模式,而网卡工作在模拟的rtl 8139 网卡下,速度为100M 全双工。采用 virtio 驱动后,网卡工作在 1000M 的模式下,硬盘工作是SCSI模式下。显然我想修改为virtio驱动!

2:开始我试着修改配置文件(配置文件见附件)!然后重启虚拟机,结果蓝屏!

我试着device='disk' 部分的bus=‘ide’修改为virtio,并删除了,然后重启,结果蓝屏! 见附件

显然这样不行!

3:下载virtio.iso文件,我使用的

是 http://alt.fedoraproject.org/pub/alt/virtio-win/latest/images/bin/virtio-win-0.1-30.iso 这个iso文件支持几乎所有的windows系统。挂载后iso文件见附件!

4:在配置中,添加virtio硬盘、virtio网卡,加载virtio-win.iso(cdrom)。启动vm 见附件:

尤其要注意Device type要选中Virtio Disk


KVM 安装配置和常见操作(5).doc 将本文的Word文档下载到电脑 下载失败或者文档不完整,请联系客服人员解决!

下一篇:广州智慧交通总体规划设计服务项目需求方案

相关阅读
本类排行
× 注册会员免费下载(下载后可以自由复制和排版)

马上注册会员

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: