kvm扩容根分区
https://blog.csdn.net/weixin_43601042/article/details/121215004
https://blog.csdn.net/fangfu123/article/details/117927656
qemu-img resize 1804-llvm-wangchengquan-ip-107.qcow2 +500G
cat > /etc/apt/sources.list << \EOF
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
EOF
apt update
sudo apt install cloud-guest-utils xfsprogs -y
growpart /dev/vda 1
这里的1就是指的,对/dev/vdb这个磁盘的第一个分区进行growpart操作。
xfs_growfs /dev/vda1 (xfs格式)
resize2fs /dev/vda1 (ext4格式)
resize2fs /dev/sda1
debian10出现的情况:
You need to remove/move /dev/sdb2 and /dev/sdb5.
Use sudo cfdisk /dev/sdb to select partitions and delete/modify them.
Extend a partition in a partition table to fill available space: sudo growpart /dev/sdb 1.
Enlarge the mounted file system: sudo resize2fs /dev/sdb 1.
########
文档更新时间: 2023-03-30 11:45 作者:admin