1. Disk array and backup disk
mdadm -Cv /dev/md0 -n 3 -l 5 -x 1 /dev/sd[b-e]
mdadm /dev/md0 -a device name
2. LVM (Logical Volume Manager)
Dynamically adjust the partition size so that users do not need to care about the underlying architecture
Commonly used LVM commands:
Scan pvscan vgscan lvscan
建立 pvcreate vgcreate lvcreate
显示 pvdisplay vgdisplay lvdisplay
Delete pvremove vgremove lvremove
Extend vgextend lvextend
Shrink vgreduce lvreduce
/dev/volume group name/logical volume
pvcreate /dev/sdb /dev/sdc pvremove /dev/sdb /dev/sdc
vgcreate xiaolong /dev/sdb /dev/sdc vgremove xiaolong
lvcreate -n vo -l 200 xiaolong lvremove /dev/xiaolong/vo
lvextend -L 5G /dev/xiaolong/vo
e2fsck -f /dev/xiaolong/vo
resize2fs /dev/xiaolong/vo
lvreduce -L 300M /dev/xiaolong/vo
lvcreate -L 100M -s -n SNAP /dev/xiaolong/vo
lvconvert --merge /dev/xiaolong/SNAP
Three, firewall
1.iptables: OUTPUT;INPUT;FORWARD;POSTROUTING;PREROUTING
ACCEPT (allow), REJECT (deny), LOG (record log information), DROP (deny)
Parameters: -P (set the default policy); -F (clear the rule chain); -L (view the rule chain); -A (add a new rule at the end of the rule chain); -I num (add a new rule at the head of the rule chain) ); -D num (delete a tuning rule); -s (match the source address ID/MASK); -d (match the destination address); -i network card name (match the data flowing in from this network card); -o network card Name (match the data flowing from this network card); -p (match protocol); --dport num (match the destination port number); --sport num (match the source port number)
iptables -I INPUT -p icmp -j ACCEPT
iptables -D INPUT 1
iptables -I INPUT -s 192.168.10.0/24 -p tcp --dport 22 -j ACCEPT
iptables -A INPUT -p tcp --dport 22 -j REJECT
iptables -I INPUT -p tcp --dport 12345 -j REJECT