작성일자 : 2020년 03월 19일
기술제목 : /dev/vda ( root os disk 증설 )
shutdown 후 가상 디스크 Extend +10G
[root@test ~]# df -Ph
Filesystem Size Used Avail Use% Mounted on
/dev/vda5 15G 3.7G 12G 25% /
/dev/vda1 1014M 143M 872M 15% /boot
/dev/mapper/vg01-lvol01 10G 33M 10G 1% /user_home
[root@test ~]# fdisk -l
Disk /dev/vda: 42.9 GB, 42949672960 bytes, 83886080 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x00000eab
Device Boot Start End Blocks Id System
/dev/vda1 * 2048 2099199 1048576 83 Linux
/dev/vda2 2099200 23078911 10489856 8e Linux LVM
/dev/vda3 23078912 31467519 4194304 82 Linux swap / Solaris
/dev/vda4 31467520 62914559 15723520 5 Extended
/dev/vda5 31469568 62914559 15722496 83 Linux
Disk /dev/sda: 42.9 GB, 42949672960 bytes, 83886080 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/mapper/vg01-lvol01: 10.7 GB, 10737418240 bytes, 20971520 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
[root@test ~]# fdisk /dev/vda
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): p
Disk /dev/vda: 42.9 GB, 42949672960 bytes, 83886080 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x00000eab
Device Boot Start End Blocks Id System
/dev/vda1 * 2048 2099199 1048576 83 Linux
/dev/vda2 2099200 23078911 10489856 8e Linux LVM
/dev/vda3 23078912 31467519 4194304 82 Linux swap / Solaris
/dev/vda4 31467520 62914559 15723520 5 Extended <<-- Extended 먼저 삭제
/dev/vda5 31469568 62914559 15722496 83 Linux
Command (m for help): d
Partition number (1-5, default 5): 4
Partition 4 is deleted
Command (m for help): p
Disk /dev/vda: 42.9 GB, 42949672960 bytes, 83886080 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x00000eab
Device Boot Start End Blocks Id System
/dev/vda1 * 2048 2099199 1048576 83 Linux
/dev/vda2 2099200 23078911 10489856 8e Linux LVM
/dev/vda3 23078912 31467519 4194304 82 Linux swap / Solaris
Command (m for help): n
Partition type:
p primary (3 primary, 0 extended, 1 free)
e extended
Select (default e): e
Selected partition 4
First sector (31467520-83886079, default 31467520):
Using default value 31467520
Last sector, +sectors or +size{K,M,G} (31467520-83886079, default 83886079):
Using default value 83886079
Partition 4 of type Extended and of size 25 GiB is set
Command (m for help): p
Disk /dev/vda: 42.9 GB, 42949672960 bytes, 83886080 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x00000eab
Device Boot Start End Blocks Id System
/dev/vda1 * 2048 2099199 1048576 83 Linux
/dev/vda2 2099200 23078911 10489856 8e Linux LVM
/dev/vda3 23078912 31467519 4194304 82 Linux swap / Solaris
/dev/vda4 31467520 83886079 26209280 5 Extended <<-- Extended 먼저 생성
Command (m for help): n
All primary partitions are in use
Adding logical partition 5
First sector (31469568-83886079, default 31469568):
Using default value 31469568
Last sector, +sectors or +size{K,M,G} (31469568-83886079, default 83886079):
Using default value 83886079
Partition 5 of type Linux and of size 25 GiB is set
Command (m for help): p
Disk /dev/vda: 42.9 GB, 42949672960 bytes, 83886080 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x00000eab
Device Boot Start End Blocks Id System
/dev/vda1 * 2048 2099199 1048576 83 Linux
/dev/vda2 2099200 23078911 10489856 8e Linux LVM
/dev/vda3 23078912 31467519 4194304 82 Linux swap / Solaris
/dev/vda4 31467520 83886079 26209280 5 Extended
/dev/vda5 31469568 83886079 26208256 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@test ~]# xfs_growfs /dev/vda5
meta-data=/dev/vda5 isize=512 agcount=7, agsize=982656 blks
= sectsz=512 attr=2, projid32bit=1
= crc=1 finobt=0 spinodes=0
data = bsize=4096 blocks=6552064, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0 ftype=1
log =internal bsize=4096 blocks=2560, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
[root@test ~]# df -Ph
Filesystem Size Used Avail Use% Mounted on
/dev/vda5 25G 3.7G 22G 15% /
/dev/vda1 1014M 143M 872M 15% /boot
/dev/mapper/vg01-lvol01 10G 33M 10G 1% /user_home