0

I working on replacing an unstable btrfs snapshot based backup system. One of the option was to go ZFS but it's not natively in the kernel. XFS was reliable for me since 10 years but as my research shows it cannot do snapshots on it's own, people are using it in conjunction with LVM.

http://www.tecmint.com/take-snapshot-of-logical-volume-and-restore-in-lvm/

Now my biggest problem is that the snapshot (subvolumes) need a fix size also this seems to me that when you give 1G to a snapshot (no matter if it needs that much it will eat up unnecessarily that space).

Also if the snapshot size too small or the space on the xfs partition runs out I ran into all sorts of trouble:

  /dev/backup-vg/snap1: read failed after 0 of 4096 at 1073676288: Input/output error
  /dev/backup-vg/snap1: read failed after 0 of 4096 at 1073733632: Input/output error
  /dev/backup-vg/snap1: read failed after 0 of 4096 at 0: Input/output error
  /dev/backup-vg/snap1: read failed after 0 of 4096 at 4096: Input/output error
  /dev/backup-vg/snap2: read failed after 0 of 4096 at 1073676288: Input/output error
  /dev/backup-vg/snap2: read failed after 0 of 4096 at 1073733632: Input/output error
  /dev/backup-vg/snap2: read failed after 0 of 4096 at 0: Input/output error
  /dev/backup-vg/snap2: read failed after 0 of 4096 at 4096: Input/output error

How to solve this? Anyone knows a good case study/howto for implementing LVM based backup systems?

  • 1
    NOTICE: "snapshot based backup system" sounds interesting but likely it IS NOT a backup. Keep in mind snapshots are backups only after you copy the data elsewhere, otherwise a bad sector will destroy the only copy of the important file which does not change, or corruption in thin-pool metadata will break havoc in your data. – Martian Feb 2 '17 at 8:22
1

LVM thinly provisioned snapshots - lvmthin(7) - are dynamically allocated, so this might be an option. In my own benchmarks I found the performance of ext4+lvmthin to be considerably lower than btrfs for my backup applications.

Although XFS doesn't have native snapshots (yet?), it does now have reflink support (although this feature is still marked as experimental, it has been in the mainline kernel for over a year), so you may be able to put something together to similar effect using reflink copies (sub directory quotas may also help - depending on your use case) to create quick space-efficient backups.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.