unexpected output in sfdisk --version [sfdisk,来自 util-linux 2.23.2]后端盘问题
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了unexpected output in sfdisk --version [sfdisk,来自 util-linux 2.23.2]后端盘问题,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含3770字,纯文字阅读大概需要6分钟。
内容图文
虚拟机两个组成部分,镜像文件和xml 配置声明文件
1.根据后端盘做一个镜像文件
[root@xq images]# qemu-img create -f qcow2 -b xq.qcow2 xq.img 20G
2.cp一个虚拟机配置声明文件
[root@xq~]# cp node.xml /etc/libvirt/qemu/xq.xml
1 <!-- 2 WARNING: THIS IS AN AUTO-GENERATED FILE. CHANGES TO IT ARE LIKELY TO BE 3 OVERWRITTEN AND LOST. Changes to this xml configuration should be made using: 4 virsh edit xq 5 or other application using the libvirt API. 6 --> 7 8 < domain type =‘kvm‘ > 9 < name >xq</name>10<uuid>1b559fbd-ecf1-41cf-8426-0a39af30a640</uuid>11<memory unit=‘KiB‘>1488282</memory>12<currentMemory unit=‘KiB‘>1488282</currentMemory>13<vcpu placement=‘static‘>2</vcpu>14<os>15<type arch=‘x86_64‘ machine=‘pc-i440fx-rhel7.0.0‘>hvm</type>16<boot dev=‘hd‘/>17<bootmenu enable=‘yes‘/>18<bios useserial=‘yes‘/>19</os>20<features>21<acpi/>22<apic/>23</features>24<cpu mode=‘host-passthrough‘ check=‘none‘/>25<clock offset=‘localtime‘/>26<on_poweroff>destroy</on_poweroff>27<on_reboot>restart</on_reboot>28<on_crash>restart</on_crash>29<devices>30<emulator>/usr/libexec/qemu-kvm</emulator>31<disk type=‘file‘ device=‘disk‘>32<driver name=‘qemu‘ type=‘qcow2‘/>33<source file=‘/var/lib/libvirt/images/xq.img‘/>34<target dev=‘vda‘ bus=‘virtio‘/>35<address type=‘pci‘ domain=‘0x0000‘ bus=‘0x00‘ slot=‘0x05‘ function=‘0x0‘/>36</disk>37<controller type=‘usb‘ index=‘0‘ model=‘piix3-uhci‘>38<address type=‘pci‘ domain=‘0x0000‘ bus=‘0x00‘ slot=‘0x01‘ function=‘0x2‘/>39</controller>40<controller type=‘pci‘ index=‘0‘ model=‘pci-root‘/>41<controller type=‘virtio-serial‘ index=‘0‘>42<address type=‘pci‘ domain=‘0x0000‘ bus=‘0x00‘ slot=‘0x04‘ function=‘0x0‘/>43</controller>44<interface type=‘bridge‘>45<mac address=‘52:54:00:a5:57:bb‘/>46<source bridge=‘vbr‘/>47<model type=‘virtio‘/>48<address type=‘pci‘ domain=‘0x0000‘ bus=‘0x00‘ slot=‘0x03‘ function=‘0x0‘/>49</interface>50<serial type=‘pty‘>51<target port=‘0‘/>52</serial>53<console type=‘pty‘>54<target type=‘serial‘ port=‘0‘/>55</console>56<channel type=‘unix‘>57<target type=‘virtio‘ name=‘org.qemu.guest_agent.0‘/>58<address type=‘virtio-serial‘ controller=‘0‘ bus=‘0‘ port=‘1‘/>59</channel>60<input type=‘mouse‘ bus=‘ps2‘/>61<input type=‘keyboard‘ bus=‘ps2‘/>62<memballoon model=‘virtio‘>63<address type=‘pci‘ domain=‘0x0000‘ bus=‘0x00‘ slot=‘0x06‘ function=‘0x0‘/>64</memballoon>65</devices>66</domain>
[root@xq~]# virsh define /etc/libvirt/qemu/xq.xml
[root@xq~]#virsh start xq
[root@xq~]#ssh 192.168.1.154
[root@localhost ~]# df -h
文件系统 容量 已用 可用 已用% 挂载点
/dev/vda1 2.0G 1.1G 995M 52% /
devtmpfs 698M 0 698M 0% /dev
tmpfs 708M 0 708M 0% /dev/shm
tmpfs 708M 17M 691M 3% /run
tmpfs 708M 0 708M 0% /sys/fs/cgroup
tmpfs 142M 0 142M 0% /run/user/0
[root@localhost ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
vda 253:0 0 20G 0 disk
└─vda1 253:1 0 2G 0 part /
[root@localhost ~]# growpart /dev/vda 1
unexpected output in sfdisk --version [sfdisk,来自 util-linux 2.23.2]
解决办法:定义全局变量,语言改为英文 (编码)
export LANG=en_US.UTF-8export LANG=en_US.UTF-8
语言可以用 echo $LANG查看(locale查语言类型)
en_US.UTF-8
[root@localhost ~]# growpart /dev/vda 1
CHANGED: partition=1 start=2048 old: size=4192256 end=4194304 new: size=41940959,end=41943007
[root@localhost~]# xfs_growfs /
最后使用lsblk和df -h 查看磁盘情况
扩容问题就ok了
扩容问题也是弹性云主机的奥秘所在(通过已有资源,自己分配磁盘大小)
改完编码还不可以试试重启机子
原文:https://www.cnblogs.com/lsgo/p/10387609.html
内容总结
以上是互联网集市为您收集整理的unexpected output in sfdisk --version [sfdisk,来自 util-linux 2.23.2]后端盘问题全部内容,希望文章能够帮你解决unexpected output in sfdisk --version [sfdisk,来自 util-linux 2.23.2]后端盘问题所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。