简介
CentOS7虚拟机原硬盘空间只分配了10GB,需要扩容到20GB。
环境:VMware 10
VMware分配空间
选中虚拟机->虚拟机设置->硬盘->实用工具->扩展->设置最大磁盘大小->点击扩展
CentOS7内部分配
可以参考:http://jingyan.baidu.com/article/54b6b9c0fc8b0b2d583b47c6.html
- 查看当前磁盘空间,/dev/mapper/cl-root硬盘空间只有8GB,打算扩容:
# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/cl-root 8.0G 3.8G 4.3G 47% /
devtmpfs 482M 0 482M 0% /dev
tmpfs 493M 0 493M 0% /dev/shm
tmpfs 493M 6.7M 486M 2% /run
tmpfs 493M 0 493M 0% /sys/fs/cgroup
/dev/sda1 1014M 184M 831M 19% /boot
tmpfs 99M 0 99M 0% /run/user/0
- 对新增的硬盘空间做新增分区(硬盘数没有增加,增加的是空间)
# 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
Partition type:
p prima