Home > linux > How to keep or drop LVM snapshot?

How to keep or drop LVM snapshot?

September 27Hits:2
Advertisement

I have made an LVM snapshop by

lvcreate --name snap --size 10G -s /dev/vg00/vm 

What command should I write if I want to drop the snapshot, and not keep the changes that have happened since the snapshot?

And what command should I write to roll the changes from the snapshot into /dev/vg00/vm ?

Answers

to drop snapshot use:

lvremove group/snap-name

to merge snapshot use:

lvconvert --merge group/snap-name

Though merging will be deferred until the orgin and snapshot volumes are unmounted. You may need to update kernel (>=2.6.33) and lvm tools to have support for merging.

Looks like this has been asked before:

http://serverfault.com/questions/128878/linux-lvm-snapshot-commit-or-revert

As well as:

http://www.jonnor.com/2010/02/lvm-snapshot-merging-avaliable/

OK, first of all: the grand old LVM1 supported only read-only snapshots. In that case the modifications were copied to original image after unmounting the snapshot. LVM2 provides support for read-write snapshots, allowing you to do funkier stuff with virtual machine images and stuff like that.

Novell has a very niece piece of documentation about the concept of using LVM for rolling back a failed OS update. Take a look at that article, it provides all the bits and pieces you need for your case.

you can use lvremove command to remove the old snapshot files:

lvremove /dev/vg_brcvhost1/snap this will ask you to remove a sanpshot persent in the your LV.

other commands are also there for managing a LVM based VM setup.

you can find the details commands in the link below: http://linux.math.tifr.res.in/HOWTO/LVM-HOWTO/snapshots_backup.html

and the below link may also be usefull: http://dentarg.it64.com/content/lvm-based-backup-virtual-machines

Tags:linux, lvm, snapshot

Related Articles

  • How to keep or drop LVM snapshot?September 27

    I have made an LVM snapshop by lvcreate --name snap --size 10G -s /dev/vg00/vm What command should I write if I want to drop the snapshot, and not keep the changes that have happened since the snapshot? And what command should I write to roll the cha

  • LVM snapshots as a backup strategyJune 11

    How viable as a backup strategy would be periodical LVM snapshots of xen domU's? Pros, cons, any gotchas? To me it seems like the perfect solution for a fast, brainless restore. Any investigation could take place on the broken logical volume with dom

  • Is this how LVM snapshots work?July 15

    I'm trying to figure out how LVM snapshots work so I can implement it on my fileserver but I'm having difficulty finding anything on google that explains how it works instead of how to use it for a base backup system. From what I've read I think it w

  • Linux LVM snapshot commit or revert?April 2

    I'm about to perform an experimental upgrade on my CentOS 5 server. If the upgrade fails, I want to be able to back out the changes to the filesystem. This scenario seems similar to the example in Section 3.8 of the LVM HOWTO for LVM2 read-write snap

  • backing up MySQL living on a SAN using LVM snapshots. is this doable?October 2

    So I was looking into LVM snapshots and it seems like a feasible method for backing up mysql so that it's at least crash consistent. My issue is that I have mysql servers where the mysql data directories live on a SAN and I'd like to utilize the arra

  • Is it safe to copy DB files directly from an LVM snapshot?August 1

    I saw two different approaches for backing up database with LVM snapshot. This article suggests spawning another MySQL instance to do an SQL dump. MYSQL Performance Blog suggests that it is safe to copy directly the database files: 6) Copy data to ba

  • Difference between fsfreeze and lvm snapshotSeptember 23

    I heard recently about fsfreeze and I'm very interested in making snapshots of my VM with VMware and get a consistent state of disk using quiescence. All my file-systems are LVM volumes, and man fsfreeze mentions: fsfreeze is unnecessary for device-m

  • Sync LVM snapshots to backup serverJune 17

    I have a number of Xen virtual machines running on a number of Linux servers. These VMs store their disk images in Linux LVM volumes with device names along the lines of /dev/xenVG/SERVER001OS and so on. I'd like to take regular backups of those disk

  • Using LVM snapshots for KVM virtual machine clonesJuly 29

    So, I've got a pretty awesome KVM setup running now, CentOS5.5 on the host and guest domains, libvirt managing all the configuration, etc. The guest domain filesystems are stored in LVM on top of a hardware RAID5 volume, so I have flexibility for bac

  • LVM snapshot keeps changing file timestampsOctober 25

    I searched the web but did not find any info about this. I'm mounting an LVM snapshot and I notice the timestamps of the files there keep changing. I though LVM snapshot was a one time freeze in time w/ write on copy of the original partition, so the

  • Should I be using LVM snapshots along with rsnapshot?February 2

    I manage a CentOS 4.8 server for a small workgroup. Last year I converted the filesystem to LVM over software RAID (RAID 1, two mirrored drives). I now have the following filesystems on LVM/RAID: /dev/mapper/vg-home 619G 231G 358G 40% /home /dev/mapp

  • XFS I/O Error accessing Logical Block 0 of an LVM snapshot: is the drive or snapshot bad?February 9

    I have OpenSuSE 11.3 running as a Xen host on a machine with 8x296GB Cheetah 15k.6 SAS disks, 4 of which are mirrored, the other 4 striped. I'm using LVM to manage the disks and they are formatted with OCFS2. I configured a Xen domU as a Logical Volu

  • Using LVM snapshots on a live system: possibility of corruption due to system activityFebruary 16

    If I am doing backups from LVM snapshots of a live system, how can I best avoid problems due to the snapshot being taken during things like upgrades? Presumably this wouldn't be catastrophic, since it would be less serious than a power outage during

  • Are there any possible impacts of using LVM snapshotsMarch 25

    I am trying to design a MySQL database backup and recovery policy (Linux OS) for my company. I am looking at the LVM snapshot as a full backup solution plus binary logs rotation as an incremental. My environment is as following: XenServer 5.6 connect

  • At what point do you stop using mysqldump and start doing LVM snapshot?March 26

    I know that the cornerstone of mysql backup is mysqldump which works for all engines. I also see that some folks advocate the use of LVM snapshots. What would be the point at which you stop using mysqldump and start creating LVM snapshots? Is mysqldu

  • Using LVM Snapshot To Backup Database ServersApril 5

    Could we use LVM snapshots to backup database servers? Or we can only use it for file system backups? --------------Solutions------------- In my experience, yes. The essence of the process is getting the database into a position where the on-disc con

  • LVM snapshots vs. file system snapshotsAugust 14

    As far as I know, LVM makes it possible to take snapshots of a volume. There are also a number of file systems (ZFS, Btrfs, reiserfs, ...) which supports snapshots. However, I've never understood the difference between LVM snapshots and file system s

  • Using Linux LVM snapshots for system backups - "semop failed for cookie" errorSeptember 13

    I'm running Ubuntu 11.04, with the / partition in an encrypted LVM volume. /home is in the same logical volume. I'm trying to use the LVM snapshot functionality to enable time-consistent backups of the running system. I left over 500MB of unpartition

  • LVM snapshot missing /dev and /proc treeOctober 27

    I created a lvm snapshot like so: lvcreate -L 5G -s -n root-snapshot /dev/VolGroup00/LogVol00 Then I mounted the snapshot like so: mount /dev/VolGroup00/root-snapshot /mnt/root-snapshot/ Now, when I see what's in the dev tree in the snapshot, almost

  • SQL Server recovery with LVM snapshot as baseOctober 31

    Is it possible to fully recover a database from a snapshot plus transaction log backups? By snapshot I mean a crash-consistent clone of the Server - in this case an LVM snapshot that is shipped offsite while the live server continues to operate and g

Copyright (C) 2018 ceus-now.com, All Rights Reserved. webmaster#ceus-now.com 14 q. 0.330 s.