LVM(Logical Volume Manager)를 사용하여 저장공간을 늘려야 하는 부분이 있어서 설정한 내용을 정리해본다. 본 자료는 CentOS 7에서 진행된 내용을 기반으로 작성되었지만 다른 Linux에서도 활용할 수 있을 것으로 예상된다.
- partition 설정
- 2TB 이상
#parted /dev/sd[Device] #parted>print #parted>mklabel gpt #parted>mkpart primary 0 [최대용량] #parted>set 1 lvm on
- 2TB 이하
fdisk /dev/sd[Device] #fdisk>n (new partition) #fdisk>p (primary) #fdisk>1 (partition number) #fdisk>t (new type) #fdisk>8e (linux LVM) #fdisk>w (write)
- PV(Physical Volume) 생성
pvcreate /dev/sd[Device][no] pvdisplay
pvcreate /dev/sdb1 Physical volume "/dev/sdb1" successfully created
- VG(Volume Group) 생성
vgcreate [vg-name] /dev/sd[Device][no] /dev/sd[Device][no] vgdisplay
vgcreate data-vg01 /dev/sdb1 /dev/sdc1 Volume group "data-vg01" successfully created
- LV(Logical Volume) 생성
lvcreate --extents 100%FREE -n [lv-name] [vg-name] lvdisplay
lvcreate --extents 100%FREE --name data-lv01 data-vg01 Logical volume "data-lv01" created.
- 포맷
mkfs -t ext4 /dev/[vg-name]/[lv-name]
- fstab 추가
mkdir [mount-point] vi /etc/fstab /dev/[vg-name]/[lv-name] /[mount-point] ext4 defaults 0 2 mount -a mount
Azure에서 Linux VM에 LVM 구성
[스토리지] 리눅스 LVM 생성
[스토리지] 2TB 이상 스토리지의 파티션 생성 (리눅스 GPT, parted)
Congratulations @lawnseol! You received a personal award!
You can view your badges on your Steem Board and compare to others on the Steem Ranking
Do not miss the last post from @steemitboard:
Vote for @Steemitboard as a witness to get one more award and increased upvotes!
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Congratulations @lawnseol! You received a personal award!
Click here to view your Board
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit