问题原文
原帖链接 · Ancool · CC BY-SA 4.0
I must say I already found a similar question on this platform, but the context was different, so I'm trying by myself.
My idea is as follows:
I have 4 disks, 3 of them are the same capacity, and the fourth one has twice the capacity of either of the others. I would use the 3 disks above in a RAID 5 configuration, and then use them together with the fourth in a RAID 1 configuration.\
Hypothetically, if the 3 disks are all 250GB, and the fourth is 500GB, I should get 500GB of usable storage with mirroring.
If it is a feasible idea, would it make sense to implement it or are there any cons? If there are any, what may be a possible way to use these disks in a RAID setup?
P.S.: As you might think, it is not my intention to use this setup as a backup system, I know RAID is NOT a backup solution! :)
已采纳解答
原帖链接 · shodanshok · CC BY-SA 4.0
With hardware RAIDs - no, you can't: nesting RAID levels is only supported in very specific cases (ie: RAID50 or 60).
If using Linux MD, which is extremely flexible, you can do it easily. Let see how I simulated it with loop device backed by (small) files:
# create loopbacks - for testing only, you are going to use real disks
root@localhost:~/raid# truncate --size=250M disk1.img
root@localhost:~/raid# truncate --size=250M disk2.img
root@localhost:~/raid# truncate --size=250M disk3.img
root@localhost:~/raid# truncate --size=500M disk4.img
root@localhost:~/raid# losetup -f /root/raid/disk1.img
root@localhost:~/raid# losetup -f /root/raid/disk2.img
root@localhost:~/raid# losetup -f /root/raid/disk3.img
root@localhost:~/raid# losetup -f /root/raid/disk4.img
root@localhost:~/raid# losetup -a | grep -v snaps
/dev/loop8: [64768]:132175 (/root/raid/disk4.img)
/dev/loop6: [64768]:132150 (/root/raid/disk2.img)
/dev/loop7: [64768]:132173 (/root/raid/disk3.img)
/dev/loop5: [64768]:132147 (/root/raid/disk1.img)
# create first RAID5 device
root@localhost:~/raid# mdadm --create md127 -l 5 -n 3 /dev/loop5 /dev/loop6 /dev/loop7
mdadm: Defaulting to version 1.2 metadata
mdadm: array /dev/md/md127 started.
root@localhost:~/raid# mdadm --create md126 -l 1 -n 2 /dev/md127 /dev/loop8
mdadm: Note: this array has metadata at the start and
may not be suitable as a boot device. If you plan to
store '/boot' on this device please ensure that
your boot-loader understands md/v1.x metadata, or use
--metadata=0.90
Continue creating array? y
mdadm: Defaulting to version 1.2 metadata
mdadm: array /dev/md/md126 started.
# show arrays
root@localhost:~/raid# cat /proc/mdstat
Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]
md126 : active raid1 loop8[1] md127[0] <--- this is the 2x ~500MB RAID1 one
506880 blocks super 1.2 [2/2] [UU]
md127 : active raid5 loop7[3] loop6[1] loop5[0] <--- this it the 3x ~250MB RAID5 one
507904 blocks super 1.2 level 5, 512k chunk, algorithm 2 [3/3] [UUU]
Please note that you end with "only" 500 GB usable space with this nested RAID5+1 arrays. I would strongly consider using RAID6 over 4x 250GB disks (the bigger disk can be used as smaller one without issues, apart the lost space), providing the same usable 500 GB with better reliability (and potentially another 250 GB of unprotected "scratch space" at the end of the bigger disk).
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
