Skip to contentSkip to conversation

not able to resize/grow RAID-1 (beyond 1 TB?)

DISCUSSION Tomasz Chmielewski 1 participant 2 messages Jan 13, 2012 – Jan 14, 2012 1 message not in the archive MD RAID

lore
Share & tools
lore
#0 lore raw

Hi,

I have mdadm RAID-1 array which is 1 TB big.

I would like to increase it to ~3 TB, since this is what the new partition size is - however, mdadm doesn't want to do it and stays with the old size.

Here, mdadm -D output showing the array is 1024 GB:

# mdadm -D /dev/md2
/dev/md2:
        Version : 1.2
  Creation Time : Fri Jan 13 07:02:29 2012
     Raid Level : raid1
     Array Size : 1073740800 (1024.00 GiB 1099.51 GB)
  Used Dev Size : 1073740800 (1024.00 GiB 1099.51 GB)
   Raid Devices : 2
  Total Devices : 2
    Persistence : Superblock is persistent

Update Time : Fri Jan 13 21:25:09 2012
State : clean
Active Devices : 2
Working Devices : 2
Failed Devices : 0
Spare Devices : 0

Name : rescue:2
UUID : 9fc28b3f:7b91d523:8aa20629:5f5bd029
Events : 6699

Number Major Minor RaidDevice State
0 8 3 0 active sync /dev/sda3
1 8 19 1 active sync /dev/sdb3

Here, we can see the partitions used by /dev/md2 are ~3 TB big:

# parted /dev/sda
GNU Parted 2.3
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) p
Model: ATA ST3000DM001-9YN1 (scsi)
Disk /dev/sda: 3001GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Number  Start   End     Size    File system  Name  Flags
 5      1049kB  2097kB  1049kB                     bios_grub
 1      2097kB  34.4GB  34.4GB                     raid
 2      34.4GB  34.9GB  537MB                      raid
 3      34.9GB  3001GB  2966GB                     raid

(parted) q

# parted /dev/sdb
GNU Parted 2.3
Using /dev/sdb
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) p
Model: ATA ST3000DM001-9YN1 (scsi)
Disk /dev/sdb: 3001GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Number  Start   End     Size    File system  Name  Flags
 5      1049kB  2097kB  1049kB                     bios_grub
 1      2097kB  34.4GB  34.4GB                     raid
 2      34.4GB  34.9GB  537MB                      raid
 3      34.9GB  3001GB  2966GB                     raid

(parted) q

Now, let's try to grow - it stays unchanged at 1024 GB:

# mdadm --grow /dev/md2 --size=max
mdadm: component size of /dev/md2 has been set to 1073740800K

What am I doing wrong here?

Signature · 2 lines
Tomasz Chmielewski
http://wpkg.org
#2 lore raw
In reply to a message not in the archive
Quoted 8 lines · On 01/14/2012 09:26 PM, Stefan /*St0fF*/ Hübner wrote:

Hi Tomasz,

at first: if you had 1TB drives before, dd'ed them to the new 3TB drives and changed the partitioning scheme accordingly - that all looks OK. The weird thing here is that 1TB disks never had 1024GiB, but 931GiB. So the reshape has already happened to "the system's maximum".

I do suspect you have a 32bit system and mdadm is not the latest version?

No, the system was 64 bit from the very beginning; mdadm may not be the latest one, but is far from being obsoletes, too (Debian Squeeze).

The issue is actually solved now.

What I had to do was:

mdadm /dev/md2 -f /dev/sdb3
mdadm /dev/md2 -r /dev/sdb3

# not necessarily 10 MB needs cleaning, but it's a small number...
dd if=/dev/zero of=/dev/sdb3 bs=1M count=10
mdadm /dev/md2 -a /dev/sdb3
# wait till it syncs, and do the same for /dev/sda3
reboot

If I did the same without dd if=/dev/zero, it somehow didn't want to work and /dev/md2 was still only 1 TB big. Unless I've messed up somewhere!

Signature · 8 lines
Tomasz Chmielewski
http://wpkg.org


--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html