Linux

root 파티션 용량 늘리기

techapi 2025. 3. 12. 16:06
반응형

## 파티션 확인 ##

fdisk –l

 

 

## 시작 ##

fdisk /dev/xvda

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): n

Partition type:

p primary (2 primary, 0 extended, 2 free)

e extended

Select (default p):p

Partition number (3,4, default 3): 3

First sector (41943040-209715199, default 41943040):(ENTER)

Using default value 41943040

Last sector, +sectors or +size{K,M,G} (41943040-209715199, default 209715199): (ENTER)

Using default value 209715199

Partition 3 of type Linux and of size 80 GiB is set

Command (m for help): t

Partition number (1-3, default 3): 3

Hex code (type L to list all codes): 8e

Changed type of partition 'Linux' to 'Linux LVM'

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.

 

## reboot ##

 

# cd /dev/

# ll | grep xvda

 

 

## Volume Group /dev/xvda3 추가 ##

 

## VG 이름 확인  →  VG Name centos

vgdisplay

 

vgextend centos /dev/xvda3

 

 

## 추가된 xvda 등록하기 ##

pvcreate /dev/xvda3

 

Physical volume "/dev/xvda3" successfully created.

 

## pvscan / vg그룹 이름 확인 (centos) / 증설 ##

→ Volume Group 확인하여 FREE PE 자신이 추가한 파티션 사이즈가 존재하는지 확인.

→ 이후 Logical Volume Volume Group 용량을 모두 /dev/centos/root 할당하여 증설

 

pvscan

PV /dev/xvda2 VG centos lvm2 [<19.07 GiB / 0 free]

PV /dev/xvda3 lvm2 [80.00 GiB]

Total: 2 [<99.07 GiB] / in use: 1 [<19.07 GiB] / in no VG: 1 [80.00 GiB]

 

lvextend /dev/centos/root -l +100%FREE

 

 

## xfs_growfs ##

 

xfs_growfs /dev/mapper/centos-root

 

## df –h 확인 ##

df -h

 

반응형

'Linux' 카테고리의 다른 글

redis session test  (0) 2025.03.12
Redis 설치  (0) 2025.03.12
aws disk 용량 증설  (0) 2025.03.12
Daemon check sctipt  (0) 2025.03.12
Aapache_logrotate script  (0) 2025.03.12