Gentoo Archives: gentoo-user

From: Florian Philipp <lists@×××××××××××.net>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] mdadm and raid4
Date: Wed, 04 May 2011 12:47:22
Message-Id: 4DC14A83.4060706@binarywings.net
In Reply to: Re: [gentoo-user] mdadm and raid4 by Florian Philipp
1 Am 04.05.2011 14:39, schrieb Florian Philipp:
2 > Am 04.05.2011 11:08, schrieb Evgeny Bushkov:
3 >> On 04.05.2011 11:54, Joost Roeleveld wrote:
4 >>> On Wednesday 04 May 2011 10:07:58 Evgeny Bushkov wrote:
5 >>>> On 04.05.2011 01:49, Florian Philipp wrote:
6 >>>>> Am 03.05.2011 19:54, schrieb Evgeny Bushkov:
7 >>>>>> Hi.
8 >>>>>> How can I find out which is the parity disk in a RAID-4 soft array? I
9 >>>>>> couldn't find that in the mdadm manual. I know that RAID-4 features a
10 >>>>>> dedicated parity disk that is usually the bottleneck of the array, so
11 >>>>>> that disk must be as fast as possible. It seems useful to employ a few
12 >>>>>> slow disks with a relatively fast disk in such a RAID-4 array.
13 >>>>>>
14 >>>>>> Best regards,
15 >>>>>> Bushkov E.
16 >>>>> You are seriously considering a RAID4? You know, there is a reason why
17 >>>>> it was superseded by RAID5. Given the way RAID4 operates, a first guess
18 >>>>> for finding the parity disk in a running array would be the one with the
19 >>>>> worst SMART data. It is the parity disk that dies the soonest.
20 >>>>>
21 >>>>> From looking at the source code it seems like the last specified disk is
22 >>>>> parity. Disclaimer: I'm no kernel hacker and I have only inspected the
23 >>>>> code, not tried to understand the whole MD subsystem.
24 >>>>>
25 >>>>> Regards,
26 >>>>> Florian Philipp
27 >>>> Thank you for answering... The reason I consider RAID-4 is a few
28 >>>> sata/150 drives and a pair of sata II drives I've got. Let's look at
29 >>>> the problem from the other side: I can create RAID-0(from sata II
30 >>>> drives) and then add it to RAID-4 as the parity disk. It doesn't bother
31 >>>> me if any disk from the RAID-0 fails, that wouldn't disrupt my RAID-4
32 >>>> array. For example:
33 >>>>
34 >>>> mdadm --create /dev/md1 --level=4 -n 3 -c 128 /dev/sdb1 /dev/sdc1 missing
35 >>>> mdadm --create /dev/md2 --level=0 -n 2 -c 128 /dev/sda1 /dev/sdd1
36 >>>> mdadm /dev/md1 --add /dev/md2
37 >>>>
38 >>>> livecd ~ # cat /proc/mdstat
39 >>>> Personalities : [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]
40 >>>> md2 : active raid0 sdd1[1] sda1[0]
41 >>>> 20969472 blocks super 1.2 128k chunks
42 >>>>
43 >>>> md1 : active raid4 md2[3] sdc1[1] sdb1[0]
44 >>>> 20969216 blocks super 1.2 level 4, 128k chunk, algorithm 0 [3/2] [UU_]
45 >>>> [========>............] recovery = 43.7% (4590464/10484608) finish=1.4min
46 >>>> speed=69615K/sec
47 >>>>
48 >>>> That configuration works well, but I'm not sure if md1 is the parity
49 >>>> disk here, that's why I asked. May be I'm wrong and RAID-5 is the only
50 >>>> worth array, I'm just trying to consider all pros and cons here.
51 >>>>
52 >>>> Best regards,
53 >>>> Bushkov E.
54 >>> I only use RAID-0 (when I want performance and don't care about the data),
55 >>> RAID-1 (for data I can't afford to loose) and RAID-5 (data I would like to
56 >>> keep). I have never bothered with RAID-4.
57 >>>
58 > [...]
59 >>
60 >> I've run some tests with different chunk sizes, the fastest was
61 >> raid-10(4 disks), raid-5(3 disks) was closely after. Raid-4(4 disks) was
62 >> almost as fast as raid-5 so I don't see any sense to use it.
63 >>
64 >> Best regards,
65 >> Bushkov E.
66 >>
67 >>
68 >>
69 >
70 > When you have an array with uneven disk speeds, you might consider using
71 > the --write-mostly option of mdadm:
72 > -W, --write-mostly
73 > subsequent devices lists in a --build, --create, or --add command
74 > will be flagged as 'write-mostly'. This is valid for RAID1 only and
75 > means that the 'md' driver will avoid reading from these devices if at
76 > all possible. This can be useful if mirroring over a slow link.
77 >
78 > This should help in concurrent read and write operations because the
79 > kernel will not dispatch read requests to a disk that is already having
80 > trouble managing the write operations.
81 >
82 > On another point: Are you sure your disks have different speeds? SATA150
83 > and 300 are no reliable indicator because most HDDs cannot saturate the
84 > SATA port anyway. dd is still the most reliable way to measure
85 > sequential throughput.
86 >
87 > Regards,
88 > Florian Philipp
89 >
90
91 `man 4 md` also states that the "the last of the active devices in the
92 array" is the parity disk in a RAID4.
93
94 Regards,
95 Florian Philipp

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
Re: [gentoo-user] mdadm and raid4 Evgeny Bushkov <zhen@×××××××××.ru>