2

I had a 2 disk RAID 1 partition. I added a device and converted it to RAID 5:

mdadm --add /dev/md3 /dev/sdd2
mdadm --grow /dev/md3 --level=5 --raid-devices=3

Then added another device and converted to RAID 6:

mdadm --add /dev/md3 /dev/sde2
mdadm --grow /dev/md3 --level=6 --raid-devices=4

When completed, the capacity is exactly the same as before I started. What do I need to do to get the additional space? The original RAID1 device capacity was 9.1GB on each of the two mirror devices. Converting to RAID5 or 6 with 4 devices of 9.1GB, I expected the capacity to go to 18GB, but it still only shows 9.1GB. I am not running LVM.

%> df -h /dev/md3
Filesystem      Size  Used Avail Use% Mounted on
/dev/md3        9.1G   24M  8.6G   1% /tmp

%> cat /proc/mdstat
md3 : active raid6 sdd2[2] sde2[3] sdb3[0] sdc3[1]
      19528704 blocks super 1.2 level 6, 4k chunk, algorithm 2 [4/4] [UUUU]
      bitmap: 1/1 pages [4KB], 65536KB chunk

%> mdadm --version
mdadm - v3.3 - 3rd September 2013

%> sudo fdisk -l /dev/sdb3 /dev/sdc3 /dev/sdd2 /dev/sde2
Disk /dev/sdb3: 9.3 GiB, 9999220736 bytes, 19529728 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/sdc3: 9.3 GiB, 9999220736 bytes, 19529728 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/sdd2: 9.3 GiB, 9999221248 bytes, 19529729 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/sde2: 9.3 GiB, 9999221248 bytes, 19529729 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
  • Can you clarify where you see a problem? – Julie Pelletier Jan 25 '17 at 0:18
  • @user9999999 The mdadm man page mentions --size= option for grow. Perhaps this is what is needed? – Timothy Martin Jan 25 '17 at 0:28
  • @TimothyMartin I tried the command "mdadm --grow --size max /dev/md3" but it said "mdadm: component size of /dev/md3 unchanged at 9764352K". Rebooting did not help either. – simpleuser Jan 25 '17 at 2:45
  • @JuliePelletier I added information. I expected that going from 2 device RAID1 to 4 device RAID6 I would see /dev/md3 capacity increase from 9.1GB to 18GB – simpleuser Jan 25 '17 at 2:46
  • What is your kernel version? – Timothy Martin Jan 25 '17 at 3:20
3

All the operations you did were to change the RAID partition structure, but none of those actually resize the filesystem written on it.

This means that the filesystem is not aware of the changes you did and if you ask it about its size, it will give you the size it was created.

To correct that, you can run resize2fs /dev/md3.

  • that did it. I did not see this step mentioned in any of the "how to go from RAID1 to RAID5" articles I read, so thank you VERY much! – simpleuser Jan 25 '17 at 3:27
  • My pleasure! :) – Julie Pelletier Jan 25 '17 at 3:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.