Raid and one of the Mdadm commands (including shell display font color, etc.)

Source: Internet
Author: User
Tags clear screen set background

Write a script:

1) display a menu to the user:

d| D) show disk usages.

m| M) show memory usages.

s| S) show swap usages.

QUIT|Q) quit.

2) Display the appropriate content when the user is given an option

When the user chooses to complete, displays the corresponding information, does not exit, but lets the user select again, until select quit or Q

#!/bin/bash

While [1-eq 1]; Do

echo "

"

Read-p "d| D) show disk usages.

m| M) show memory usages.

s| S) show swap usages.

QUIT|Q) quit

Your choice: "Choice

Case $choice in

d| D

Df-h;;

m| M

Free-m|grep "Mem";;

s| S

Free-m|grep "Swap";;

QUIT|Q)

Exit 0;;

*)

echo "Unknow choice."

Esac

Done


Display font color in shell:

Format: echo "\033[word background color; font color m string \033[control code"
If you simply display the font color can be fixed control code bit 0m.
Format: echo "\033[word background color; font Color m string \033[0m"


Word background color range: 40-49

40: Black
41: Crimson
42: Green
43:***
44: Blue
45: Purple
46: Dark Green
47: White


Word Color: 30-39

30: Black
31: Red
32: Green
33: Yellow
34: Blue
35: Purple
36: Dark Green
37: White


ANSI Control code

\33[0m Close All Properties
\33[01m Setting High brightness
\33[04m Underline
\33[05m Flashing
\33[07M Reverse Display
\33[08m blanking
\33[30m--\33[37m setting foreground color
\33[40m--\33[47m Set background color
\33[na the cursor to move n rows
\33[NB cursor down n rows
\33[NC cursor right shifts n rows
\33[nd cursor left n rows
\33[Y;XH Setting the cursor position
\33[2J Clear Screen
\33[k clears the contents from the cursor to the end of the line
\33[s Save Cursor position
\33[u Restore cursor Position
\33[?25l Hide Cursor
\33[?25h Display cursor


For example:

Turn the font into red and keep flashing
#echo-E "\033[31m \033[05m please confirm your operation, enter [y/n] \033[0m"
Or

#echo-E "\033[31m \033[05m please confirm your operation, enter [y/n] \033[0m"


Controller and Adapter differences:

For example: the integrated network card is the controller, and the network card of the independent network card itself is an adapter, integrated on the motherboard with the perfect function can be called the controller, and only provide slots also need other conditions called adapter.


Disk array (redundant Arrays of independent Disks,raid), with the meaning of "redundant array of independent disks".

The disk array is made up of many inexpensive disks, combined into a large disk group, which uses individual disks to provide data with the added effect to improve the performance of the entire disk system. Using this technique, the data is cut into many sections, which are stored on each hard drive. [1]

The disk array can also take advantage of the same-bit checking (Parity check) concept, in the array of any one hard disk failure, can still read the data, when the data is reconstructed, the data is computed and re-placed into the new hard disk.



650) this.width=650; "Src=" http://b.hiphotos.baidu.com/baike/s%3D220/sign=791325694d086e066ea8384932097b5a/ Eaf81a4c510fd9f916a0ec31242dd42a2834a437.jpg "alt=" eaf81a4c510fd9f916a0ec31242dd42a2834a437 "/>

RAID 0: Stripe technology, a disk divided into two parts, while writing

Performance improvement: Read, write

Redundancy capability: None

Space utilization: NS


650) this.width=650; "Src=" http://e.hiphotos.baidu.com/baike/s%3D220/sign=74628492503d26972ad30f5f65fab24f/ E850352ac65c103887cd779ab3119313b07e8933.jpg "alt=" e850352ac65c103887cd779ab3119313b07e8933 "/>

RAID 1: Mirroring technology, two disk synchronous write, each other for backup

Performance: Write performance degradation, read performance improvement

Redundancy capability: Available

Space utilization: 1/n

650) this.width=650; "Src=" http://a.hiphotos.baidu.com/baike/c0%3Dbaike80%2C5%2C5%2C80%2C26/sign= 1ffb9dce0b46f21fdd395601974d0005/18d8bc3eb13533fa4aba401ba9d3fd1f41345bf3.jpg "alt=" 18d8bc3eb13533fa4aba401ba9d3fd1f41345bf3 "/>

RAID10: First do RAID1 again do RAID0, the same group can not hang at the same time, performance and raid01 difference is not small, but assume both disk0 hang, raid10 just in the same group internal repair can, and raid01 is reaching, So generally speaking, RAID10 will be better than RAID01.

Performance improvement: Read, write

Redundancy capability: Available

Space utilization: 1/2


RAID01: Different groups can't all hang up (because the same stripe is not necessarily the same.) If the different groups have hung off the disk, basically the entire array will be hung off), the same group hung up okay

Performance improvement: Read, write

Redundancy capability: Available

Space utilization: 1/2


650) this.width=650; "Src=" http://c.hiphotos.baidu.com/baike/c0%3Dbaike92%2C5%2C5%2C92%2C30/sign= 71a5484ab74543a9e116f29e7f7ee1e7/5243fbf2b211931372c2690e65380cd790238d8f.jpg "alt=" 5243fbf2b211931372c2690e65380cd790238d8f "/>

RAID5:RAID 5 does not specify an odd and even disk, but is interleaved with data and parity information on all disks . You can hang up a disk, but you can't hang out more than two

Performance: Read, write

Redundancy capability: Available

Space utilization: (n-1)/n



Another type of hard drive technology:

Jbod

Performance: No lift

Redundancy capability: None

Space utilization: 100%

Need at least two bucks.

Raid and one of the Mdadm commands (including shell display font color, etc.)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.