查看当前磁盘情况
可以看到只有一个500g的磁盘,但是实际分配了2T的硬盘
root@cdh4:/etc/apt# df -h
Filesystem Size Used Avail Use% Mounted on
...
/dev/sda1 477G 7.3G 445G 2% /
...
查看物理磁盘情况
可以看到实际磁盘有2T,主分区只用了500G
root@cdh4:~# fdisk -l
...
Disk /dev/sda: 2 TiB, 2199023255552 bytes, 4294967296 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
Disklabel type: dos
Disk identifier: 0xf1b5c655
Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 1015021567 1015019520 484G 83 Linux
/dev/sda2 1015023614 1048573951 33550338

本文详细介绍了如何在Ubuntu18系统中扩展主分区的步骤,包括查看磁盘情况、删除分区、重新分区及使用resize2fs命令更新文件系统。遵循这些步骤,用户可以成功将主分区从500GB扩展到2TB。
最低0.47元/天 解锁文章
3万+

被折叠的 条评论
为什么被折叠?



