# built-in tools

df / lsblk - allows you to list available drives, including block devices.
mount / umount - simple tools allowing you to detach a partition to change its properties.
fdisk - management tool. It will recreate partitions with newly specified bounds.
e2fsck - allows checking of the modified file system for errors.
resize2fs - modifies existing file system to fit new size bounds.

# file sharing protocol

Linux: NFS Win: SMB

# LVM

keywords: lvm lun

https://landoflinux.com/linux_lvm_command_examples.html


pvdisplay
vgdisplay
lvdisplay

pvs
vgs
lvs
df -TH

fdisk -l

blkid

lsblk

/dev/mapper

mount new disk https://support-intl.huaweicloud.com/zh-cn/qs-evs/evs_01_0033.html

# example mount raw disk

fdisk -l /dev/vdb

mkfs -t ext4 /dev/vdb1
mkdir /test
mount /dev/vdb1 /test

mount -a

##auto mount:

 vim /etc/fstab
    /dev/vdb        /lyhistory/  xfs     defaults        0 0

# example mount lvm

fdisk -l
fdisk -l /dev/vdb
pvcreate /dev/vdb1
vgdisplay -l
pvs
vgcreate lyhistory-vg /dev/vdb1
vgs
lvcreate -l 100%FREE -n lyhistory lyhistory-vg
lvdisplay
mkfs.xfs /dev/lyhistory-vg/lyhistory
vi /etc/fstab
    /dev/lyhistory-vg/lyhistory       /lyhistory                    xfs    defaults        0 0

mkdir /lyhistory
mount -a
mount -l
fdisk -l

# example lvm resize

https://stackoverflow.com/questions/51663585/centos-disk-lvm-extension/52312111#52312111


1) pvresize /dev/sda2

    ,after execute, pls run pvs to check whether the pv size increased, if not, stop here

2) vgextend centos /dev/sda2

    ,after execute,pls check your vgs, see whether the size increased, if so go on to the next

3) lvextend -l 100%FREE /dev/mapper/centos-root

    ,after this, check lvs, if the root size not increased, go on

4) try:

    xfs_growfs /dev/mapper/centos-root or resize2fs /dev/mapper/centos-root