System operation and maintenance series of Linux notes disk partition/mount/LVM

1 Disk partition:
* Disk partition is to divide the physical disk space into N areas of different sizes according to requirements, so that the OS can better and more efficiently manage file storage.

2 Mounting:
*Mounting is to connect the file directory and the partition. It is the same as the mapping relationship between the drive letter and the partition under windows. The difference is that Windows maps the partition to a drive letter, while linux maps a partition to a drive letter. A directory.
*The difference between file system EXT3, EXT4 and XFS:
EXT stands for Linux extended file system, extfs, which means Linux extended file system, Ext2 stands for second-generation file extension system, and so on.
ls -l /lib/modules/$(uname -r)/kernel/fs
#View the file system supported by linux EXT3: the maximum file size is 2TB, representing the system centos5;
EXT4: the maximum file size is 16TB, representing the system centos6;
XFS : The maximum file size is 8EB, which means that the system is centos7.

3 LVM:
*PV: physical Volume, composed of one to multiple physical partitions;
VG: Volume Group, can be understood as a virtual disk, composed of one to more PVs;
LV: logical volume, can be understood as Virtual partition, a VG can be divided into one or more virtual partitions;
PE: the smallest storage block in LVM.
*The tool for managing PV, VG, LV is called logical volume manager (LVM).

Commonly used commands:
fdisk -l #View detailed system partition information
fdisk /dev/sdb #Partition sdb
**Note: **In the operation of disk partition, press w at the end!
pvcreate /dev/sdb1 #Create pv
vgextend VolGroup /dev/sdb1
#Add sdb1 to VolGroup's volume group (vg) lvcreate -L 10g -n data01 VolGroup #Create virtual partition lv data01
mkfs.ext4 /dev/VolGroup/data01 # format DATA01
Mount / dev / volgroup / DATA01 / DATA01 # mount
Add mounting information in / etc / fstab, the realization of automatic loading start : /
dev / volgroup / DATA01 / ext4 Defaults. 1. 1 DATA01
the fuser -v -m / mnt / a # use this command to view the process use
fuser -m -k / mnt / a # use this command to lift the process occupancy
df # view the file system (-h display system suitable to the type of system size units show -T)
pvscan # query Disk pvdisplay with pv in the system
# Display system pv state
the pvremove # removed pv property, so that the district does not have pv attribute
the vgreduce # delete pv within VG
lvscan # logical volume scanning, scanning for all LVM logical volumes that exist in the current system
lvresize # on lv adjusts the size of the capacity
lvchange #change the status of lv

Reference link:
http://www.05bk.com/436.html File system type FAT16, FAT32, NTFS, EXT3, EXT4, XFS description and comparison
https://www.cnblogs.com/dumpling-z/p/11145993 .html linux note disk partitioning and mounting detailed explanation
https://blog.csdn.net/qq_22805577/article/details/80496957 Linux uses lvresize to expand or reduce LV size
https://blog.csdn.net/pamdora/article/details /81204060 Linux creates LV
https://blog.csdn.net/liujinwei2005/article/details/78439452/ Relationship and operation of PV, VG, LV
http://linux.51yip.com/search/lvscan
https://blog .csdn.net/qq_22805577/article/details/80496957 Linux uses lvresize to expand or reduce LV size

Guess you like

Origin blog.csdn.net/langxiaolin/article/details/113556065