Linear (Append) Mode

Linear mode requires a minimum of two disks, but does not require that member disks be the same size or type. Since the system writes to each disk until it is full, the speed and size of individual disks is largely irrelevant, in terms of aggregate RAID performance.

The following is a very simple linear array using /etc/raidtab:

# A linear array with two member disks

raiddev                   /dev/md0
 raid-level               linear
 chunk-size               64
 persistent-superblock    1
 nr-raid-disks            2

 device                   /dev/sdb1
 raid-disk                0

 device                   /dev/sdc1
 raid-disk                1

raiddev begins the definition of a new array, /dev/md0 in this case. All entries that follow apply to the previously defined array, until another raiddev entry is parsed. raid-level, as the name implies, sets the array type for the current array.

As I mentioned earlier, chunk-size would normally define the number of kilobytes to write to each member disk for arrays that support disk striping. However, when working with linear mode arrays, the chunk-size defines the rounding factor. Each component disk is sized so that it is a multiple of the rounding factor. Because of the way the RAID superblock is placed on each array member, rounding factors of less than 64 KB are effectively equal to 64 KB.

The chunk-size, regardless of what type of array is used, must be defined as any power of two. In fact, for the rest of this chapter, we’ll create arrays with a 64 KB chunk-size. You might notice some errors in the system boot messages and your log files, which warn ...

Get Managing RAID on Linux now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.