Basic knowledge of Linux Learning (vii)

Source: Internet
Author: User

1, create a 10G partition, and the format of the Ext4 file system;

(1) The block size is required to 2048, the reserved space percentage is 2, the volume label is MyData, the default Mount property contains ACLs;

(2) Mount to the/data/mydata directory, require the mount to prohibit the program to run automatically, and do not update the file access time stamp;

when a virtual machine cannot be recognized immediately after the disk is added :Echo '---' >/sys/class/scsi_host/host0/scan host0 here may be host1,host2, You can try a few more times.

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M01/87/C3/wKioL1fhBuzi-kIzAACFDregrfU738.png "style=" float: none; "title=" 1.0.png "alt=" Wkiol1fhbuzi-kizaacfdregrfu738.png "/>

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/87/C6/wKiom1fhBu2DJ8OaAABZWpcUA9U180.png "style=" float: none; "title=" 1.1.png "alt=" Wkiom1fhbu2dj8oaaabzwpcua9u180.png "/>

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/87/C3/wKioL1fhBu2DvI14AAAYU0FmyR4693.png "style=" float: none; "title=" 1.2.png "alt=" Wkiol1fhbu2dvi14aaayu0fmyr4693.png "/>

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/87/C3/wKioL1fhBu3gfbgXAAAuSBv4yBY074.png "style=" float: none; "title=" 1.3.png "alt=" Wkiol1fhbu3gfbgxaaausbv4yby074.png "/>

2, create a swap partition of size 1G, and create a good file system, and enable it;

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/87/C6/wKiom1fhBymhbrNiAABfEdf7Jzw232.png "style=" float: none; "title=" 2.0.png "alt=" Wkiom1fhbymhbrniaabfedf7jzw232.png "/>

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/87/C3/wKioL1fhBymhU7xJAAAngpNF4cc198.png "style=" float: none; "title=" 2.1.png "alt=" Wkiol1fhbymhu7xjaaangpnf4cc198.png "/>

3. Write a script

(1), obtain and list all disk devices on the current system;

(2), display the space usage information about each partition on each disk device;

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M01/87/C6/wKiom1fhB0XxjWj0AABydaqhp7Y229.png "title=" 3.0. PNG "alt=" Wkiom1fhb0xxjwj0aabydaqhp7y229.png "/>

4. Summarize the different levels of RAID and its combination mode and performance;

Raid:redundant Arrays of inexpensive Disks, inexpensive redundant array of disks

Level: Raid0,raid1,raid5,raid10,raid01,raid6

RAID-0: Simultaneous reading and writing of two disks, significantly improved performance

No fault tolerance,

Free Space: All disks

Generally applicable to high IO, but the data is not very important scenario, similar to the cache of a class of scenes;

RAID-1: also known as disk mirroring, two disks for a full backup, one copy of the data will be written to both disks, so the data

Performance will improve when read, but performance will drop when writing.

Full backup, high security, but reduced disk utilization by half

Suitable for scenarios with high data security requirements

RAID-5: Distributed parity disk structure

Read and write performance is improved,

Have redundancy capability

Free space: N-1

This is currently used in a relatively multi-array mode, 3 disk, a damaged piece can still guarantee data integrity, but also have

Higher disk utilization. belongs to the inexpensive type.

RAID-10: High reliability and efficient disk structure

Do RAID-1 first, then do RAID-0

Read performance has improved,

Half of available space dropped

Redundancy: Each group can only be broken at most,

RAID-01: Do RAID-0 first, then do RAID-1

Improved read and write performance

Half of available space dropped

Redundancy: Each group can be damaged two blocks at a time,



5, the creation of a size of 10G RAID1, requires a free disk, and chunk size of 128k;

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/87/C3/wKioL1fhB2TA_r_HAABi7o-JJvA432.png "title=" 5.0. PNG "alt=" Wkiol1fhb2ta_r_haabi7o-jjva432.png "/>

6, the creation of a size of 4G RAID5 device, chunk size of 256k, format Ext4 file system, required to automatically mount to the/backup directory, and do not update the access timestamp, and support ACL function;

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/87/CA/wKiom1fhdCLhSkr_AACwLoETFmo223.png "style=" float: none; "title=" 6.0.png "alt=" Wkiom1fhdclhskr_aacwloetfmo223.png "/>

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M01/87/C6/wKioL1fhdCLgc8bnAABtsoLe3DA231.png "style=" float: none; "title=" 6.1.png "alt=" Wkiol1fhdclgc8bnaabtsole3da231.png "/>

7. Write a script

(1) Accept more than one file path as a parameter;

(2) show the number of rows owned by each file;

(3) A summary of the total number of documents for several statistics of their lines;

650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M01/87/C6/wKiom1fhB4Kx4wbMAAA4CrQ046I986.png-wh_500x0-wm_3 -wmp_4-s_1633445214.png "title=" 7.0.png "alt=" Wkiom1fhb4kx4wbmaaa4crq046i986.png-wh_50 "/>

8. Write a script

(1) Pass more than two strings as user name;

(2) Create these users, and the password with the user name;

(3) A summary of the total creation of a number of users;

650) this.width=650; "Src=" Http://s1.51cto.com/wyfs02/M02/87/C6/wKioL1fhdcbxGRMxAAB126YqAls321.png-wh_500x0-wm_3 -wmp_4-s_199170683.png "title=" 8.0.png "alt=" Wkiol1fhdcbxgrmxaab126yqals321.png-wh_50 "/>


9, write a script, create a new 20 users, visitor1-visitor20; calculate the sum of their IDs;

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/87/C3/wKioL1fhB56RSNixAAA_67UZnVE145.png "title=" 9.0. PNG "alt=" Wkiol1fhb56rsnixaaa_67uznve145.png "/>

10. Write a script that counts the sum of the number of lines starting with # in/etc/rc.d/rc.sysinit,/etc/rc.d/init.d/functions, and/etc/fstab files, and the total number of blank lines;

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M01/87/C3/wKioL1fhB6qyRWpzAABBENozuQg649.png "title=" 10.0. PNG "alt=" Wkiol1fhb6qyrwpzaabbenozuqg649.png "/>

11. Write a script that shows the user name, UID, and the UID of all the default shell users on the current system.

650) this.width=650; "Src=" Http://s1.51cto.com/wyfs02/M00/87/CA/wKiom1fhdemyWsuPAABUcy6gLJQ162.png-wh_500x0-wm_3 -wmp_4-s_2337193983.png "title=" 11.0.png "alt=" Wkiom1fhdemywsupaabucy6gljq162.png-wh_50 "/>

12. Write a script that displays the user name of all the users on the current system with additional groups, and how many such users are in total;

650) this.width=650; "Src=" Http://s1.51cto.com/wyfs02/M00/87/CA/wKiom1fhdfqB5lhPAAA9SJQsnvg612.png-wh_500x0-wm_3 -wmp_4-s_3313214933.png "title=" 12.0.png "alt=" Wkiom1fhdfqb5lhpaaa9sjqsnvg612.png-wh_50 "/>


13. Create a volume group of at least two physical volumes with a size of 20G, requiring a PE size of 8M, and creating a logical volume of 5G in the volume group MYLV1, formatted as EXT4 file system, boot automatically mounts to/users directory, support ACL;

650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M00/87/C6/wKioL1fheovRo0j3AABXCd9etxQ287.png-wh_500x0-wm_3 -wmp_4-s_2555066821.png "style=" Float:none; "title=" 13.0.png "alt=" Wkiol1fheovro0j3aabxcd9etxq287.png-wh_50 "/>

650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M01/87/CA/wKiom1fheozQ29hkAABfI1gCb44905.png-wh_500x0-wm_3 -wmp_4-s_1586506438.png "style=" Float:none; "title=" 13.1.png "alt=" Wkiom1fheozq29hkaabfi1gcb44905.png-wh_50 "/>

650) this.width=650; "Src=" Http://s1.51cto.com/wyfs02/M01/87/CA/wKiom1fheozwMhgsAAAl0KWYs14484.png-wh_500x0-wm_3 -wmp_4-s_1332345149.png "style=" Float:none; "title=" 13.2.png "alt=" Wkiom1fheozwmhgsaaal0kwys14484.png-wh_50 "/>

14, the new user magedu, the home directory is/users/magedu, and then su switch to this user, copy multiple files to the home directory;

useradd-d/users/magedu magedu

Su magedu

cp/var/log/*.log/users/magedu

15, expand MYLV1 to 9G, ensure that the original data is fully available after the expansion;

650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M02/87/C6/wKioL1fhexTgVdyxAAAc--yCbRY269.png-wh_500x0-wm_3 -wmp_4-s_2538222314.png "title=" 15.0.png "alt=" Wkiol1fhextgvdyxaaac--ycbry269.png-wh_50 "/>

16, reduce MYLV1 to 7G, to ensure that the original data is fully available after the completion of the reduction;

650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M02/87/CA/wKiom1fhfMHgp1v9AACGCGNp6J8029.png-wh_500x0-wm_3 -wmp_4-s_3931733177.png "title=" 16.0.png "alt=" Wkiom1fhfmhgp1v9aacgcgnp6j8029.png-wh_50 "/>

17, the MYLV1 to create a snapshot, and through the backup data, the requirement to retain the original genera group and other information;

650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M02/87/C6/wKioL1fhfa7AWDrWAAAd7YKJftU272.png-wh_500x0-wm_3 -wmp_4-s_1372684858.png "title=" 17.0.png "alt=" Wkiol1fhfa7awdrwaaad7ykjftu272.png-wh_50 "/>




Basic knowledge of Linux Learning (vii)

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.