pvcreate로 초기화하여 볼륨 그룹(VG)에 편입해 사용하실 수 있습니다.vgextend로 디스크를 추가해 용량을 늘리신 뒤, 해당 공간에서 논리 볼륨(LV)을 생성해 활용하실 수 있습니다.# parted -s /dev/vdb mklabel gpt # parted -s /dev/vdb mkpart vdb 1 100% # parted -s /dev/vdb set 1 lvm on
# parted -l | grep lvm
출력 예시:
1 1049kB 137GB 137GB vdd lvm
# pvcreate /dev/vdb1
출력 예시:
Physical volume "/dev/vdb1" successfully created. Creating devices file /etc/lvm/devices/system.devices
# vgcreate vgtest /dev/vdb1
출력 예시:
Volume group "vgtest" successfully created
# lvcreate -n lv_ext4 -L 10G vgtest # lvcreate -n lv_xfs -L 10G vgtest
# mkfs.ext4 /dev/vgtest/lv_ext4 # mkfs.xfs /dev/vgtest/lv_xfs
# mkdir -p /mnt/ext4 /mnt/xfs
# mount /dev/vgtest/lv_ext4 /mnt/ext4 # mount /dev/vgtest/lv_xfs /mnt/xfs
# df -Th /mnt/ext4 /mnt/xfs
출력 예시:
Filesystem Size Used Avail Use% Mounted on /dev/mapper/vgtest-lv_ext4 ext4 9.8G 24K 9.3G 1% /mnt/ext4 /dev/mapper/vgtest-lv_xfs ext4 9.8G 24K 9.3G 1% /mnt/xfs
# lvs -o+devices
출력 예시:
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert Devices lv_ext4 vgtest -wi-ao---- 10.00g /dev/vdb1(0) lv_xfs vgtest -wi-ao---- 10.00g /dev/vdb1(2560)
# parted -s /dev/vdc mklabel gpt # parted -s /dev/vdc mkpart vdc 1 100% # parted -s /dev/vdc set 1 lvm on
# parted -l | grep lvm
출력 예시:
1 1049kB 137GB 137GB vdd lvm 1 1049kB 137GB 137GB vdc lvm
# pvdisplay
출력 예시:
--- Physical volume --- PV Name /dev/vdb1 VG Name vgtest PV Size <128.00 GiB / not usable 2.00 MiB Allocatable yes PE Size 4.00 MiB Total PE 32767 Free PE 27647 Allocated PE 5120 PV UUID IQbVSq-NQGW-m2Xn-emp4-5Ygz-eCAw-fkXj7B
# pvcreate /dev/vdc1
출력 예시:
Physical volume "/dev/vdc1" successfully created.
# pvdisplay
출력 예시:
--- Physical volume --- PV Name /dev/vdb1 VG Name vgtest PV Size <128.00 GiB / not usable 2.00 MiB Allocatable yes PE Size 4.00 MiB Total PE 32767 Free PE 27647 Allocated PE 5120 PV UUID IQbVSq-NQGW-m2Xn-emp4-5Ygz-eCAw-fkXj7B "/dev/vdc1" is a new physical volume of "<128.00 GiB" --- NEW Physical volume --- PV Name /dev/vdc1 VG Name PV Size <128.00 GiB Allocatable NO PE Size 0 Total PE 0 Free PE 0 Allocated PE 0 PV UUID 283rhf-kkfk-c8Qp-M4Ts-m9bp-2xMd-DkMhuN
# vgdisplay
출력 예시:
--- Volume group --- VG Name vgtest System ID Format lvm2 Metadata Areas 1 Metadata Sequence No 3 VG Access read/write VG Status resizable MAX LV 0 Cur LV 2 Open LV 2 Max PV 0 Cur PV 1 Act PV 1 VG Size <128.00 GiB PE Size 4.00 MiB Total PE 32767 Alloc PE / Size 5120 / 20.00 GiB Free PE / Size 27647 / <108.00 GiB VG UUID 34QJUg-QapN-4rLJ-3HXG-nDpq-oio5-Hr3OwD
# vgextend vgtest /dev/vdc1
출력 예시:
Volume group "vgtest" successfully extended
# vgdisplay
출력 예시:
--- Volume group --- VG Name vgtest System ID Format lvm2 Metadata Areas 2 Metadata Sequence No 4 VG Access read/write VG Status resizable MAX LV 0 Cur LV 2 Open LV 2 Max PV 0 Cur PV 2 Act PV 2 VG Size 255.99 GiB PE Size 4.00 MiB Total PE 65534 Alloc PE / Size 5120 / 20.00 GiB Free PE / Size 60414 / 235.99 GiB VG UUID 34QJUg-QapN-4rLJ-3HXG-nDpq-oio5-Hr3OwD
# lvdisplay
출력 예시:
--- Logical volume --- LV Path /dev/vgtest/lv_ext4 LV Name lv_ext4 VG Name vgtest LV UUID vnYPbj-TyVi-iWKo-iSFU-mYHj-EOZU-Gyv4nG LV Write Access read/write LV Creation host, time KVM01, 2025-08-23 17:09:57 +0900 LV Status available # open 1 LV Size 10.00 GiB Current LE 2560 Segments 1 Allocation inherit Read ahead sectors auto - currently set to 256 Block device 252:0 --- Logical volume --- LV Path /dev/vgtest/lv_xfs LV Name lv_xfs VG Name vgtest LV UUID oe7NMp-zbHY-Zyfd-RaA9-N7HT-4Far-dmO5PQ LV Write Access read/write LV Creation host, time KVM01, 2025-08-23 17:10:04 +0900 LV Status available # open 1 LV Size 10.00 GiB Current LE 2560 Segments 1 Allocation inherit Read ahead sectors auto - currently set to 256 Block device 252:1
# lvextend -r -L +10G /dev/vgtest/lv_ext4
출력 예시:
Size of logical volume vgtest/lv_ext4 changed from 10.00 GiB (2560 extents) to 20.00 GiB (5120 extents). File system ext4 found on vgtest/lv_ext4 mounted at /mnt/ext4. Extending file system ext4 to 20.00 GiB (21474836480 bytes) on vgtest/lv_ext4... resize2fs /dev/vgtest/lv_ext4 resize2fs 1.46.5 (30-Dec-2021) Filesystem at /dev/vgtest/lv_ext4 is mounted on /mnt/ext4; on-line resizing required old_desc_blocks = 2, new_desc_blocks = 3 The filesystem on /dev/vgtest/lv_ext4 is now 5242880 (4k) blocks long. resize2fs done Extended file system ext4 on vgtest/lv_ext4. Logical volume vgtest/lv_ext4 successfully resized.
# lvextend -r -L +10G /dev/vgtest/lv_xfs
출력 예시:
Size of logical volume vgtest/lv_xfs changed from 10.00 GiB (2560 extents) to 20.00 GiB (5120 extents).
File system xfs found on vgtest/lv_xfs mounted at /mnt/xfs.
Extending file system xfs to 20.00 GiB (21474836480 bytes) on vgtest/lv_xfs...
xfs_growfs /dev/vgtest/lv_xfs
meta-data=/dev/mapper/vgtest-lv_xfs isize=512 agcount=4, agsize=655360 blks
= sectsz=512 attr=2, projid32bit=1
= crc=1 finobt=1, sparse=1, rmapbt=0
= reflink=1 bigtime=1 inobtcount=1 nrext64=0
data = bsize=4096 blocks=2621440, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0, ftype=1
log =internal log bsize=4096 blocks=16384, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
data blocks changed from 2621440 to 5242880
xfs_growfs done
Extended file system xfs on vgtest/lv_xfs.
Logical volume vgtest/lv_xfs successfully resized. # lvdisplay
출력 예시:
--- Logical volume --- LV Path /dev/vgtest/lv_ext4 LV Name lv_ext4 VG Name vgtest LV UUID vnYPbj-TyVi-iWKo-iSFU-mYHj-EOZU-Gyv4nG LV Write Access read/write LV Creation host, time KVM01, 2025-08-23 17:09:57 +0900 LV Status available # open 1 LV Size 20.00 GiB Current LE 5120 Segments 2 Allocation inherit Read ahead sectors auto - currently set to 256 Block device 252:0 --- Logical volume --- LV Path /dev/vgtest/lv_xfs LV Name lv_xfs VG Name vgtest LV UUID oe7NMp-zbHY-Zyfd-RaA9-N7HT-4Far-dmO5PQ LV Write Access read/write LV Creation host, time KVM01, 2025-08-23 17:10:04 +0900 LV Status available # open 1 LV Size 20.00 GiB Current LE 5120 Segments 2 Allocation inherit Read ahead sectors auto - currently set to 256 Block device 252:1
# df -Th /mnt/ext4 /mnt/xfs
출력 예시:
Filesystem Size Used Avail Use% Mounted on /dev/mapper/vgtest-lv_ext4 ext4 20G 24K 19G 1% /mnt/ext4 /dev/mapper/vgtest-lv_xfs ext4 20G 24K 19G 1% /mnt/xfs
# lvs -o+devices
출력 예시:
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert Devices lv_ext4 vgtest -wi-ao---- 20.00g /dev/vdb1(0) lv_ext4 vgtest -wi-ao---- 20.00g /dev/vdb1(5120) lv_xfs vgtest -wi-ao---- 20.00g /dev/vdb1(2560) lv_xfs vgtest -wi-ao---- 20.00g /dev/vdb1(7680)
# umount /mnt/ext4/
# e2fsck -f /dev/vgtest/lv_ext4
출력 예시:
e2fsck 1.46.5 (30-Dec-2021) Pass 1: Checking inodes, blocks, and sizes Pass 2: Checking directory structure Pass 3: Checking directory connectivity Pass 4: Checking reference counts Pass 5: Checking group summary information /dev/vgtest/lv_ext4: 11/1310720 files (0.0% non-contiguous), 109927/5242880 blocks
# resize2fs /dev/vgtest/lv_ext4 15360M
출력 예시:
resize2fs 1.46.5 (30-Dec-2021) Resizing the filesystem on /dev/vgtest/lv_ext4 to 3932160 (4k) blocks. The filesystem on /dev/vgtest/lv_ext4 is now 3932160 (4k) blocks long.
# lvreduce -L 15360M /dev/vgtest/lv_ext4
출력 예시:
File system ext4 found on vgtest/lv_ext4. File system size (15.00 GiB) is equal to the requested size (15.00 GiB). File system reduce is not needed, skipping. Size of logical volume vgtest/lv_ext4 changed from 20.00 GiB (5120 extents) to 15.00 GiB (3840 extents). Logical volume vgtest/lv_ext4 successfully resized.
# mount /dev/vgtest/lv_ext4 /mnt/ext4/
# df -Th /mnt/ext4/
출력 예시:
Filesystem Type Size Used Avail Use% Mounted on /dev/mapper/vgtest-lv_ext4 ext4 15G 24K 14G 1% /mnt/ext4
# lvs -o+devices
출력 예시:
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert Devices lv_ext4 vgtest -wi-ao---- 15.00g /dev/vdb1(0) lv_ext4 vgtest -wi-ao---- 15.00g /dev/vdb1(5120) lv_xfs vgtest -wi-ao---- 20.00g /dev/vdb1(2560) lv_xfs vgtest -wi-ao---- 20.00g /dev/vdb1(7680)
https://youtu.be/n8-wlkZiqio 1. 개요 NFS(Network File System)를 설치하고, rw/ro 및 root_squash 옵션에 따른 접근 제어와 성능을 테스트하는 방법을 정리한 가이드입니다.…
https://youtu.be/4MVxzmepY3s 1. 개요 리눅스에서 정기적으로 실행되는 작업(백업, 로그 정리, 모니터링 등)은 cron 서비스를 통해 자동화할 수 있습니다.…
https://youtu.be/vPfxWFBE1yc 1. 개요 리눅스 서버를 운영할 때 사용자 계정 생성, 비밀번호 설정, 권한 부여, 계정…
https://youtu.be/Gvp2XwBfoKw 1. 개요 리눅스 서버에서는 시스템 시간(OS 시간) 과 하드웨어 시간(RTC, Real-Time Clock) 을 동기화하는 것이 매우 중요합니다. 클러스터…
https://youtu.be/pt9qhawl8LY 1. 개요 리눅스 서버에서는 시스템 시간(OS 시간) 과 하드웨어 시간(RTC, Real-Time Clock) 을 모두 관리할 수 있습니다. 운영체제의…
https://youtu.be/iPdHGXh7DUg 1. 개요 서버 운영 시 시스템 시간이 올바르게 설정되어 있지 않으면 로그 분석, 모니터링,…