Linux: Possible to mount 2 RAID-1 arrays as one folder?

Associate
Joined
19 Jun 2003
Posts
1,680
Location
West Yorks, UK
Hi all,
I have a Ubuntu 6.06 LTS server that has a pair of 300GB SATA drives in it. They are attached into the motherboard sockets, then i used mdadm in Ubuntu to make a RAID-1 array.

The time has come to add some more storage space, so i've bought a pair of 500GB SATA's. I want to use mdadm on these disks to create another RAID-1, then mount it under /home/users.

Is it possible to mount multiple disks under the same mount point, so that you could have an ever expanding folder (e.g. the files are distributed across the various disks that have been mounted there) so i could mount the original 300GB array under /home/users too, or am I talking nonsense?

Cheers,
Matt
 
Of the top of my head you could do this if you are using LVM, (there may be limitations so i would read up a bit and run lots of backups before trying).

If you have two raid devices, we'll call them md0 and md1, then you create a volume group, e.g. vgusers, and add them to it. This acts as a pool of diskspace which can be carved up into logical volumes. Each of these logical volumes holds a single filesystem which can be mounted as required. Hence you could have a 400GB filesystem which was all of your 300GB mirror and then 100GB of your 500GB mirror.

You may be able then to expand this filesystem in the future, (I've done it on commercial Unix flavours but haven't tried it on Linux), by just growing into the remaining space in the volume group.

Note that if you have anything on md0 currently, i.e. a single filesystem, it would be destroyed when the raid "disk" is added to the volume group so will need to be backed up first and the backup checked to make sure it is valid. :eek: :eek:

For more reading see http://www.gentoo.org/doc/en/articles/lvm-p1.xml and Part 2 which covers creating LVM structures on the command line, (although distributions like SUSE can do it through their partitioning GUI).
 
Thanks for the replies chaps. It seems like the best option then, would be to create the new 500GB RAID-1 array as part of a LVM group, then when setup, copy the data from the 300GB array into it. This would free up the 300GB disks so they could be added into the LVM without worrying about loosing data. Does that make sense?

Matt
 
feenster99 said:
Thanks for the replies chaps. It seems like the best option then, would be to create the new 500GB RAID-1 array as part of a LVM group, then when setup, copy the data from the 300GB array into it. This would free up the 300GB disks so they could be added into the LVM without worrying about loosing data. Does that make sense?

Matt


Sounds good to me :)
 
Back
Top Bottom