Choosing your hardware, and what is a device?

From Linux Raid Wiki
(Difference between revisions)
Jump to: navigation, search
(Initial page creation)
 
m (What is a device?)
Line 8: Line 8:
  
 
(In contrast to block devices, linux also has character devices, which just read or write a continuous stream of characters. Not suitable for storage because you have to start at the beginning and end at the end, so you would have to rewrite everything every time you wanted to change just a little bit - like an old-fashioned tape drive, for example).
 
(In contrast to block devices, linux also has character devices, which just read or write a continuous stream of characters. Not suitable for storage because you have to start at the beginning and end at the end, so you would have to rewrite everything every time you wanted to change just a little bit - like an old-fashioned tape drive, for example).
 +
 +
When creating your arrays, make sure you have it clear in your mind (and well documented for your successor, who is quite likely to be you six months down the line!) what devices fit where in the hierarchy.
  
 
=== USB devices ===
 
=== USB devices ===

Revision as of 23:31, 3 October 2016

Contents

What is a device?

As far as linux is concerned, all storage is a "block device". This means that data is written in chunks, typically 4KB in size, and that these chunks may be written to random locations on the device. Block devices are often layered, which means that one device writes to another, which may then write to a third, and so on. One typically thinks of a device as a hard disk, but as far as linux is concerned that is just one of many.

A typical raid system will have several hard drives as the bottom layer. These will then be partitioned (another block device) and the partitions will be combined into a raid array (yet another block device). The array will then have lvm over that (yet another block device) before this is partitioned (yet another device layer).

From this it can be seen that linux doesn't particularly what devices you use to make up an array - you can combine arrays, you can use a network storage device, you can use SSDs, SATA or PATA disks, USB, whatever. However, certain choices may or may not be wise.

(In contrast to block devices, linux also has character devices, which just read or write a continuous stream of characters. Not suitable for storage because you have to start at the beginning and end at the end, so you would have to rewrite everything every time you wanted to change just a little bit - like an old-fashioned tape drive, for example).

When creating your arrays, make sure you have it clear in your mind (and well documented for your successor, who is quite likely to be you six months down the line!) what devices fit where in the hierarchy.

USB devices

Do NOT use these as part of your array. They have a timeout/disconnect mechanism which interacts very badly with the raid code. An array which includes USB is likely to fall over in a heap. USB is okay in a recovery scenario when you are copying from a drive as the disconnect scenario won't apply. Always copy from USB to SATA, as writing to USB is usually much slower than reading.

Solid State Disks

These are very fast disks, and if you build an array from them, you are best off using raid-1 (mirror). This is a scenario where using the other forms of redundant raid (ie 5 or 6) is actually likely to slow access down!

A new facility (2016) of raid is to use an SSD as a journal. [TODO: Improve my understanding of journalling] This flushes writes to the SSD, partly to speed the system up for the user, and partly to optimise writes to slower rotating media, as it allows changes to accumulate in the journal until a full stripe can be flushed to rotating media in one go.

Serial ATA drives

All modern drives are serial ATA. Not all drives are suitable for RAID, though (at least in their default state). When buying disk drives, make sure they support SCT/ERC, otherwise known as TLER. Most drives of 1TB or less are okay, manufacturers seem to have removed this support from their cheaper drives as capacities went over 1TB.

Other devices

Other devices such as network storage will be added when I or other contributors gain experience of them. Obsolete devices such as parallel ATA will only be mentioned in passing - note that it is not wise to put more than one PATA drive per cable/controller.

Choosing drives that support SCT/ERC

Personal tools