Хотите продлить /dev/sda2
до 100G? как это:
[root@jason ~]# df -Th Filesystem Type Size Used Avail Use% Mounted on /dev/sda2 xfs 100G 1.2G 99G 2% / devtmpfs devtmpfs 828M 0 828M 0% /dev tmpfs tmpfs 839M 0 839M 0% /dev/shm tmpfs tmpfs 839M 8.3M 830M 1% /run tmpfs tmpfs 839M 0 839M 0% /sys/fs/cgroup /dev/sda1 xfs 497M 62M 436M 13% /boot /dev/sdb1 ext4 69G 53M 66G 1% /mnt/resource tmpfs tmpfs 168M 0 168M 0% /run/user/1000
Если да, мы можем использовать оболочку /dev/sda2
до 100G. (сентос 7.3)
[root@jason ~]# 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): u Changing display/entry units to cylinders (DEPRECATED!). Command (m for help): p Disk /dev/sda: 107.4 GB, 107374182400 bytes, 209715200 sectors Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk label type: dos Disk identifier: 0x000bd020 Device Boot Start End Blocks Id System /dev/sda1 * 1 64 512000 83 Linux /dev/sda2 64 3917 30944256 83 Linux Command (m for help): d Partition number (1,2, default 2): 2 Partition 2 is deleted Command (m for help): n Partition type: p primary (1 primary, 0 extended, 3 free) e extended Select (default p): p Partition number (2-4, default 2): 2 First cylinder (64-13054, default 64): Using default value 64 Last cylinder, +cylinders or +size (64-13054, default 13054): Using default value 13054 Partition 2 of type Linux and of size 99.5 GiB is set Command (m for help): a Partition number (1,2, default 2): 2 Command (m for help): p Disk /dev/sda: 107.4 GB, 107374182400 bytes, 209715200 sectors Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk label type: dos Disk identifier: 0x000bd020 Device Boot Start End Blocks Id System /dev/sda1 * 1 64 512000 83 Linux /dev/sda2 * 64 13054 104343231 83 Linux Command (m for help): w The partition table has been altered! Calling ioctl() to re-read partition table. WARNING: Re-reading the partition table failed with error 16: Device or resource busy. The kernel still uses the old table. The new table will be used at the next reboot or after you run partprobe(8) or kpartx(8) Syncing disks. [root@jason ~]# reboot
После перезагрузки мы должны использовать эту команду, чтобы расширить ее xfs_growfs -d /dev/sda2
( centos 7 ), centos 6, которую мы должны использоватьsudo resize2fs /dev/sda2
[root@jason ~]# xfs_growfs -d /dev/sda2 meta-data=/dev/sda2 isize=512 agcount=4, agsize=1934016 blks = sectsz=512 attr=2, projid32bit=1 = crc=1 finobt=0 spinodes=0 data = bsize=4096 blocks=7736064, imaxpct=25 = sunit=0 swidth=0 blks naming =version 2 bsize=4096 ascii-ci=0 ftype=1 log =internal bsize=4096 blocks=3777, version=2 = sectsz=512 sunit=0 blks, lazy-count=1 realtime =none extsz=4096 blocks=0, rtextents=0 data blocks changed from 7736064 to 26085807 [root@jason ~]# df -Th Filesystem Type Size Used Avail Use% Mounted on /dev/sda2 xfs 100G 1.2G 99G 2% /
Более подробную информацию о расширении ОС диска смотрите по этой ссылке .