当前位置: 首页> 教育> 就业 > PVE 系统下虚拟机数据盘从IDE转换为VIRIO

PVE 系统下虚拟机数据盘从IDE转换为VIRIO

时间:2025/7/11 18:19:29来源:https://blog.csdn.net/xfp1007907124/article/details/141214536 浏览次数:0次

一、卸载已经挂载的 IDE 数据盘

[root@localhost ~]# df -h
文件系统 容量 已用 可用 已用% 挂载点
/dev/mapper/centos-root 29G 897M 29G 4% /
devtmpfs 909M 0 909M 0% /dev
tmpfs 920M 0 920M 0% /dev/shm
tmpfs 920M 8.5M 912M 1% /run
tmpfs 920M 0 920M 0% /sys/fs/cgroup
/dev/sda1 1014M 143M 872M 15% /boot
tmpfs 184M 0 184M 0% /run/user/0
/dev/sdb1 32G 49M 30G 1% /data

[root@localhost /]# cd /data
[root@localhost data]# touch xiaoyf.txt
[root@localhost data]# vi xiaoyf.txt

[root@localhost data]# cat xiaoyf.txt
2023.4.17 test2023.4.17 test2023.4.17 test2023.4.17 test2023.4.17 test2023.4.17 test2023.4.17 test2023.4.17 test2023.4.17 test2023.4.17 test2023.4.17 test2023.4.17 test2023.4.17 test2023.4.17 test2023.4.17 test2023.4.17 test2023.4.17 test2023.4.17 test2023.4.17 test2023.4.17 test

[root@localhost ~]# umount /dev/sdb1 /data
umount: /data:未挂载

二、登录 PVE 选择需要转换的虚拟机

1.1 、选择虚拟机数据盘并 Detach
![在这里插入图片描述](https://i-blog.csdnimg.cn/direct/86ebd4b340854e3583813353f39a5df5.png
1.2 选择卸载的磁盘
在这里插入图片描述
1.3 修改为 VirIO Block
在这里插入图片描述
1.4 add 这块磁盘
在这里插入图片描述

三、检验

原来的数据盘变为vda, 分区自动变为vda1 (IDE的时候是sdb , 分区是 sdb1)
[root@localhost ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 32G 0 disk
├─sda1 8:1 0 1G 0 part /boot
└─sda2 8:2 0 31G 0 part
├─centos-root 253:0 0 29G 0 lvm /
└─centos-swap 253:1 0 2G 0 lvm [SWAP]
sr0 11:0 1 792M 0 rom
vda 252:0 0 32G 0 disk
└─vda1 252:1 0 32G 0 part

把这个分区还是mount 在/data目录, 数据没有丢失
[root@localhost ~]# mount /dev/vda1 /data
[root@localhost data]# cat xiaoyf.txt
2023.4.17 test2023.4.17 test2023.4.17 test2023.4.17 test2023.4.17 test2023.4.17 test2023.4.17 test2023.4.17 test2023.4.17 test2023.4.17 test2023.4.17 test2023.4.17 test2023.4.17 test2023.4.17 test2023.4.17 test2023.4.17 test2023.4.17 test2023.4.17 test2023.4.17 test2023.4.17 test

转换成功

关键字:PVE 系统下虚拟机数据盘从IDE转换为VIRIO

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

责任编辑: