linux basics -CentOS7 operation and maintenance system installation and configuration health check

linux operation and maintenance basics

1. CentOS7.X a complete operating system installed, configured and logical partition;
2. Complete LVM partition 20GB storage capacity expansion;
3. Check system CPU / memory / network / storage performance inspection;
4. Check the operating system version;
5. check the system for illegal account;
6. check the system log related error;
7. check whether the system background applications running illegal;

A: Installation and Configuration LVM logical volume

  1: System Installation (slightly)

  2: partition and logical volume configuration

LVM Introduction: Logical Volume Manager (LogicalVolumeManager) is essentially a virtual device driver, is a new level of abstraction between the core block and physical devices added, as shown in FIG.

 

 

 

  • It may be a few disks (physical volumes, PhysicalVolume) combined to form a storage pool or volume group (VolumeGroup).
  • Each LVM can be divided in a different group from the volume in the logical volume (the LogicalVolume) creating a new logical device.
  • Underlying original disk is no longer directly controlled by the kernel, while the layer is controlled by the LVM. For the upper volume group alternative applications, disk blocks become a basic unit of data storage.
  • LVM physical extents manages all physical volumes, maintains the mapping between the logical extents and physical extents.
  • LVM logical and physical disk devices provide the same functionality to the upper applications such as data access and creation of file systems and so on.
  • LVM logical device but not restricted by physical constraints, not necessarily contiguous logical space, it can span many physical volume, and may be of any size at any time adjustments. Compared to the physical disks, easier to manage disk space.

Disk partition environment: sda for the system where the disk system, sdb for the newly added disk

Partitioning scheme: first partition in sdb; then configure LVM, partitioning tools are:  

1: parted (to demonstrate the general section)

2: fdisk (presentation characteristics)

2.1: Partition

First check the list of disks:

lsblk

 

Each parameter parsing: 

  • NAME: file name of the device, will be omitted / dev like leading directory
  • MAJ: MIN: Cognition means through this sample are familiar to the two codes, namely primary: secondary device Code
  • RM: Can unloading device (removable device), such as CD-ROM, USB disk
  • SIZE: Capacity
  • RO: whether it is read-only device
  • TYPE: disk (disk), read-only memory (ROM), a dividing groove (Partition)
  • MOUNTPOINI: mount point

 

 You can see, there are currently two disk (sda / sdb), a CD-ROM (sr0), now for the first sdb partition the disk,

Using parted

parted / dev / sdb # of sdb disk management

  

 

 

 And then view help:

h

 

 

 Now look at the regional situation:

p

Tip partition was not found, because it is just adding disk, so this is normal, continue to the next step: the partition

Type mbr because the disk is not initialized, so the partition needs to be defined before a partition label, that is, windows platform called partition type (not equal partition file system format), windows common, gpt, etc.

mklabel # define the type of partition table

 

 

 After entering mklabel after the carriage return, press twice tab to list the available options, select common here gpt, enter gpt press Enter

gpt

Then compare the difference between before and after the definition:

  

 

 

 

 Then start creating partitions:

Partition help command as follows

 

 

 Mysql create a partition

mkpart

 

 

 You can see, this time has been successfully created, specific information is as follows:

  • District No. 1 [Number]
  • Starting point for 1049kib [Start]
  • 10.7GB end point [End]
  • [Size] size 10.7GB
  • File system is empty (unformatted)] [File system
  • Partition name is mysql [Name]
  • Flag is empty [flag]

Attached below some parameter values ​​to create the partition:

Partition name [custom, no options]

 

 

 File system types: [Radio]

 

 

 The starting point and end point of [the custom, there are a variety of ways, the only requirement is the need to comply with current disk space, only less than or equal to the total space, can not be greater than the total space]

第一种方法:百分比(相对来说更适用于该磁盘未分区时)

 第二种方法:具体值(比较专业,不建议)

第三种:加法(最适合已有分区时,简单易懂,需使用fdisk)

fdisk /dev/sdb

首先看一下这个分区工具的命令帮助

 

 可以看到,n就是我们需要的了,但是分区之前我们需要先看看这个磁盘的现有分区表

 

 可以看到,此时已经有两个分区了(也就是我们前面使用parted进行分区的),然后记住一个值,就是结束点,然后开始操作

n

  

 

 可以看到,此时3号分区创建成功,大小为2G(使用fdisk分区记得使用w进行分区保存,q则是保存不退出);分区部分结束!

2.2:配置逻辑卷

分区或者配置逻辑卷前都建议先查看当前的情况,所以第一步,查看逻辑卷:

pvdisplay

 

 可以看到,此时只有一个逻辑卷,也就是第一块磁盘,也就是说sdb磁盘未配置LVM,那么下面开始操作:

 

 

现在要对sdb进行逻辑卷配置。

pvcreate /dev/sdb    #初始化磁盘

 

 提示创建成功,然后下一步:

pvdisplay  #显示物理卷信息

 

 

继续下一步:

  

Guess you like

Origin www.cnblogs.com/liuyi778/p/12118527.html