Commit 160366c5 authored by Nils Knappmeier's avatar Nils Knappmeier

docs

parent 3e3c81e5
# Backup2l-Setup for Hetzner-Servers
# Hot-Backup for Hetzner-Servers with LVM-snapshots
This setup utilizes LVM-snapshots to get a consistent live-backup from a [Hetzner](hetzner.com) server.
This backup setup assumes the following fstab
......@@ -13,6 +16,11 @@ proc /proc proc defaults 0 0
`dev/vgmain/lvmain` is the partition of which the backup is created. There should be space available for a snapshot in the volume group.
## Going from plain SoftRAID-1 (mdadm) to SoftRAID-1 with LVM on the root partition.
The [Hetzner](hetzner.com) system I started with did not have lvm enabled by default. I am not sure if that was my decision or just the template
Have a look at ["Setting up LVM on a system with only a RAID1"](raid1-to-lvm.md)
## Setup
* Install backup2l and the cifs-utils.
......@@ -32,6 +40,6 @@ The following actions will be executed by `run-backup.sh`
* Remove all mounts below (or equal) `/media/lvmain-snapshot`
* Remove the LVM snapshot
The last two steps are implemented in a `trap` so that they are also executed, if the backup is aborted. They are also executed before everything else, if the snapshot volume already exists, before starting the backup.
The last two steps are implemented in a `trap` so that they are also executed, if the backup is aborted. They are also executed before everything else to cleanup left-over snapshot volumes in case of previous failures.
# Setting up LVM on a system with only a RAID-1
I have performed the following steps in order to get from a plain RAID-1 to a LVM-root-partition on the raid1.
**Attention: This is a write-down of the step I have performed. I haven't tested these exact instructions. In fact, I failed to execute them without errors and had to utilize the rescue system to get my system running again.**
The instructions might help other (and my future me) though, so I'm writing them down.
## 1. Determine the root partition and remove one discs
......@@ -19,7 +19,7 @@ function cleanup {
for i in $( mount | grep -o "${SNAPSHOT_MOUNT}[^ ]*" | sort -r ) ; do
umount "$i"
done
# remove the snapshot
# remove the snapshotgi
lvremove -f "${SNAPSHOT_LV}"
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment