RAID&LVM of Linux

1. Partition

All extended partitions cannot be used!
RAID [Independent Redundant Disk Array, increase disk space and increase the data transfer rate of disk drives]
– combine hard disks into one piece
– popular: raid0 raid 1 raid5 where 1 and 5 ensure data security and prevent accidental disk failure and loss to the greatest extent The occurrence of data situation
raid0: each disk is connected in series to create; a large volume set (without backup function)
raid1: one hard disk for backup
raid3: two hard disk storage, one backup [array reconstruction full]
raid5 : Multiple hard disks, each is backed up
– Type: soft raid, hard raid
– operation:
》》Create physical partition:
add hard disk, create a partition for each hard disk Set file system type fd
format: mkfs.ext4 /dev /~
""Create an array device: mknod /dev/md1 b 9 1
""Create a RAID array: [yum -y install mdadm]
mdadm -C /dev/md1 -n 2 /dev/sda1 /dev/sdb1 -l 0
[raid type is 0 here]

》》Format /md1
》》Mount, set boot self-mounting
Problem :
1. An error occurred when loading system files when creating a system: [display:/dev/mapper/vg_kevinmahone-lv_root~]
[fsck/file system check/: Used to check and maintain inconsistent file systems, such as:
system power failure or disk problems, you can use this to check the
file system]
Solution 1:
Enter the root password:
fsck.ext4 -y /dev/mapper/vb_kevinmahone- lv_root fsck.ext4
-y /dev/sda1
to
restart Solution 2:
Enter the root password:
fsck -c
fsck.ext /dev/sda1
fsck -y /dev/sda1
to restart

LVM(Logical Volume Manager/Logical Volume Manager/)

Function: Solve the problem of freely adjusting the size of the file system under the premise of zero downtime, so as to facilitate the realization of the file system across different disks and partitions
. Operation :

Add a hard disk partition setting type (8e)
to create a physical volume pvcreate /physical Volume/
pvcreate /dev/pvsd~
[pvdisplay to view a physical volume; pvremove to delete a physical volume]
to create a volume group vgcreate /Volume Group/
vgcreate vg_name1 /dev/~ /dev/ ~
Create a logical volume lvcreate /Logical Volume/
lvcreate -L nG -n lvname1 vg_name1 [-n is name]
lvcreate -L nG -n lvname2 vg_name1
~~
Format: mkfs.ext4 /dev/vgname1/lbname1
mount mount automatically Load
Ok
expansion:
1. If there is excess space in vg:
lvextend -L +10G /dev/vgname/lvname
resize2fs /dev/vgname/lvname (reset)
2. If there is no excess space in vg, you need to add a physical volume to join to vg
vgextend vgname /dev/sd…

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325939169&siteId=291194637