동일한 디스크에 LVM RAID5를 추가했지만 범위가 충분하지 않습니다.

동일한 디스크에 LVM RAID5를 추가했지만 범위가 충분하지 않습니다.

3x4TB 드라이브로 구성된 CentOS 8 시스템에 기존 LVM RAID5 어레이가 있습니다. 어레이에 공간이 부족해지기 시작했기 때문에 동일한 4TB 드라이브를 어레이에 추가하여 총 공간을 늘리고 싶습니다. 그러나 실행하면 lvextend /dev/storage/raidarray /dev/sda다음과 같은 결과가 나타납니다.

Converted 100%PVS into 953861 physical extents.
Using stripesize of last segment 64.00 KiB
Archiving volume group "storage" metadata (seqno 35).
Extending logical volume storage/raidarray to <10.92 TiB
Insufficient free space: 1430790 extents needed, but only 953861 available

출력은 다음과 같습니다 pvs.

PV         VG      Fmt  Attr PSize   PFree
/dev/sda   storage lvm2 a--   <3.64t  <3.64t
/dev/sdb3  cl      lvm2 a--  221.98g      0
/dev/sdc   storage lvm2 a--   <3.64t      0
/dev/sdd   storage lvm2 a--   <3.64t      0
/dev/sde   storage lvm2 a--   <3.64t      0
/dev/sdf           lvm2 ---  119.24g 119.24g

lvs -o +devices:

LV        VG      Attr       LSize    Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert Devices
home      cl      -wi-a----- <164.11g                                                     /dev/sdb3(12800)
root      cl      -wi-ao----   50.00g                                                     /dev/sdb3(0)
swap      cl      -wi-ao----   <7.88g                                                     /dev/sdb3(54811)
raidarray storage rwi-aor---   <7.28t                                    100.00           raidarray_rimage_0(0),raidarray_rimage_1(0),raidarray_rimage_2(0)

pvdisplay:

--- Physical volume ---
PV Name               /dev/sdb3
VG Name               cl
PV Size               221.98 GiB / not usable 3.00 MiB
Allocatable           yes (but full)
PE Size               4.00 MiB
Total PE              56827
Free PE               0
Allocated PE          56827
PV UUID               MM6j63-1V3E-YWXl-61ro-f3bB-7ysd-c1DGQv

--- Physical volume ---
PV Name               /dev/sdc
VG Name               storage
PV Size               <3.64 TiB / not usable <3.84 MiB
Allocatable           yes (but full)
PE Size               4.00 MiB
Total PE              953861
Free PE               0
Allocated PE          953861
PV UUID               rmqBBu-DD8U-d7WW-yzKW-R97b-1M4r-RYb1Qx

--- Physical volume ---
PV Name               /dev/sdd
VG Name               storage
PV Size               <3.64 TiB / not usable <3.84 MiB
Allocatable           yes (but full)
PE Size               4.00 MiB
Total PE              953861
Free PE               0
Allocated PE          953861
PV UUID               TBn2He-cRTU-eybT-fuBM-REbO-YNfr-Ca86gU

--- Physical volume ---
PV Name               /dev/sde
VG Name               storage
PV Size               <3.64 TiB / not usable <3.84 MiB
Allocatable           yes (but full)
PE Size               4.00 MiB
Total PE              953861
Free PE               0
Allocated PE          953861
PV UUID               wHZOf0-KTK9-2qLW-USl9-Gkgz-6MjV-D3gWrH

--- Physical volume ---
PV Name               /dev/sdf
VG Name               storage
PV Size               119.24 GiB / not usable <4.34 MiB
Allocatable           yes
PE Size               4.00 MiB
Total PE              30525
Free PE               30525
Allocated PE          0
PV UUID               MWWaUJ-UC2h-YT29-bMol-fWoQ-5Chl-uKBB4O

--- Physical volume ---
PV Name               /dev/sda
VG Name               storage
PV Size               <3.64 TiB / not usable <3.84 MiB
Allocatable           yes
PE Size               4.00 MiB
Total PE              953861
Free PE               953861
Allocated PE          0
PV UUID               vzGHi9-TF42-EFx9-uLch-EioJ-DI35-RuZuJt

그리고 lsblk:

NAME                         MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda                            8:0    0   3.7T  0 disk
sdb                            8:16   0 223.6G  0 disk
├─sdb1                         8:17   0   600M  0 part /boot/efi
├─sdb2                         8:18   0     1G  0 part /boot
└─sdb3                         8:19   0   222G  0 part
  ├─cl-root                  253:0    0    50G  0 lvm  /
  └─cl-swap                  253:1    0   7.9G  0 lvm  [SWAP]
sdc                            8:32   0   3.7T  0 disk
├─storage-raidarray_rmeta_0  253:7    0     4M  0 lvm
│ └─storage-raidarray        253:14   0   7.3T  0 lvm  /home
└─storage-raidarray_rimage_0 253:8    0   3.7T  0 lvm
  └─storage-raidarray        253:14   0   7.3T  0 lvm  /home
sdd                            8:48   0   3.7T  0 disk
├─storage-raidarray_rmeta_1  253:9    0     4M  0 lvm
│ └─storage-raidarray        253:14   0   7.3T  0 lvm  /home
└─storage-raidarray_rimage_1 253:10   0   3.7T  0 lvm
  └─storage-raidarray        253:14   0   7.3T  0 lvm  /home
sde                            8:64   0   3.7T  0 disk
├─storage-raidarray_rmeta_2  253:11   0     4M  0 lvm
│ └─storage-raidarray        253:14   0   7.3T  0 lvm  /home
└─storage-raidarray_rimage_2 253:12   0   3.7T  0 lvm
  └─storage-raidarray        253:14   0   7.3T  0 lvm  /home
sdf                            8:80   0 119.2G  0 disk
sdg                            8:96   1  14.8G  0 disk
└─sdg1                         8:97   1  14.8G  0 part

나는 이 질문에 대한 답을 찾고 있었지만 LVM RAID에 대해서는 mdadm에 관한 기사를 거의 찾지 못했습니다. 추가 드라이브를 구입하지 않고 데이터 손실 없이 RAID 어레이를 확장할 수 있는 방법을 아는 사람이 있습니까?

답변1

저는 평소에 LVM RAID를 사용하지 않아서, 여러분의 상황을 완벽하게 재현하지 못하더라도 양해해 주시기 바랍니다. 그럼 숫자가 좀 이상해지겠네요.

mdadmLVM 용어에서는 스트라이프가 2개인 raid5라고 합니다(패리티는 계산되지 않음) .

# lvs -o +devices HDD/raidtest
  LV       VG  Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert Devices                                                       
  raidtest HDD rwi-a-r--- 256.00m                                    100.00           raidtest_rimage_0(0),raidtest_rimage_1(0),raidtest_rimage_2(0)

다른 스트라이프를 추가하는 효과는 다음과 같습니다.

# lvconvert --stripes 3 HDD/raidtest
  Using default stripesize 64.00 KiB.
  WARNING: Adding stripes to active logical volume HDD/raidtest will grow it from 4 to 6 extents!
  Run "lvresize -l4 HDD/raidtest" to shrink it or use the additional capacity.
Are you sure you want to add 1 images to raid5 LV HDD/raidtest? [y/n]: maybe
[... this takes a while ...]
  Logical volume HDD/raidtest successfully converted.

참고 사항: 경고 메시지는 다음과 같아야 합니다.명확하게 설명하세요장치는자라다, 축소되지 않습니다.

또한 확장에 어떤 PV를 사용할지 명시하지 않았기 때문에 LVM이 자체적으로 선택했습니다. 귀하의 경우 이는 선택 사항이며 작동해야 합니다(다른 적격 PV가 없기 때문에). 놀라지 않도록 자유롭게 지정하십시오.

결과:

# lvs -o +devices HDD/raidtest
  LV       VG  Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert Devices                                                                            
  raidtest HDD rwi-a-r--- 384.00m                                    100.00           raidtest_rimage_0(0),raidtest_rimage_1(0),raidtest_rimage_2(0),raidtest_rimage_3(0)

이 경우 파일 시스템은 커지지 않으며 이 작업을 단독으로 수행하거나 lvresizeLV를 이전 상태로 축소(이제는 더 많은 드라이브에 배포)할 수 있습니다. 당신처럼 전체 디스크를 단일 디스크에 할당하는 것보다 여러 RAID LV를 나란히 사용할 때 이것이 유용할 것이라고 생각합니다.

관련 정보