LVM(Logical Volume Manger) 설정

  1. 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)
    
  1. PV(Physical Volume) 생성
    pvcreate /dev/sd[Device][no]
    pvdisplay
    
    pvcreate /dev/sdb1
    Physical volume "/dev/sdb1" successfully created
    
  2. 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
    
  3. 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.
    
  4. 포맷
    mkfs -t ext4 /dev/[vg-name]/[lv-name]
    
  5. 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)