smq (Stochastic Multiqueue) : 기본값, 자주 쓰이는 데이터를 효율적으로 캐싱.mq : 구 버전 정책, 현재는 잘 쓰이지 않음.# parted -s /dev/vdb mklabel gpt # parted -s /dev/vdb mkpart vdb 1 100% # parted -s /dev/vdb set 1 lvm on
# pvcreate /dev/vdb1
# pvdisplay -s
출력 예시:
Device "/dev/vdb1" has a capacity of <128.00 GiB
# vgcreate vg_test /dev/vdb1
# vgdisplay
출력 예시:
--- Volume group --- VG Name vg_test System ID Format lvm2 Metadata Areas 1 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 1 Act PV 1 VG Size <128.00 GiB PE Size 4.00 MiB Total PE 32767 Alloc PE / Size 0 / 0 Free PE / Size 32767 / <128.00 GiB VG UUID gmjgrB-CGSb-iUmT-qd3I-QThR-Au2V-fihkA1
# lvcreate -n lv_ext4 -l 32767 vg_test
# lvdisplay
출력 예시:
--- Logical volume --- LV Path /dev/vg_test/lv_ext4 LV Name lv_ext4 VG Name vg_test LV UUID fYd8cT-3u5x-t26c-19Sf-9yxp-llo3-CT54Y9 LV Write Access read/write LV Creation host, time KVM01, 2025-09-06 17:08:09 +0900 LV Status available # open 0 LV Size <128.00 GiB Current LE 32767 Segments 1 Allocation inherit Read ahead sectors auto - currently set to 256 Block device 252:0
# mkfs.ext4 /dev/vg_test/lv_ext4
# mkdir /mnt/ext4
# mount /dev/vg_test/lv_ext4 /mnt/ext4/
# df -Th /mnt/ext4/
출력 예시:
Filesystem Type Size Used Avail Use% Mounted on /dev/mapper/vg_test-lv_ext4 ext4 126G 24K 120G 1% /mnt/ext4
# parted -s /dev/vdc mklabel gpt # parted -s /dev/vdc mkpart vdc 1 100% # parted -s /dev/vdc set 1 lvm on
# pvcreate /dev/vdc1
출력 예시:
Physical volume "/dev/vdc1" successfully created.
# pvdisplay -s
출력 예시:
Device "/dev/vdb1" has a capacity of 0 Device "/dev/vdc1" has a capacity of <128.00 GiB
# vgdisplay -s
출력 예시:
"vg_test" <128.00 GiB [<128.00 GiB used / 0 free]
# vgextend vg_test /dev/vdc1
출력 예시:
Volume group "vg_test" successfully extended
# vgdisplay -s
출력 예시:
"vg_test" 255.99 GiB [<128.00 GiB used / <128.00 GiB free]
# lvcreate --type cache-pool -n cachepool -L 100G vg_test /dev/vdc1
출력 예시:
Using 128.00 KiB chunk size instead of default 64.00 KiB, so cache pool has less than 1000000 chunks. Logical volume "cachepool" created.
# lvdisplay vg_test/cachepool
출력 예시:
--- Logical volume --- LV Path /dev/vg_test/cachepool LV Name cachepool VG Name vg_test LV UUID XU13p3-mOHa-vM0Q-IuQ3-Baon-m9hC-NksTly LV Write Access read/write LV Creation host, time KVM01, 2025-09-06 17:14:06 +0900 LV Pool metadata cachepool_cmeta LV Pool data cachepool_cdata LV Status NOT available LV Size 100.00 GiB Current LE 25600 Segments 1 Allocation inherit Read ahead sectors auto
# lvdisplay -m /dev/vg_test/lv_ext4
출력 예시:
--- Logical volume ---
LV Path /dev/vg_test/lv_ext4
LV Name lv_ext4
VG Name vg_test
LV UUID UlcPen-hyeP-mDfM-pnd1-jGLE-RtdW-Dp2XnI
LV Write Access read/write
LV Creation host, time KVM01, 2025-09-07 12:00:36 +0900
LV Status available
# open 1
LV Size <128.00 GiB
Current LE 32767
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 252:0
--- Segments ---
Logical extents 0 to 32766:
Type linear
Physical volume /dev/vdb1
Physical extents 0 to 32766 # lvs -a -o lv_name,segtype,cache_mode,cache_policy,metadata_percent,data_percent,devices vg_test
출력 예시:
LV Type CacheMode CachePolicy Meta% Data% Devices cachepool cache-pool cachepool_cdata(0) [cachepool_cdata] linear /dev/vdc1(20) [cachepool_cmeta] linear /dev/vdc1(10) lv_ext4 linear /dev/vdb1(0) [lvol0_pmspare] linear /dev/vdc1(0)
# lvconvert --type cache --cachepool vg_test/cachepool --cachemode writeback vg_test/lv_ext4
출력 예시:
Do you want wipe existing metadata of cache pool vg_test/cachepool? [y/n]: **y** Logical volume vg_test/lv_ext4 is now cached.
# lvdisplay -m /dev/vg_test/lv_ext4
출력 예시:
--- Logical volume ---
LV Path /dev/vg_test/lv_ext4
LV Name lv_ext4
VG Name vg_test
LV UUID UlcPen-hyeP-mDfM-pnd1-jGLE-RtdW-Dp2XnI
LV Write Access read/write
LV Creation host, time KVM01, 2025-09-07 12:00:36 +0900
LV Cache pool name cachepool_cpool
LV Cache origin name lv_ext4_corig
LV Status available
# open 1
LV Size <128.00 GiB
Cache used blocks 0.01%
Cache metadata blocks 16.14%
Cache dirty blocks 0.00%
Cache read hits/misses 5 / 34
Cache wrt hits/misses 0 / 0
Cache demotions 0
Cache promotions 4
Current LE 32767
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 512
Block device 252:0
--- Segments ---
Logical extents 0 to 32766:
Type cache
Chunk size 128.00 KiB
Metadata format 2
Mode writeback
Policy smq # lvs -a -o lv_name,segtype,cache_mode,cache_policy,metadata_percent,data_percent,devices vg_test
출력 예시:
LV Type CacheMode CachePolicy Meta% Data% Devices [cachepool_cpool] cache-pool writeback smq 16.14 0.01 cachepool_cpool_cdata(0) [cachepool_cpool_cdata] linear /dev/vdc1(20) [cachepool_cpool_cmeta] linear /dev/vdc1(10) lv_ext4 cache writeback smq 16.14 0.01 lv_ext4_corig(0) [lv_ext4_corig] linear /dev/vdb1(0) [lvol0_pmspare] linear /dev/vdc1(0)
# dnf -y install sysstat
# iostat -x /dev/vdb1 /dev/vdc1 1
# dd if=/dev/zero of=/mnt/ext4/test file bs=1024M count=100 oflag=direct
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. 개요 서버 운영 시 시스템 시간이 올바르게 설정되어 있지 않으면 로그 분석, 모니터링,…