[Email protected] ~]# Fdisk-l/DEV/SDB/DEV/SDC | grep "LVM"
/DEV/SDB1 1 9660 77593918+ 8e Linux LVM
/DEV/SDC1 1 9660 77593918+ 8e Linux LVM
To create a physical volume:
[Email protected] ~]# PVCREATE/DEV/SDB1
Physical volume "/DEV/SDB1" successfully created
[Email protected] ~]# PVCREATE/DEV/SDC1
Physical volume "/DEV/SDC1" successfully created
To create a volume group:
[Email protected] ~]# vgcreate MAIL_STORE/DEV/SDB1/DEV/SDC1
Volume Group "Mail_store" successfully created
To create a logical Volume:
[Email protected] ~]# lvcreate-l 60g-n Mail Mail_store
Logical volume "Mail" created
[Email protected] ~]# mkfs-t Ext4/dev/mail_store/mail
......
Logical Volume Expansion:
[Email protected] ~]# lvextend-l +10g/dev/mail_store/mail
[[email protected] ~]# resize2fs/dev/mail_store/mail (physical partition or hanging at the point can be)
If the VG itself is not large enough, it can also enlarge the VG
[Email protected] ~]# vgextend mail_store (expand Who)/dev/vda5 (from which to expand)
Logical Volume reduction:
[Email protected] ~]# Umount/media
[Email protected] ~]# Resize2fs-p-D 2/dev/mail_store/mail 1G (Zoom out 1G)
[[email protected] ~]# e2fsck-f/dev/dev/mail_store/mail (check disk before shrinking)
[Email protected] ~]# lvreduce-l 1g/dev/mail_store/mail
[[email protected] ~]# lvchange-an/dev/mail_store/mail (offline)
[[email protected] ~]# Lvchange-ay/dev/mail_store/mail (production mode)
[[email protected] ~]# mount-a (re-mount)
Logical Volume Snapshot:
[Email protected] ~]# umount/media/
[[email protected] ~]# lvcreate-s-L 100m-n Homebak/dev/vgsrv/home (to whom backup)
--------LVs will come out one more Homebak
[Email protected] ~]# Mkdir/mnt/homebak
[Email protected] ~]# Mount-o Ro/dev/vgsrv/home/mnt/homebak
--------Modifying the home directory
[Email protected] ~]# tar Zcvf/backup/homebak.tar.gz/mnt/homebak
[Email protected] ~]# Umount/mnt/homebak
[Email protected] ~]# Lvremove/dev/vgsrv/home
Lvm-cow Realistic Backup