[TriLUG] CentOS 6+LVM Snapshots == Strange Rollback Issues

Brian Weaver cmdrclueless at gmail.com
Fri Oct 26 15:25:07 EDT 2012


I've been working with LVM2 on CentOS 6, trying to automate system
upgrades by creating a snapshot of the root partition so that it can
be undone in the case of a fatal error. I'm seeing what I would
consider very strange behavior and I'm wondering if anyone on the list
has some insight.

First off I create the LVM snapshot by using 'lvcreate -p rw -s -n
rb_root --addtag @rollback -l $extents /dev/vgdata/root'. Then I
preform my RPM upgrade. For testing purposes I then try to rollback
the changes by using 'lvconvert --merge @rollback'. Since the origin
volume is still open I have to reboot to start the merge process.

When the system reboots I get errors about bad blocks on dm-3 (which
is rb_root). Even though before the reboot the amount of space uses in
the snapshot was less than 30%. Once booted the files appear OK, and
an 'rpm -qa --verify' only shows changes to mostly configuration
files. The strange problem is that when I look under /etc I see lots
of .rpmsave files that were *not* there before the upgrade. I don't
understand why I would see those files if the system were truly
rolling back the changes from the snapshot volume.

It almost seems like LVM is rolling back changes on files that were
already there, and merging in new files that weren't there before. The
system is running EXT4 as the root partition, which shouldn't matter
since LVM deals with disk blocks and not filesystem level data.

Any ideas?

-- Brian

-- 

/* insert witty comment here */



More information about the TriLUG mailing list