fdisk 扩展硬盘
扩展/dev/vdb1
[root@VM_191_163_centos /]# df -h
新建些文件
[root@VM_191_163_centos opt]# echo 0000000 > test.txt
[root@VM_191_163_centos opt]# mkdir 11 22 33 44
[root@VM_191_163_centos opt]# echo 11111 > 11/11.txt
[root@VM_191_163_centos opt]# vim 11/11.txt
需要记住磁盘柱一致 /dev/vdb1 是这个 1
fdisk /dev/vdb
Disk /dev/vdb: 107.4 GB, 107374182400 bytes
16 heads, 63 sectors/track, 208050 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Device Boot Start End Blocks Id System
/dev/vdb1 1 100000 50399968+ 83 Linux
/dev/vdb2 100001 208050 54457200 83 Linux
删除 d 两个都删除分区比较少
n新建分区
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1 之前是几分区 我的就是1
First cylinder (1-208050, default 1): 磁主好我的是第一个分区就写1
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-208050, default 208050): 这需要扩展全部默认就好了
Using default value 208050
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
保存退出
调整分区
e2fsck -f /dev/vdb1 #检查分区信息
resize2fs /dev/vdb1 #调整分区大小
重新挂载分区
mount /dev/vdb1 /opt
文件都在