1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
| 更新物理卷的大小,当然这里前提是使用了LVM
输入命令: pvresize /dev/sda2 接下来更新逻辑卷的大小 输入命令:[root@localhost ~]# lvresize --extents +100%FREE --resizefs /dev/mapper/centos-root Size of logical volume centos/root changed from <102.00 GiB (26111 extents) to <202.00 GiB (51711 extents). Logical volume centos/root successfully resized. meta-data=/dev/mapper/centos-root isize=512 agcount=15, agsize=1900032 blks = sectsz=512 attr=2, projid32bit=1 = crc=1 finobt=0 spinodes=0 data = bsize=4096 blocks=26737664, imaxpct=25 = sunit=0 swidth=0 blks naming =version 2 bsize=4096 ascii-ci=0 ftype=1 log =internal bsize=4096 blocks=3711, version=2 = sectsz=512 sunit=0 blks, lazy-count=1 realtime =none extsz=4096 blocks=0, rtextents=0 data blocks changed from 26737664 to 52952064
最后可以看到已经成功了 输入命令:[root@localhost ~]# fdisk -l 磁盘 /dev/sda:220.1 GB, 220117073920 字节,429916160 个扇区 Units = 扇区 of 1 * 512 = 512 bytes 扇区大小(逻辑/物理):512 字节 / 512 字节 I/O 大小(最小/最佳):512 字节 / 512 字节 磁盘标签类型:dos 磁盘标识符:0x000c264f
设备 Boot Start End Blocks Id System /dev/sda1 * 2048 2099199 1048576 83 Linux /dev/sda2 2099200 429916159 213908480 8e Linux LVM
磁盘 /dev/mapper/centos-root:216.9 GB, 216891654144 字节,423616512 个扇区 Units = 扇区 of 1 * 512 = 512 bytes 扇区大小(逻辑/物理):512 字节 / 512 字节 I/O 大小(最小/最佳):512 字节 / 512 字节
磁盘 /dev/mapper/centos-swap:2147 MB, 2147483648 字节,4194304 个扇区 Units = 扇区 of 1 * 512 = 512 bytes 扇区大小(逻辑/物理):512 字节 / 512 字节 I/O 大小(最小/最佳):512 字节 / 512 字节
输入命令:[root@localhost ~]# df -h 文件系统 容量 已用 可用 已用% 挂载点 devtmpfs 908M 0 908M 0% /dev tmpfs 919M 0 919M 0% /dev/shm tmpfs 919M 8.6M 911M 1% /run tmpfs 919M 0 919M 0% /sys/fs/cgroup /dev/mapper/centos-root 202G 93G 110G 46% / /dev/sda1 1014M 282M 733M 28% /boot tmpfs 184M 0 184M 0% /run/user/0
|