볼륨 높이기

볼륨 높이기

재부팅할 때 Gparted Live CD를 사용하여 볼륨 그룹과 논리 파티션의 크기를 조정하고 사용하려고 하면 lvextend –l +100%FREE /dev/vda5다음 메시지가 나타납니다.

  Path required for Logical Volume "–l"
  Please provide a volume group name
  Run `lvextend --help' for more information.

pvs, lvs, vgs출력은 다음과 같습니다.

  VG       #PV #LV #SN Attr   VSize VFree
  d8dev-vg   1   2   0 wz--n- 9.76g 5.01g

  PV         VG       Fmt  Attr PSize PFree
  /dev/vda5  d8dev-vg lvm2 a--  9.76g 5.01g

  LV     VG       Attr      LSize    Pool Origin Data%  Move Log Copy%  Convert
  root   d8dev-vg -wi-ao---    3.75g
  swap_1 d8dev-vg -wi-ao--- 1020.00m

그리고 여기에 df -h출력이 있습니다

Filesystem      Size  Used Avail Use% Mounted on
udev            487M  4.0K  487M   1% /dev
tmpfs           100M  632K   99M   1% /run
/dev/dm-0       3.7G  3.2G  325M  91% /
none            4.0K     0  4.0K   0% /sys/fs/cgroup
none            5.0M     0  5.0M   0% /run/lock
none            498M  184K  497M   1% /run/shm
none            100M     0  100M   0% /run/user
/dev/vda1       236M   37M  188M  17% /boot
none            3.7G  3.2G  325M  91% /var/lib/docker/aufs/mnt/a5516e7a4136a510a3b6b388a57b266067cce4b2240db77a859910d3c741f988
shm              64M     0   64M   0% /var/lib/docker/containers/f5c852ead8bd3578b63fd5a259586c5a9c4b375b8505bb339e9f3c27cabc130f/shm
none            3.7G  3.2G  325M  91% /var/lib/docker/aufs/mnt/074360c189d2dae1477d9eeed419a86880355cab68c266155eb649aaee9e80ff
none            3.7G  3.2G  325M  91% /var/lib/docker/aufs/mnt/921ae5230e127989f8f12ecbd52a454965ed385531397fc46cfc5a82392ec876
none            3.7G  3.2G  325M  91% /var/lib/docker/aufs/mnt/eda6cf31040113c7216c4e07071596c724288071a94869b3606e90ea9fdc6034
shm              64M     0   64M   0% /var/lib/docker/containers/27d44748763ef03fea24464e11dde5498329ce438002812cc5168379825c5003/shm
shm              64M     0   64M   0% /var/lib/docker/containers/7a79506bb707843b3eea9d062f934e5f53a8ca72326a497559b0cd391f5f271b/shm
shm              64M     0   64M   0% /var/lib/docker/containers/78fbe6d2bccc7d29f08051a9ab4d2f02b0794fd7a95e28446e208184fa84b149/shm
none            3.7G  3.2G  325M  91% /var/lib/docker/aufs/mnt/d06efbeda0bcf8352e88aa078d23caf3855ae14dbd9100980c3431dfce5870a7
none            3.7G  3.2G  325M  91% /var/lib/docker/aufs/mnt/10dd1eb657163fb314d1fd5e7951645e957365b9760b46846491c8374e106039
shm              64M     0   64M   0% /var/lib/docker/containers/90a5ef4a9a761778fbad4bd052426263f5fe14d5248aaf7cdecd87013fb2c706/shm
shm              64M     0   64M   0% /var/lib/docker/containers/dd20465dc2764916efb2d29887dfe76d3bf8cf823b9e032d7ec399aa40dc083f/shm
none            3.7G  3.2G  325M  91% /var/lib/docker/aufs/mnt/966dc571c622e09757ceebbfefd540a6ab4b27922b2fbab8615277e343a67357
shm              64M     0   64M   0% /var/lib/docker/containers/312cceb4eb20613ad493df37097ab47a204da19669c3aa065feb7fc9818c126c/shm

이 명령을 시도했습니다

  lvextend –l +100%FREE /dev/vda5
  lvextend –l +100%FREE d8dev-vg
  lvextend –l +100%FREE /dev/root

그러나 모두 동일한 출력

  Path required for Logical Volume "–l"
  Please provide a volume group name

편집하다 :lvextend /dev/dm-0 /dev/vda5이제 내 출력은 다음과 같습니다 lvs.

  LV     VG       Attr      LSize    Pool Origin Data%  Move Log Copy%  Convert
  root   d8dev-vg -wi-ao---    8.76g
  swap_1 d8dev-vg -wi-ao--- 1020.00m

하지만 /dev/dm-0여전히 낮습니다.

Filesystem      Size  Used Avail Use% Mounted on
udev            487M  4.0K  487M   1% /dev
tmpfs           100M  632K   99M   1% /run
/dev/dm-0       3.7G  3.2G  325M  91% /

편집 2: vgdisplay그리고 lvdisplay:

  --- Volume group ---
  VG Name               d8dev-vg
  System ID
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  6
  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               9.76 GiB
  PE Size               4.00 MiB
  Total PE              2498
  Alloc PE / Size       2498 / 9.76 GiB
  Free  PE / Size       0 / 0
  VG UUID               AGVHqT-IO1R-l3uB-AeN4-q62b-z33r-b4NwS7

  --- Logical volume ---
  LV Path                /dev/d8dev-vg/root
  LV Name                root
  VG Name                d8dev-vg
  LV UUID                qet8dK-Izh1-uJul-2T0R-rDyy-ONNH-Xwvs2h
  LV Write Access        read/write
  LV Creation host, time d8dev, 2016-05-19 08:17:01 -0700
  LV Status              available
  # open                 1
  LV Size                8.76 GiB
  Current LE             2243
  Segments               2
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           252:0

  --- Logical volume ---
  LV Path                /dev/d8dev-vg/swap_1
  LV Name                swap_1
  VG Name                d8dev-vg
  LV UUID                4mbhDG-PmAN-Fym3-yXSI-gRkd-owki-eYqWqj
  LV Write Access        read/write
  LV Creation host, time d8dev, 2016-05-19 08:17:01 -0700
  LV Status              available
  # open                 2
  LV Size                1020.00 MiB
  Current LE             255
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           252:1

DF-목

Filesystem     Type      Size  Used Avail Use% Mounted on
udev           devtmpfs  487M  4.0K  487M   1% /dev
tmpfs          tmpfs     100M  632K   99M   1% /run
/dev/dm-0      ext4      3.7G  3.2G  325M  91% /
none           tmpfs     4.0K     0  4.0K   0% /sys/fs/cgroup
none           tmpfs     5.0M     0  5.0M   0% /run/lock
none           tmpfs     498M  184K  497M   1% /run/shm
none           tmpfs     100M     0  100M   0% /run/user
/dev/vda1      ext2      236M   37M  188M  17% /boot
none           aufs      3.7G  3.2G  325M  91% /var/lib/docker/aufs/mnt/a5516e7a4136a510a3b6b388a57b266067cce4b2240db77a859910d3c741f988
shm            tmpfs      64M     0   64M   0% /var/lib/docker/containers/f5c852ead8bd3578b63fd5a259586c5a9c4b375b8505bb339e9f3c27cabc130f/shm
none           aufs      3.7G  3.2G  325M  91% /var/lib/docker/aufs/mnt/074360c189d2dae1477d9eeed419a86880355cab68c266155eb649aaee9e80ff
none           aufs      3.7G  3.2G  325M  91% /var/lib/docker/aufs/mnt/921ae5230e127989f8f12ecbd52a454965ed385531397fc46cfc5a82392ec876
none           aufs      3.7G  3.2G  325M  91% /var/lib/docker/aufs/mnt/eda6cf31040113c7216c4e07071596c724288071a94869b3606e90ea9fdc6034
shm            tmpfs      64M     0   64M   0% /var/lib/docker/containers/27d44748763ef03fea24464e11dde5498329ce438002812cc5168379825c5003/shm
shm            tmpfs      64M     0   64M   0% /var/lib/docker/containers/7a79506bb707843b3eea9d062f934e5f53a8ca72326a497559b0cd391f5f271b/shm
shm            tmpfs      64M     0   64M   0% /var/lib/docker/containers/78fbe6d2bccc7d29f08051a9ab4d2f02b0794fd7a95e28446e208184fa84b149/shm
none           aufs      3.7G  3.2G  325M  91% /var/lib/docker/aufs/mnt/d06efbeda0bcf8352e88aa078d23caf3855ae14dbd9100980c3431dfce5870a7
none           aufs      3.7G  3.2G  325M  91% /var/lib/docker/aufs/mnt/10dd1eb657163fb314d1fd5e7951645e957365b9760b46846491c8374e106039
shm            tmpfs      64M     0   64M   0% /var/lib/docker/containers/90a5ef4a9a761778fbad4bd052426263f5fe14d5248aaf7cdecd87013fb2c706/shm
shm            tmpfs      64M     0   64M   0% /var/lib/docker/containers/dd20465dc2764916efb2d29887dfe76d3bf8cf823b9e032d7ec399aa40dc083f/shm
none           aufs      3.7G  3.2G  325M  91% /var/lib/docker/aufs/mnt/966dc571c622e09757ceebbfefd540a6ab4b27922b2fbab8615277e343a67357
shm            tmpfs      64M     0   64M   0% /var/lib/docker/containers/312cceb4eb20613ad493df37097ab47a204da19669c3aa065feb7fc9818c126c/shm

답변1

LVM(논리 볼륨 관리자)으로 작업할 때 작업 순서가 필수적이라는 점을 명심해야 합니다. 순서를 따르지 않으면 데이터가 손실될 위험이 있습니다.

PV(물리적 볼륨)과 (볼륨 그룹) 이 이미 있는 경우 VG추가 장치를 추가하여 볼륨 그룹을 확장하는 것이 더 쉽습니다.

볼륨 그룹을 확장하려면 vg1다음을 수행하십시오.

vgextend vg1 /dev/vda5

LV볼륨 그룹을 확장한 후 (논리 볼륨) 의 크기를 조정해야 합니다.

확장하려면 LV다음을 사용할 수 있습니다.

lvextend /dev/vg1/your_lv /dev/vda5 

이 단계에서는 논리 볼륨만 확장되었으며 파일 시스템은 확장되지 않았습니다.

파일 시스템을 확장하려면 resize2fs뒤에 LV. 예를 들어:

resize2fs /dev/vg1/your_lv

참고: 백그라운드에서 호출하고 이 작업을 자동으로 수행하는 플래그가 lvextend있습니다 .-rresize2fs

위의 내용을 요약하면 다음과 같습니다.

  1. 볼륨 그룹 확장
  2. 논리 볼륨 확장
  3. 파일 시스템 크기 조정

파일 시스템을 축소하려면( 에서는 불가능 xfs) 다음 절차를 따르십시오.

  1. 파일 시스템 축소
  2. 논리 볼륨의 크기 줄이기
  3. /dev/vda5예를 들어 볼륨 그룹에서 장치를 제거합니다.

관련 정보