Disk quotas and raid configuration management

Disk quotas and raid configuration management

Disk structure

<Img src = "E: \ blog text \ disk quotas and raid configuration \ 1572923009298.png" alt = "1572923009298" style = "zoom: 67%;" />

MBR and partition representation

Master Boot Record (MBR: Master Boot Record)

MBR located on the hard first physical sector of the hard disk contained in the MBR master boot program and partition table

Partition table recording area of ​​four partitions, each partition representing recording region 16 bytes

Linux in the hard disk, partition and other equipment are represented as files

Disk partition structure

The number of primary partitions in the hard disk only 4, so the primary and extended partitions also limits the number 1-4

Extended partition divided into logical partitions of logical partitions numbers will always start from 5

Detect and confirm the new hard disk -fdisk

View or manage disk partitions fdisk-l

Common commands in interactive mode

m p help create a new print display new partition n d t delete partition format conversion w q exit simple operation to save the configuration in FIG.

<img src="http://itmc.oss-cn-hangzhou.aliyuncs.com/blog/20191105/114540334.png" alt="mark" style="zoom:75%;" />

<img src="http://itmc.oss-cn-hangzhou.aliyuncs.com/blog/20191105/114611983.png" alt="mark" style="zoom:67%;" />

<img src="http://itmc.oss-cn-hangzhou.aliyuncs.com/blog/20191105/114643663.png" alt="mark" style="zoom:75%;" />

Formatting mkfs

mkfs -t type file system partition device

Create a swap file

mkswap partition device

Mount -mount unmount the file system -umount

-t type] [mount storage devices mount point

The basic concept of LVM mechanism

PV (physical volume) VG of (volume group) the LV (logical volume)

The main command

<img src="http://itmc.oss-cn-hangzhou.aliyuncs.com/blog/20191105/115601753.png" alt="mark" style="zoom:75%;" />

Disk quotas overview

Conditions for disk quotas: the need to install Linux kernel support and quota package xfsprogs

Features Linux disk quota

Range: for a specified file system (partition)

Limit Object: user accounts, group accounts

Limit Type: disk capacity, the number of files

Restriction method: soft limit, the hard limit (Soft Limit <= hard limit)

Most of the commands are temporarily take effect, restart the aging profile settings are permanent

Edit user and group accounts quota set -xfs_quota

-u user -g group -x expert mode -c command

Capacity soft: bsoft
capacity hard: bhard
soft Quantity: isoft
hard number: ihard

RAID disk array introduction

<img src="http://itmc.oss-cn-hangzhou.aliyuncs.com/blog/20191105/121039449.png" alt="mark" style="zoom:75%;" />

The plurality of disks combined into one large disk, without redundancy, parallel the I / O , the fastest. Also known as RAID 0 stripe set. It is tied up multiple disks, became a large disk. When storing data, which according to the number of disk data to be segmented, and while the data written into the disk, so in all levels, RAID 0 is the fastest speed. But there is no redundancy RAID 0 , if a disk (physical) damage, all data will be lost, and JBOD considerable degree of risk .

The more theoretically disk performance equivalent to "Single Disk Performance" × "number of disks", but in fact limited by the bus affect I / O bottlenecks and other factors, RAID performance will decrease with marginal, that is to say, assuming a disk the performance is 50MB per second, a two-disk RAID 0 performance of about 96MB per second, three disk RAID 0 is perhaps 130MB per second instead of 150MB per second, a two-disk RAID 0 performance of the most obvious sense upgrade.

However, if the software is the way to implement RAID, the disk space is not necessarily so limited (eg Linux Software RAID), can make good use of all the disk space via different combinations achieved by software.

<img src="http://itmc.oss-cn-hangzhou.aliyuncs.com/blog/20191105/121155564.png" alt="mark" style="zoom:75%;" />

Two or more sets for each of the N disk mirroring , in some multithreaded operating systems can have a good reading speed, the reading speed is theoretically equal to the number of multiple hard drives, slight further reduction in write speed. As long as you can maintain the normal operation of a disk, the highest reliability. RAID 1 is mirroring its principles are the same on the hard disk mirroring to write data simultaneously store data on the primary hard disk. When the main disk (physically) damaged, instead of the operation of the main mirror hard disk. Because of mirrored hard drives for data backup, so RAID 1 data security is the best on all RAID levels for. But no matter how much do RAID 1 disk, a disk capacity of only count it was the lowest of all in a RAID level disk utilization .

If you use RAID disk built in two different sizes of 1, available disk space for the smaller, larger disk extra space can be partitioned into a zone to use, no waste.

<img src="http://itmc.oss-cn-hangzhou.aliyuncs.com/blog/20191105/121240644.png" alt="mark" style="zoom:75%;" />

RAID Level 5 is a storage performance, data security and storage costs into account storage solutions. It uses Disk Striping (hard disk partition) technology. RAID 5 requires at least three hard drives, RAID 5 is not stored in the backup data, but the data and corresponding parity information is stored on each disk consisting of RAID5 , and parity information, and data corresponding to each stored on a different disk . When a RAID5 disk data is damaged, the remaining data may be utilized and corresponding parity information to recover corrupted data. RAID 5 can be understood as RAID 0 and RAID 1 to compromise. RAID 5 can provide data security for systems, but the level of protection than mirroring low and high utilization of disk space than mirroring . RAID 0 and RAID 5 has approximating the data read speed, simply because one more parity information, write speed of data written to a separate hard drive is relatively slightly slower, the use of "write-back caching" allows performance improved a lot. And because a plurality of data corresponding parity information, RAID 5 disk space utilization than RAID 1 high storage costs relatively cheap.

<img src="http://itmc.oss-cn-hangzhou.aliyuncs.com/blog/20191105/121511632.png" alt="mark" style="zoom:75%;" />

In order to further improve storage availability, smart people RAID6 also proposed scheme, can have two disks at the same time damage the case, can guarantee data recoverability.

Why RAID6 so cattle do, because once again on the basis of RAID5 RAID6 improvement on the introduction of the concept of double check.

In addition to have the same level RAID6 XOR parity data area on the outside of each disk, as well as for the XOR parity area of each data block, in which case, the equivalent of each data block has two parity protection measures,
and therefore the data redundancy higher.

But this design RAID6 also brings a high degree of complexity, although data redundancy and good read efficiency is relatively high, but the write performance data on the poor. Therefore RAID6 application in a real environment is relatively small.

<img src="http://itmc.oss-cn-hangzhou.aliyuncs.com/blog/20191105/121702711.png" alt="mark" style="zoom:75%;" />

RAID 10 is the first mirror and then partitioned data, and then all of the hard disk divided into two groups, considered to be the lowest combination of RAID 0, then two sets of each treated as RAID 1 operation.

RAID 01 RAID 10 is a program with the opposite, then the data is to partition the hard disk to mirror the two groups. It's all hard disk divided into two groups, into a combination of RAID 1 is the lowest, while the two hard disks each treated as RAID 0 operation.

RAID 10 when there is damage to a hard disk, and the rest will continue to work hard. RAID 01 as long as there is a damaged hard drive, the same group all RAID 0 hard disk will stop working, leaving only the hard working of any other group, low reliability. If the hard disk in order to build six RAID 01, mirrored and then build three RAID 0, then a bad hard drive will have three hard disks offline. Therefore, RAID 10 RAID 01 far more common, the vast majority of retail motherboards support RAID 0/1/5/10, but does not support RAID 01.

Finally, talk about why RAID10 better than RAID 01 and fly:

RAID0 + 1 RAID0 two do first, and then do RAID1, RAID0 + 1 thus allows a plurality of the bad disk, but only in a bad RAID0 same, have allowed two RAID0 bad disk.
RAID1 + 0 is to do first RAID1, then do RAID0, RAID1 + 0 and therefore allows a plurality of the bad disk, as long as not a bad disk can be friends.
So, to say RAID1 + 0 RAID0 + 1 ratio much safer because of the low probability disk, two disks are broken in the same.
RAID 0 and RAID 1, respectively, for enhancing the storage performance (RAID stripe 0) and data security (RAID 1 mirror), RAID 0 + 1 and RAID 10 and RAID advantages of both the 0 and RAID 1, and RAID 1 provide it Like ensure data security, but also provides RAID 0 storage performance and approximate. Although RAID 0 + 1 and 10 similar rationale RAID, RAID0 and RAID1 are combined, but still some differences.

In the MySQL database, usually we use RAID 10.

RAID installation command -mdadm

mdadm -C -v / dev / md0 -l (this is not 1) 0 -n2 / dev / sd [bc] 1 FIG Example (provided that the hard disk has been previously completed with the fdisk partition)

<img src="http://itmc.oss-cn-hangzhou.aliyuncs.com/blog/20191105/122434144.png" alt="mark" style="zoom:75%;" />

Conclusion: The application of command Intuit long, you must first understand the nerve to re-record, but even to understand better still difficult to remember. Even remember, among those slashes should also be noted that, make no mistake.

Guess you like

Origin blog.51cto.com/14557561/2448021