Welcome to our practical miniguide of a server administration of operating system GNU/Linux!
We do not have ambitions to cover all the topics of management servers, however we would like to share some practical information, in which many new, and often more experienced administrators, are lost. We therefore chose several key chapters, where we think, deserve your attention and could help to make better management of your server and its security and stability.
Thank you for your interest in this manual and we look forward to your feedback and suggestions for its further expansion via social media.
Chapter 1: Helpful RAID
If you want to install and run Linux server, you should definitely deal with discs distribution and utilization. This is the moment when the RAID and LVM want a word.
First of all, what is RAID? A short definition would sound like this: RAID is a way to connect two or more hard drives so, that we are able to work with them as a single logical data unit. According to type of connection, we distinguish different types, which are used for various purposes. There are at least the most common:
The goal of RAID 0 is to achieve higher performance – speed writing and using of maximum capacity (combined discs capacity). The data is alternately written to all drives in the array, so the lack of redundancy and loss of a single disc drive results in damage or lost of all data.
Data is writing to all the drives in the array. The capacity is equal to the smallest used disc in the array. Reading is faster (reading from multiple discs at same moment), writing is slower (writing on multiple discs). The loss of a single disc does not mean a loss of data.
Three discs are minimum amount in this case. The data and parity (autocorrection codes) are recorded alternately on all drives in the array. Failure of one disc is no problem. The advantage is a possibility to use of parallel access to data, because a longer piece of data is spread across multiple discs, so reading is faster. The disadvatege of RAID 5 is slower writting due to the necessity of calculating autocorrecting code.
It is a combination of RAID 1 and RAID 0. In practice this means that the first is created RAID 1 and above that, RAID 0 is created, then. The advantage of this type is the optimum ratio between the speed and stability.
The choice of a particular model of connection always depends on the number of discs, as well as on the purpose of certain server and capabilities and knowledge of administrator. For small servers is the most common type of connection RAID 1, 5, or 10.
Servers that have two discs, it is appropriate to choose RAID 1. Servers with three discs is better to choose a RAID 5 or 10. If you have a server with a large number of hard drives, for example 10 or more, it is advisable to replace RAID 5 for RAID 6. RAID 6 differs from RAID 5 only by two available parity blocks, thus the field can carry damage n-2 drives (where n is the number of disks in the array).
It is also important to note that RAID is not a substitute for backups! Regular and careful data backup is a key step that any administrator should do at server. RAID is therefore only a protection against accidental loss of a hard disc, but not a substitute of external backup.
A useful tip for some situation can be inclusion of so called spare discs. These are hard drives that are included in the box, but not used. They are activated only in the moment when one of actively used discs is damage. The advantage of this solution is, shorten the reaction time and faster replacement of damaged disc.
It is obvious, that you should monitor the status of the RAID. In the operating system GNU/Linux tool mdadm is used to monitor software RAID. That knows how to manage a set field, but it can run in the background as a demon, which in problems case sends an e-mail about the incident.
To get basic information about the field you can use the command:
# mdadm -D /dev/md1
Author: Jirka Dvořák