3 ms·
Well, it is not like I didn't do any stupid things in the past, but booting into to a different OS (live system) with such a setup is obviously risky. I am a b
by arendtio 8y ago
Well, it is not like I didn't do any stupid things in the past, but booting into to a different OS (live system) with such a setup is obviously risky.
I am a bit conservative when it comes to backups and I do not trust myself very much. So I am doing backups on the block device level to avoid not copying certain file types, file attributes or whatever feature the filesystem in question posses.
In order to avoid, risky OS reboots, I am using lvm snapshots like this:
# sync the filesystem to disk
sync
# create a snapshot with a 10GB buffer
lvcreate -L10G -s -n "$snapshot" "/dev/vg/$lv"
# write the backup to a backup disk
dd if="/dev/vg/$snapshot" of="/mnt/backups/lvm-vg-${lv}_backup-$(date +%Y%m%d).dd" bs=64k
# remove the snapshot
lvremove -f "/dev/vg/$snapshot"
That method is certainly not perfect, as you are still taking the backup with a mounted FS in place and the snapshot size must be adapted to the use-case, but in the end, this is a method to create backups which are complete (independent of FS), easily accessible (e.g. mount via loop device) and do not interrupt the service.