LVM 파티션 축소(하지 않는 것이 좋습니다)

3639 단어 proxmoxlvm

참고 자료

  • linux - How can I shrink a Logical Volume, and re-allocate the freed space into a new partition on the same drive? - Super User
  • LVM 파티션 축소

  • proxmox3.4가 설치된 DISK(80GB)의 LVM은 다음 그림과 같습니다
  • 4
  • 그림과 같이 설정할 수 있기 때문에 노트(아직 할당되지 않은 부분이 있음...)

  • 설정


    pvscan
    # pvscan
    PV /dev/sdc3 VG pve lvm2 [74.40 GiB / 48.15 GiB free]
    Total: 1 [74.40 GiB] / in use: 1 [74.40 GiB] / in no VG: 0 [0 ]
    
  • 74.40 - 48.15 = 26.25
  • 26.25GB를 찍었는데 혼났어요.
    # pvresize --setphysicalvolumesize 26.25G /dev/sdc3
    /dev/sdc3: cannot resize to 6719 extents as 6720 are allocated.
    0 physical volume(s) resized / 1 physical volume(s) not resized
    
    27GB 할당 성공
    # pvresize --setphysicalvolumesize 27G /dev/sdc3
    Physical volume "/dev/sdc3" changed
    1 physical volume(s) resized / 0 physical volume(s) not resized
    # pvs
    PV VG Fmt Attr PSize PFree
    /dev/sdc3 pve lvm2 a-- 27.00g 764.00m
    
    확인
    # gdisk -l /dev/sdc
    Number Start (sector) End (sector) Size Code Name
    1 34 2047 1007.0 KiB EF02
    2 2048 262143 127.0 MiB EF00
    3 262144 156301454 74.4 GiB 8E00
    
    gdisk로 sdc3 사이즈 변경
    # gdisk /dev/sdc
    Command (? for help): d
    Partition number (1-3): 3
    Command (? for help): n
    Partition number (3-128, default 3):
    First sector (262144-156301454, default = 262144) or {+-}size{KMGTP}:
    Last sector (262144-156301454, default = 156301454) or {+-}size{KMGTP}: +27G
    Current type is 'Linux filesystem'
    Hex code or GUID (L to show codes, Enter = 8300): 8E00
    Changed type of partition to 'Linux LVM'
    Command (? for help): w
    Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
    PARTITIONS!!
    Do you want to proceed? (Y/N): y
    
    신중을 기하기 위해 OS를 재부팅했다

    좋은 웹페이지 즐겨찾기