买的系统盘为32G,结果发现只使用了8G,剩下的都未分配
lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTxvda 202:0 0 32G 0 disk └─xvda1 202:1 0 8G 0 part /fdisk -u /dev/xvdaCommand (m for help): pDisk /dev/xvda: 34.4 GB, 34359738368 bytes, 67108864 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk label type: dosDisk identifier: 0x000998ac Device Boot Start End Blocks Id System/dev/xvda1 * 2048 16777215 8387584 83 LinuxCommand (m for help): dSelected partition 1Partition 1 is deletedCommand (m for help): nPartition type: p primary (0 primary, 0 extended, 4 free) e extendedSelect (default p): pPartition number (1-4, default 1): 1First sector (2048-67108863, default 2048): Using default value 2048Last sector, +sectors or +size{K,M,G} (2048-67108863, default 67108863): Using default value 67108863Partition 1 of type Linux and of size 32 GiB is setCommand (m for help): pDisk /dev/xvda: 34.4 GB, 34359738368 bytes, 67108864 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk label type: dosDisk identifier: 0x000998ac Device Boot Start End Blocks Id System/dev/xvda1 2048 67108863 33553408 83 LinuxCommand (m for help): wThe partition table has been altered!rebootlsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTxvda 202:0 0 32G 0 disk └─xvda1 202:1 0 32G 0 part /df -hFilesystem Size Used Avail Use% Mounted on/dev/xvda1 8.0G 1.3G 6.8G 16% /ext格式调整大小resize2fs /dev/xvda1xfs格式调整大小xfs_growfs /dev/xvda1df -hFilesystem Size Used Avail Use% Mounted on/dev/xvda1 32G 1.3G 31G 4% /
到此扩容完毕