[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[linux-lvm] Which size for snapshot volume for a *safe* backup?


I want to use LVM snapshots to create consistent backups.

Given an original logical volume of size "n" Bytes (or chunks or extents
or whatever you need for calculating it), how large in
Bytes/chunks/extents must the appropriate snapshot volume be in order to
retain the complete original logical volume in case the latter gets
completely overwritten?

For testing, I used a 320 k logical volume on a VG on a PV comprising of
a 1 MiB loop-back file of and created an equally sized snapshot volume.

While the snapshot worked perfectly with only overwriting half the
original volume, it bailed out when overwriting the whole original
volume; accessing the snapshot volume with "dd" after that
overwrite produced the following:

  Buffer I/O error on device dm-6, logical block 0
  (blocks 0-15)

So, obviously,

  snapshot volume size = original volume size

is not sufficient to hold a complete change of the original volume.

Btw.: There's a bug in "lvscan", it still displayed the snapshot
as being "ACTIVE", while in fact (at least that's what I concluded),
it was "INACTIVE" due to the lack of space, as shown using "lvdisplay".

Oh, and another small bug:

  For a file with 256 kiB bound to a loop device, pvcreate says

    /dev/loop/0: Size must exceed minimum of 1024 sectors.
    Failed to setup physical volume "/dev/loop/0"

  But for files smaller than that (like 512 bytes), it erronously

    Device /dev/loop/0 not found

Best regards


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]