-   Linux - Software (
-   -   Can't resize ext4 partition after mdadm Raid5 grow to 4 disk (

jhon614 11-02-2012 09:39 PM

Can't resize ext4 partition after mdadm Raid5 grow to 4 disk
I started by creating 2 mdadm arrays on 3 3TB drives by using Disk Utility in Ubuntu 10.04. One array was a 300GB Raid1 (on all 3 drives) and the other array was a 2.7TB Raid5 array on the remaining space on the 3 drives.

I started to run out of space on my Raid5 array, so I decided to grow it. I believe the grow was successful, but I'm not totally sure. After the grow, everything seemed ok. All the data was intact, so I tried to run resize2fs to get the extra space added.


johnny@Ubuntu-Raid:~$ sudo resize2fs /dev/md1
resize2fs 1.41.11 (14-Mar-2010)
resize2fs: Device or resource busy while trying to open /dev/md1
Couldn't find valid filesystem superblock.

I wasn't sure what to make of that, and I noticed there was a device named /dev/md1p1 in disk utility. It appears to be the partition or volume that lives on /dev/md1. So I tried:


johnny@Ubuntu-Raid:~$ sudo resize2fs /dev/md1p1
resize2fs 1.41.11 (14-Mar-2010)
The filesystem is already 1318359287 blocks long.  Nothing to do!

That didn't tell me much. So I poked around for info. Notice the "Array Size" and the "Used Dev Size" (below). The array size is the size that should be usable after the grow. The used dev size is the size I'm stuck with because I can't get resize2fs to work.


johnny@Ubuntu-Raid:~$ sudo mdadm --detail /dev/md1
        Version : 01.02
  Creation Time : Fri Sep 14 23:33:37 2012
    Raid Level : raid5
    Array Size : 7910155776 (7543.71 GiB 8100.00 GB)
  Used Dev Size : 5273437184 (5029.14 GiB 5400.00 GB)
  Raid Devices : 4
  Total Devices : 4
Preferred Minor : 1
    Persistence : Superblock is persistent

  Intent Bitmap : Internal

    Update Time : Fri Nov  2 22:01:02 2012
          State : active
 Active Devices : 4
Working Devices : 4
 Failed Devices : 0
  Spare Devices : 0

        Layout : left-symmetric
    Chunk Size : 32K

          Name : :BigRaid
          UUID : 016d5cbd:2523644b:0a82b342:f5ba3fc3
        Events : 116798

    Number  Major  Minor  RaidDevice State
      0      8      82        0      active sync  /dev/sdf2
      1      8      50        1      active sync  /dev/sdd2
      3      8      18        2      active sync  /dev/sdb2
      4      8      34        3      active sync  /dev/sdc2

What is going on here? What's the difference between md1 and md1p1? Is the superblock causing the resize2fs problem? What should I do? Please explain thoroughly. I'm a newbie.

All times are GMT -5. The time now is 10:21 AM.