Lvm-cow Realistic Backup

Source: Internet
Author: User


[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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.