1

I added two new devices two my software RAID 1 system. They are recognized by mdadm but I can't use the addition space.

Here is how I proceed:

  1. I added the two new disk to my PC and created on each an ext4 partition
  2. I added the partitions as hotspare to the RAID 1
    mdadm /dev/md0 --add /dev/sdX1 mdadm /dev/md0 --add /dev/sdY1 
  3. then I grow the raid with backup file
    mdadm --grow --raid-devices=4 /dev/md0 --backup-file=/tmp/md0.bak
  4. and try to extend the disk after a disk check
    fsck.ext4 -f /dev/md0 resize2fs /dev/md0 
    resize2fs returns:

    The filesystem is already * blocks long. Nothing to do!

What went wrong here?


Here some more system details:

uname -a Linux server 3.8.0-44-generic #66~precise1-Ubuntu SMP Tue Jul 15 04:01:04 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux mdadm --detail /dev/md0 /dev/md0: Version : 1.2 Creation Time : Wed Oct 16 11:50:14 2013 Raid Level : raid1 Array Size : 2930134016 (2794.39 GiB 3000.46 GB) Used Dev Size : 2930134016 (2794.39 GiB 3000.46 GB) Raid Devices : 4 Total Devices : 4 Persistence : Superblock is persistent Update Time : Tue May 12 17:55:36 2015 State : clean Active Devices : 4 Working Devices : 4 Failed Devices : 0 Spare Devices : 0 Name : server:md0 UUID : 4993aaa0:cc999f7a:c3f6e0fb:1a23bbb7 Events : 755 Number Major Minor RaidDevice State 0 8 65 0 active sync /dev/sde1 1 8 81 1 active sync /dev/sdf1 3 8 17 2 active sync /dev/sdX1 2 8 1 3 active sync /dev/sdY1 cat /etc/mdadm/mdadm.conf [...] ARRAY /dev/md/md0 level=raid1 num-devices=4 metadata=1.2 name=server:md0 UUID=4993aaa0:cc999f7a:c3f6e0fb:1a23bbb7 devices=/dev/sde1,/dev/sdf1,/dev/sdX1,/dev/sdY1 
1
  • Reading more about RAID1, it looks like I have now 4 times mirrored the same informations. Is there not a way to extend the RAID1? Commented May 13, 2015 at 13:37

1 Answer 1

4

RAID1 doesn't work that way. When you added those two new partitions to your array, you added two more copies of the data. You added redundancy, not capacity.

At this point you ought to look into either RAID5, which will gain you disk capacity x (number of disks - 1), or something like RAIDZ or btrfs.

3
  • "You added redundancy, not capacity." Thats what I learned now! Commented May 13, 2015 at 15:48
  • Do you still want to add capacity? Commented May 13, 2015 at 16:38
  • Yes I want to add capacity! My plan is to remove 3 of the drives from the array and use them to build a RAID5. Then copy all the data and add the fourth drive... Commented May 14, 2015 at 11:40

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.