Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to create and restore lvm disk Snapshot

Shulou Source: shulou.com Published: 2022-05-31 16:17:17 09月21日 Update

This article mainly introduces how to achieve lvm disk snapshot creation and recovery, the article is very detailed, has a certain reference value, interested friends must read it!

Default logical volumes, volume groups have been created.

Metadata file: # Xen 4.6vmServer Configuration

Bios = "seabios"

Builder = "hvm"

Boot = "cd"

Pae = 1

Acpi = 1

Acpi_s3 = 1

Acpi_s4 = 1

Apic = 1

Hap = 0

Viridian = "all"

Rtc_timeoffset = 0

Localtime = 0

Xen_platform_pci = 1

On_poweroff = "destroy"

On_reboot = "restart"

On_crash = "restart"

Usb = 1

Usbdevice = "tablet"

Soundhw = "hda"

Parallel = "none"

Serial = "pty"

Vga = "stdvga"

Opengl = 1

Sdl = 0

Vnc = 1

Vncunused = 0

Vnclisten = "0.0.0.0"

# variable parameter

Name = "server_yxef445nq83m04xy"

Uuid = "9a7f8d39-315f-4de8-a153-154988ded4b0"

# maxmem = 16284

Memory = 1024

Vcpus = 2

Vcpu_avail = 8

Vncdisplay = 4100

Vncpasswd = "736B2Z"

Vif = ["mac=00:16:3e:57:05:95,bridge=xenbr0,rate=2Mb/s", "mac=00:16:3e:b9:28:02,bridge=xenbr1"]

Disk = ["phy:/dev/mapper/vg0-newlv,sdc,w", "phy:/dev/mapper/vg0-server_yxef445nq83m04xy_sdb,sdb,w", "tap2:/storage/vdisk/server_yxef445nq83m04xy_sda,sda,w", "file:,sdd:cdrom,r"]

Sda is a normal file type disk as a system disk, sdb and sdc are block file disks respectively. Sdc is the block disk added by itself, which is used in this test.

Mount the sdc disk

a. Format sdc into an ext3 file system

Mkfs.ext3 / dev/sdc

b. Set up a mount directory

Mkdir / data/

c. Mount the disk / dev/sdc to the / data directory

Mount / dev/sdc / data

d. Automatically mount / dev/sda and edit / etc/fstab file when the system starts

Vi / etc/fstab

Such as:

/ dev/VolGroup00/LogVol00 / ext3 defaults 1 1

LABEL=/boot / boot ext3 defaults 1 2

Tmpfs / dev/shm tmpfs defaults 0 0

/ dev/sdc / data ext3 defaults 0 0

Devpts / dev/pts devpts gid=5,mode=620 0 0

Sysfs / sys sysfs defaults 0 0

Proc / proc proc defaults 0 0

/ dev/VolGroup00/LogVol01 swap swap defaults 00

Create a snapshot:

Lvcreate-s-n snap-L 50m / dev/mapper/vg0-newlv

Turn off the virtual machine

Perform a snapshot reply

Lvconvert-merge / dev/vg0/snap

Restart the virtual machine. Vnc connection. Snapshot restore.

These are all the contents of the article "how to create and restore lvm disk snapshots". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Tags: Disk snapshot file system content catalog article general value interest guy partner data more agency format knowledge type industry information Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Microsoft MySQL vpn NVidia Shulou Technology