[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Buster: problem changing partition size on a RAID 5 array



I just added another drive to my RAID 5 array, so it now has 6. Unfortunately I can't seem to use the extra space. After the array finished reshaping, I tried to grow the file system but resize2fs complained that the file system was already the maximum size. Running gdisk revealed the following:

Disk /dev/md1: 39068861440 sectors, 18.2 TiB
Logical sector size: 512 bytes
Disk identifier (GUID): EFF29D11-D982-4933-9B57-B836591DEF02
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 31255089118
Partitions will be aligned on 2048-sector boundaries
Total free space is 2014 sectors (1007.0 KiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048     31255089118   14.6 TiB    8300  Linux filesystem


As you can see, there is a discrepancy between the device size (18.2T) and the partition size (14.6T).

cat /proc/mdstat confirms that the device has all the drives running:

md1 : active raid5 sdb1[0] sdh1[6] sdc1[5] sdl1[3] sdm1[2] sdk1[1]
19534430720 blocks super 1.2 level 5, 512k chunk, algorithm 2 [6/6] [UUUUUU]
      bitmap: 0/30 pages [0KB], 65536KB chunk


Neither fdisk nor gdisk let me create a partition larger than the existing one. Nor do they let me create a new partition anywhere except in the first 2047 sectors.

I tried commenting out the mount lines in /etc/fstab and rebooting to rescue mode but that didn't help.

I finally tried gparted and it immediately noticed the problem and offered to fix it. It "found" the free space at the end of the device and I was able to resize the existing partition to fill it. I'm now using the full array size!

I'm not sure what the problem is that gparted was able to see but fdisk and gdisk couldn't and whether this is a bug in mdadm or something else, but I thought I should report it somewhere.


Reply to: