I am about to reinitialise my (SW) raid array.
Previously the array was raid5 with 4 disks. I've removed one disk in order to install a new additional (larger) drive.
What I'd ideally like to do is mix types of raid across the 3 disks.
Having 1 section of 3 way mirrored raid1, a section of raid5 and a section of raid0 offering various levels of protection for my more and less important files, while wasting as little space as possible.
I can do this by creating 3 separate raid partitions on each disk and assembling 3 arrays from this, but this has a number of downsides:
- The size of each section would be fixed from the outset and changing this would be rather tricky
- I would be limiting my directory layout options and probably end up resorting to symlinks to retain a logical layout
What I would really like is a single filesystem, where I can set a property on individual files/directories, indicating the level of protection required for those files, resulting in the file being mirrored as appropriate.
Is there any way to achieve this on SUSE, perhaps with an esoteric filesystem format?
Best Answer
One possible solution is to use LVM to manage redundancy, instead of using the
mdadm
Linux software RAID.Simply initialize all three disks as LVM physical volumes, assign them to the same volume group and use the correct flags when setting up logical volumes.
So for example the commandline
lvcreate -m1 -L 10G -n <name> <volume_group>
would create a mirrored logical volume or the equivalent of a RAID1 array.Since you have three disks 2 would be the maximum number of stripes (the third is for parity) and
lvcreate --type raid5 -i2 -L 20G -n <name> <volume_group>
would set up the equivalent of three disk RAID5 array.