LVM 가이드 · 4 min read · Oct 08, 2025

LVM 초보자 가이드 - 2페이지

이제 볼륨 그룹 fileserver를 만들고 /dev/sdb1 - /dev/sde1을 추가해 봅시다:

vgcreate fileserver /dev/sdb1 /dev/sdc1 /dev/sdd1 /dev/sde1
server1:~# vgcreate fileserver /dev/sdb1 /dev/sdc1 /dev/sdd1 /dev/sde1  
   Volume group "fileserver" successfully created

우리의 볼륨 그룹에 대해 알아봅시다:

vgdisplay
server1:~# vgdisplay  
   --- Volume group ---  
   VG Name               fileserver  
   System ID  
   Format                lvm2  
   Metadata Areas        4  
   Metadata Sequence No  1  
   VG Access            read/write  
   VG Status            resizable  
   MAX LV               0  
   Cur LV               0  
   Open LV              0  
   Max PV               0  
   Cur PV               4  
   Act PV               4  
   VG Size              93.14 GB  
   PE Size              4.00 MB  
   Total PE             23844  
   Alloc PE / Size      0 / 0  
   Free  PE / Size      23844 / 93.14 GB  
   VG UUID              3Y1WVF-BLET-QkKs-Qnrs-SZxI-wrNO-dTqhFP

볼륨 그룹에 대해 알아보는 또 다른 명령어:

vgscan
server1:~# vgscan  
   Reading all physical volumes.  This may take a while...  
   Found volume group "fileserver" using metadata type lvm2

훈련 목적으로 볼륨 그룹 fileserver의 이름을 data로 변경해 봅시다:

vgrename fileserver data
server1:~# vgrename fileserver data  
   Volume group "fileserver" successfully renamed to "data"

볼륨 그룹의 이름이 변경되었는지 확인하기 위해 vgdisplay와 vgscan을 다시 실행해 봅시다:

vgdisplay
server1:~# vgdisplay  
   --- Volume group ---  
   VG Name               data  
   System ID  
   Format                lvm2  
   Metadata Areas        4  
   Metadata Sequence No  2  
   VG Access            read/write  
   VG Status            resizable  
   MAX LV               0  
   Cur LV               0  
   Open LV              0  
   Max PV               0  
   Cur PV               4  
   Act PV               4  
   VG Size              93.14 GB  
   PE Size              4.00 MB  
   Total PE             23844  
   Alloc PE / Size      0 / 0  
   Free  PE / Size      23844 / 93.14 GB  
   VG UUID              3Y1WVF-BLET-QkKs-Qnrs-SZxI-wrNO-dTqhFP
vgscan
server1:~# vgscan  
   Reading all physical volumes.  This may take a while...  
   Found volume group "data" using metadata type lvm2

이제 볼륨 그룹 data를 삭제해 봅시다:

vgremove data
server1:~# vgremove data  
   Volume group "data" successfully removed
vgdisplay

이번에는 출력이 없습니다:

server1:~# vgdisplay
vgscan
server1:~# vgscan  
   Reading all physical volumes.  This may take a while...

이제 볼륨 그룹 fileserver를 다시 만들어 봅시다:

vgcreate fileserver /dev/sdb1 /dev/sdc1 /dev/sdd1 /dev/sde1
server1:~# vgcreate fileserver /dev/sdb1 /dev/sdc1 /dev/sdd1 /dev/sde1  
   Volume group "fileserver" successfully created

다음으로 볼륨 그룹 fileserver에서 논리 볼륨 share (40GB), backup (5GB), media (1GB)를 생성합니다. 이들은 사용 가능한 공간의 50% 미만을 사용합니다 (이렇게 하면 나중에 RAID1을 사용할 수 있습니다):

lvcreate --name share --size 40G fileserver
server1:~# lvcreate --name share  --size 40G fileserver  
   Logical volume "share" created
lvcreate --name backup --size 5G fileserver
server1:~# lvcreate --name backup --size  5G fileserver  
   Logical volume "backup" created
lvcreate --name media --size 1G fileserver
server1:~# lvcreate --name media  --size  1G fileserver  
   Logical volume "media" created

우리의 논리 볼륨을 개요해 봅시다:

lvdisplay
server1:~# lvdisplay  
   --- Logical volume ---  
   LV Name                /dev/fileserver/share  
   VG Name                fileserver  
   LV UUID                280Mup-H9aa-sn0S-AXH3-04cP-V6p9-lfoGgJ  
   LV Write Access        read/write  
   LV Status              available  
   # open                 0  
   LV Size                40.00 GB  
   Current LE            10240  
   Segments               2  
   Allocation             inherit  
   Read ahead sectors     0  
   Block device           253:0  
   
   --- Logical volume ---  
   LV Name                /dev/fileserver/backup  
   VG Name                fileserver  
   LV UUID                zZeuKg-Dazh-aZMC-Aa99-KUSt-J6ET-KRe0cD  
   LV Write Access        read/write  
   LV Status              available  
   # open                 0  
   LV Size                5.00 GB  
   Current LE            1280  
   Segments               1  
   Allocation             inherit  
   Read ahead sectors     0  
   Block device           253:1  
   
   --- Logical volume ---  
   LV Name                /dev/fileserver/media  
   VG Name                fileserver  
   LV UUID                usfvrv-BC92-3pFH-2NW0-2N3e-6ERQ-4Sj7YS  
   LV Write Access        read/write  
   LV Status              available  
   # open                 0  
   LV Size                1.00 GB  
   Current LE            256  
   Segments               1  
   Allocation             inherit  
   Read ahead sectors     0  
   Block device           253:2
lvscan
server1:~# lvscan  
   ACTIVE            '/dev/fileserver/share' [40.00 GB] inherit  
   ACTIVE            '/dev/fileserver/backup' [5.00 GB] inherit  
   ACTIVE            '/dev/fileserver/media' [1.00 GB] inherit

훈련 목적으로 논리 볼륨 media의 이름을 films로 변경합니다:

lvrename fileserver media films
server1:~# lvrename fileserver media films  
   Renamed "media" to "films" in volume group "fileserver"
lvdisplay
server1:~# lvdisplay  
   --- Logical volume ---  
   LV Name                /dev/fileserver/share  
   VG Name                fileserver  
   LV UUID                280Mup-H9aa-sn0S-AXH3-04cP-V6p9-lfoGgJ  
   LV Write Access        read/write  
   LV Status              available  
   # open                 0  
   LV Size                40.00 GB  
   Current LE            10240  
   Segments               2  
   Allocation             inherit  
   Read ahead sectors     0  
   Block device           253:0  
   
   --- Logical volume ---  
   LV Name                /dev/fileserver/backup  
   VG Name                fileserver  
   LV UUID                zZeuKg-Dazh-aZMC-Aa99-KUSt-J6ET-KRe0cD  
   LV Write Access        read/write  
   LV Status              available  
   # open                 0  
   LV Size                5.00 GB  
   Current LE            1280  
   Segments               1  
   Allocation             inherit  
   Read ahead sectors     0  
   Block device           253:1  
   
   --- Logical volume ---  
   LV Name                /dev/fileserver/films  
   VG Name                fileserver  
   LV UUID                usfvrv-BC92-3pFH-2NW0-2N3e-6ERQ-4Sj7YS  
   LV Write Access        read/write  
   LV Status              available  
   # open                 0  
   LV Size                1.00 GB  
   Current LE            256  
   Segments               1  
   Allocation             inherit  
   Read ahead sectors     0  
   Block device           253:2
lvscan
server1:~# lvscan  
   ACTIVE            '/dev/fileserver/share' [40.00 GB] inherit  
   ACTIVE            '/dev/fileserver/backup' [5.00 GB] inherit  
   ACTIVE            '/dev/fileserver/films' [1.00 GB] inherit

다음으로 논리 볼륨 films를 삭제해 봅시다:

lvremove /dev/fileserver/films

server1:~# lvremove /dev/fileserver/films
Do you really want to remove active logical volume “films”? [y/n]: <– y
Logical volume “films” successfully removed

논리 볼륨 media를 다시 생성합니다:

lvcreate --name media --size 1G fileserver
server1:~# lvcreate --name media  --size  1G fileserver  
   Logical volume "media" created

이제 media를 1GB에서 1.5GB로 늘려 봅시다:

lvextend -L1.5G /dev/fileserver/media
server1:~# lvextend -L1.5G /dev/fileserver/media  
   Extending logical volume media to 1.50 GB  
   Logical volume media successfully resized

다시 1GB로 줄여 봅시다:

lvreduce -L1G /dev/fileserver/media

server1:~# lvreduce -L1G /dev/fileserver/media
WARNING: Reducing active logical volume to 1.00 GB
THIS MAY DESTROY YOUR DATA (filesystem etc.)
Do you really want to reduce media? [y/n]: <– y
Reducing logical volume media to 1.00 GB
Logical volume media successfully resized

Share: X/Twitter LinkedIn

새 게시물을 받은 편지함에서 받기

스팸은 없습니다. 언제든지 구독 해지 가능합니다.