Gentoo Archives: gentoo-user

From: Julien Roy <julien@××××.ca>
To: Gentoo User <gentoo-user@l.g.o>
Subject: Re: [gentoo-user] Unable to expand ext4 partition
Date: Sat, 05 Feb 2022 19:38:03
Message-Id: MvAIQ3L--3-2@jroy.ca
In Reply to: Re: [gentoo-user] Unable to expand ext4 partition by Wol
1 I'm running ext4 over the logical volume over hardware
2
3 The steps I used to grow the logical volume are as follows:
4 1- I created a physical volume on the disk using pvcreate /dev/sda (the new disk became sda and the other ones offset to sd[bcd])
5 doas pvs -a
6   PV             VG       Fmt  Attr PSize   PFree
7   /dev/sda       vgraid   lvm2 a--   <5.46t    0
8   /dev/sdb       vgraid   lvm2 a--   <5.46t    0
9   /dev/sdc       vgraid   lvm2 a--   <5.46t    0
10   /dev/sdd       vgraid   lvm2 a--   <5.46t    0
11 2- I added the PV to the volume group using vgextend vgraid /dev/sda
12 doas vgs -a
13   VG       #PV #LV #SN Attr   VSize   VFree
14   vgraid     4   1   0 wz--n-  21.83t    0
15
16 3- I used the lvconvert command to add the PV to the LV lvconvert --stripes 3 /dev/vgraid/lvraid
17  doas lvs -a
18   lvraid                       vgraid   rwi-aor---  16.37t      100.00         
19   [lvraid_rimage_0]            vgraid   iwi-aor---  <5.46t
20   [lvraid_rimage_1]            vgraid   iwi-aor---  <5.46t
21   [lvraid_rimage_2]            vgraid   iwi-aor---  <5.46t
22   [lvraid_rimage_3]            vgraid   Iwi-aor---  <5.46t
23   [lvraid_rmeta_0]             vgraid   ewi-aor---   4.00m
24   [lvraid_rmeta_1]             vgraid   ewi-aor---   4.00m
25   [lvraid_rmeta_2]             vgraid   ewi-aor---   4.00m
26   [lvraid_rmeta_3]             vgraid   ewi-aor---   4.00m       
27
28 Now, if I remember this right, I ran the lvchange --syncaction check /dev/vgraid/lvraid
29 command, waited for almost a day for the sync to complete, then lvchange --rebuild /dev/sda /dev/vgraid/lvraid command.
30
31 One strange thing I noticed is that the `blkid` command doesn't show my LV anymore, and I cannot mount it from fstab using the UUID. I can mount it using the device name, however (mount /dev/vgraid/lvraid /mnt/raid), and that works.
32
33 At this point, I am considering transfering all my data to another volume, and re-creating the RAID using mdadm.
34
35 Here's some more info on my VG and LV :
36 doas vgdisplay /dev/vgraid
37   --- Volume group ---
38   VG Name               vgraid
39   System ID            
40   Format                lvm2
41   Metadata Areas        4
42   Metadata Sequence No  7
43   VG Access             read/write
44   VG Status             resizable
45   MAX LV                0
46   Cur LV                1
47   Open LV               1
48   Max PV                0
49   Cur PV                4
50   Act PV                4
51   VG Size               21.83 TiB
52   PE Size               4.00 MiB
53   Total PE              5723164
54   Alloc PE / Size       5723164 / 21.83 TiB
55   Free  PE / Size       0 / 0  
56   VG UUID               y8U06D-V0ZF-90MK-dhS6-szZf-7qzx-yErLF2
57
58 doas lvdisplay /dev/vgraid/lvraid
59   --- Logical volume ---
60   LV Path                /dev/vgraid/lvraid
61   LV Name                lvraid
62   VG Name                vgraid
63   LV UUID                73wJt0-E6Ni-rujY-9tRm-QsoF-8FPy-3c10Rg
64   LV Write Access        read/write
65   LV Creation host, time gentoo, 2021-12-02 10:12:48 -0500
66   LV Status              available
67   # open                 1
68   LV Size                16.37 TiB
69   Current LE             4292370
70   Segments               1
71   Allocation             inherit
72   Read ahead sectors     auto
73   - currently set to     1024
74   Block device           253:8
75
76 Julien
77
78
79
80 Feb 5, 2022, 14:09 by antlists@××××××××××××.uk:
81
82 > On 05/02/2022 17:43, Julien Roy wrote:
83 >
84 >> Hello,
85 >>
86 >> I've been running an LVM RAID 5 on my home lab for a while, and recently it's been getting awfully close to 100% full, so I decided to buy a new drive to add to it, however, growing an LVM RAID is more complicated than I thought! I found very few documentation on how to do this, and settled on following some user's notes on the Arch Wiki [0]. I should've used mdadm !...
87 >> My RAID 5 consisted of 3x6TB drives giving me a total of 12TB of usable space. I am trying to grow it to 18TB now (4x6TB -1 for parity).
88 >> I seem to have done everything in order since I can see all 4 drives are used when I run the vgdisplay command, and lvdisplay tells me that there is 16.37TB of usable space in the logical volume.
89 >> In fact, running fdisk -l on the lv confirms this as well :
90 >> Disk /dev/vgraid/lvraid: 16.37 TiB
91 >>
92 >
93 > If you'd been running mdadm I'd have been able to help ... my setup is ext4 over lvm over md-raid over dm-integrity over hardware...
94 >
95 > But you've made no mention of lvgrow or whatever it's called. Not using lv-raid, I don't know whether you put ext straight on top of the raid, or do you need to grow the lv volume after you've grown the raid? I know I'd have to grow the volume.
96 >
97 > Cheers,
98 > Wol
99 >

Replies

Subject Author
Re: [gentoo-user] Unable to expand ext4 partition Wols Lists <antlists@××××××××××××.uk>