Klennet Storage Software

Analysing a simple RAID5

In this example, I am looking at a 4-disk RAID5 to illustrate basic analysis steps. The task is quite simple:

  • RAID level is known, RAID5;
  • number of disks is known, four disks;
  • block size and start offset are not known;
  • disk order is not known.

Finding block size and starting sector

This is pretty straightforward. You may want to look at the previous episode of RAID series if you need detailed explanations.

RAID5 default sector size view

Default sector size view for a RAID5 sample

Default view is a bit cluttered, albeit showing a good signal-to-noise ratio. First of all, drop Window size down several notches to reduce clutter.

Same chart at a smaller window size

Same chart at a smaller window size

With a smaller window size, the RAID block boundaries are clearly visible. Next step is to work Starting sector and Block size to match computed block boundaries (red lines) to the actual block boundaries (highest blue lines).

Correct start sector and block size settings

Correct start sector and block size settings

As block size and starting sector are set, switch to the block map view.

Default block map view

Default block map view

Initial block map is horrible, with pointers all over the place. First thing to do is to enable parity display. The default setting is for a RAID0 with no parity. RAID5 uses a single parity per disk (RAID6 uses two parities). Switch Parity mode to One parity and the picture becomes even more confusing.

Block map view with parity highlight enabled

Block map view with parity highlight enabled

Once parity display is enabled, most likely parity blocks are shown in dark gray. Also, arrows going to and from these blocks are hidden, because parity blocks are not involved in arrangement of the data. However, parity blocks themselves are arranged diagonally, most often from right-top to bottom-left (the diagonal is highlighted as the dotted line). So, the first step is to arrange the parity blocks along the diagonal. In this example, swap two disks in the middle by using arrow buttons at the top.

Final RAID5 block map

Final RAID5 block map

When this is done, the blocks are properly arranged. You can confirm that by following the data ordering arrows. This layout is "left-symmetric", used in most of the hardware RAID controllers and also typical for most Linux md-raid deployments. The theoretical block map for a 4-disk left-symmetric RAID is shown below

Disk 1 Disk 2 Disk 3 Disk 4
1 2 3 P
5 6 P 4
9 P 7 8
P 10 11 12

Note that in symmetric layout, data blocks start after the parity, rather than at the first disk in every row.

Created Tuesday, November 13, 2018

I have a low volume mailing list, for news and tips, which I send out once or twice a month.
Subscribe if you are interested.