Ubuntu根盘扩容

参考 https://blog.csdn.net/weixin_51480590/article/details/127767660

虚拟机关机之后,点击设置,根据电脑情况扩展磁盘增加容量。

fdisk -l

Disk /dev/sda: 40 GiB, 42949672960 bytes, 83886080 sectors
Disk model: VMware Virtual S
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x7635aeb6

Device     Boot   Start      End  Sectors  Size Id Type
/dev/sda1  *       2048  1050623  1048576  512M  b W95 FAT32
/dev/sda2       1052670 83884031 82831362 39.5G  5 Extended
/dev/sda5       1052672 83884031 82831360 39.5G 83 Linux

分配磁盘空间,将未使用的磁盘分区/dev/sda划分给/dev/sda5文件系统

parted /dev/sda

1)输入p查看磁盘总空间大小以及使用情况。

2)根据编号进行扩容,这里的系统盘的编号是53)输入resizepart 5,重新分配ext4空间。这里会有一个警告,但是没关系,我们继续。

4)设置ext4的结束点,这里根据虚拟机刚才升级的最大容量设置,比如80GB。

5)输入q退出即可。

应用,上一步中,我们已经把磁盘分配好了。接下来就是应用了。

resize2fs /dev/sda5

验证,我们再次输入df -h查看分区。

df -h
posted @   朝阳1  阅读(10)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 分享4款.NET开源、免费、实用的商城系统
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· 上周热点回顾(2.24-3.2)
点击右上角即可分享
微信分享提示