1, lvm disk management to complete the requirements below, and write a detailed process: centos7 environment
1) Create a size of the at least two PV VG is composed of named testvg of 20G; PE claim size 16MB, then the size of 5G created logical volume in the volume group testlv; to mount / users directory
pvcreate /dev/sd{a6,c}
vgcreate -s 16M testvg /dev/sd{a6,c}
lvcreate -n testlv -L 5G testvg
mkfs.ext4 /dev/testvg/testlv
mkdir /mnt/users
mount /dev/testvg/testlv /mnt/users/
2) extend testlv to 7G, archlinux requires the user's file can not be lost
lvextend -l 7G /dev/testvg/testlv
resize2fs /dev/testvg/testlv (同步原来的文件系统,适用于ext系列,这里写设备名称)
xfs_growfs /mnt/users (适用于xfs,这里写挂载点)
3) testlv to shrink 3G, archlinux requires the user's file can not be lost
umount /mnt/users/
e2fsck -f /dev/testvg/testlv
resize2fs /dev/testvg/testlv 3G
lvreduce -L 3G /dev/testvg/testlv
mount /dev/testvg/testlv /mnt/users/
4) Create a snapshot of the testlv, and try to function-based snapshot backup data validation snapshot
lvcreate -n testlv_snap -s -p r -L 1G /dev/testvg/testlv
mkdir /mnt/snap
mount testlv_snap /mnt/snap
Restore Snapshot:
umount /mnt/users/
umount /mnt/snap/
lvconvert --merge /dev/testvg/testlv_snap
以上是centos6,如果是centos7,mount -o nouuid /dev/testvg/testlv_snap /mnt/snap
Full Restore:
lvremove /dev/testvg/testlv
vgremove testvg
pvremove /dev/sda6 /dev/sdc
2, to create a free space for the apparatus 1G of RAID1, ext4 file system, there is a spare disk, can be switched to automatic loading / backup directory
创建2个分区sdb1,sdc1,sde为空闲盘,注意类型选择fd
mdadm -C -a yes /dev/md0 -l 1 -n 2 -x 1 -c 1G /dev/sd{b1,c1,e} -x 1 代表1个备用的
cat /proc/mdstat 可以查看raid成员
mdadm -D /dev/md0 查看详细的raid信息
mkfs.ext4 /dev/md0
mkdir /mnt/raid
开机可自动挂载要写在/etc/fstab文件里
mount -a
3, brief TCP connection establishment and disconnection process
Three-way handshake and four wave
Three-way handshake:
客户端访问服务器
客户端发送SYN=1,seq=x序号给到服务器
服务器回应发送ack=x+1 SYN=1. ACK=1 seq=y序号给客户端
客户端发送ACK=1.seq=x+1 ack=y+1给服务器
y+1代表客户端收到之前服务器发送的seq=y的信息,并且回应服务器希望服务器下次发送y+1
Four wave:
客户端向服务器发送FIN=1,seq=u序号的信息给服务器
服务器回应ACK=1,seq=v,ack=u+1的信息给客户端
服务器把数据传完,发送FIN=1ACK=1 seq=w ack=u+1给客户端
客户端发送ACK=1 seq=u+1 ack=w+1给服务器
FIN标记位是结束标记
4 distinction, TCP and UDP DESCRIPTION
TCP, UDP operate at the transport layer
TCP connection-oriented, that is, before the transfer of data to send data packets to test whether loss
Connectionless UDP does not directly send data out of the test
TCP send data packets have order, are numbered.
UDP does not order, first received earlier, probably after some data will be sent to receive, thus causing data errors are not reliable
TCP applies to e-mail, downloading, file transfer
UDP used in video, voice