亲测好用
一、问题与目的
原因是磁盘空间已满,正好有时间,研究一下怎么对Centos进行扩容
二、解决方法
1、首先,通过命令df -h 观察磁盘占用情况
可以发现根目录已经被写满了,这会导致所有写操作都无法进行
2、先关闭虚拟机,然后在VMware的设置中选择添加一块新的硬盘(一直点下一步就可以了)
我选择了扩容40G
3、重启虚拟机后通过命令lsblk可以发现多了一个分区sdb(原来只有sda)
所以接下来对sdb进行分区操作
4、对sdb进行分区操作
1.[root@itcast ~]# fdisk /dev/sdb
2.Welcome to fdisk (util-linux 2.23.2).
3.
4.Changes will remain in memory only, until you decide to write them.
5.Be careful before using the write command.
6.
7.Device does not contain a recognized partition table
8.Building a new DOS disklabel with disk identifier 0xdeeb604b.
9.
10.Command (m for help): m #这个是帮助 可忽略
11.Command action
12. a toggle a bootable flag
13. b edit bsd disklabel
14. c toggle t