1、Centos 关机,选择编辑虚拟机设置,硬盘,在实用工具那里选择“扩展”


点击扩展后,VMware会提示磁盘已成功扩展。您必须从客户机操作系统内部对磁盘重新进行分区和扩展文件系统。也就是说,这里扩展的磁盘空间,在操作系统里面还不可用,还没生效,需要在操作系统里面进行设置后才能使用。

2、启动客户机操作系统Centos,查看磁盘情况
输入指令
[root@dw ~]# fdisk -l
Disk /dev/sda: 107.4 GB, 107374182400 bytes, 209715200 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
Disk label type: dos
Disk identifier: 0x000b0b8a
Device Boot Start End Blocks Id System
/dev/sda1 * 2048 2099199 1048576 83 Linux
/dev/sda2 2099200 83886079 40893440 8e Linux LVM
Disk /dev/mapper/centos-root: 37.7 GB, 37706792960 bytes, 73646080 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
Disk /dev/mapper/centos-swap: 4160 MB, 4160749568 bytes, 8126464 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
其中,可以看到现在的分区情况如下
Device Boot Start End Blocks Id System
/dev/sda1 * 2048 2099199 1048576 83 Linux
/dev/sda2 2099200 83886079 40893440 8e Linux LVM
3、创建分区 sda3
输入指令
[root@dw ~]# fdisk /dev/sda
然后根据命令提示创建分区,具体见以下 # 后面的注释
Welcome to fdisk (util-linux 2.23.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Command (m for help): n # 输入 n 表示创建新分区
Partition type:
p p

最低0.47元/天 解锁文章
1083

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



