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/XYBR1ZFrV9s 1. 개요 parted를 사용해 새 디스크에 GPT 라벨 생성 → 파티션 생성(ext4/XFS) → 포맷/마운트 →…
https://youtu.be/yYV8RQKCFzA 1. 개요 이 문서는 fdisk를 사용해 MBR(DOS) 디스크에 파티션을 생성하고, ext4/XFS 파일시스템을 포맷·마운트, /etc/fstab에 등록했다가, 안전하게 해제·삭제하는 전…
1. 개요 Linux에서 디스크 파티션 스타일은 MBR(Master Boot Record) 와 GPT(GUID Partition Table)에 대해 설명합니다. 2. MBR이란? 디스크…
https://youtu.be/CNd1bJV4wGY 1. 개요 Windows Server를 새로 설치할 때의 설치 과정을 단계별로 정리하였습니다. Windows Server 설치…
https://youtu.be/dVe6vc76yL0 1. 개요 Rocky Linux 9.5 환경에서 두 개의 NIC를 하나로 묶는 Active-Backup Bonding 구성 후, 해당…
https://youtu.be/48ebJfKsCuw 1. 개요 KVM 가상화 환경에서 Isolated 네트워크를 생성하고 VM에 할당하는 방법을 설명합니다. Isolated 네트워크는…