snapshots initial

This commit is contained in:
teldra 2021-03-13 12:25:43 +01:00
parent 187fcf7643
commit 0da7408f9d
3 changed files with 20 additions and 3 deletions

View File

@ -98,7 +98,7 @@ btrfs subvol create "${dest}/void-rootfs"
btrfs subvol create "${dest}/home"
umount "${dest}"
mount "/dev/mapper/voidvg.${diskid}-root" "${dest}" -o subvol=void-rootfs
for i in boot home dev proc sys tmp etc var/lib/backup var/db; do mkdir -p "${dest}/${i}"; done
for i in boot home dev proc sys tmp etc var/lib/backup/quelle var/db; do mkdir -p "${dest}/${i}"; done
mount "/dev/mapper/voidvg.${diskid}-root" "${dest}"/home -o subvol=home
if [[ "${cfg[fde_key_store]}" == "once" ]]; then
mkfs.btrfs -q -f "${target_boot}"

View File

@ -28,9 +28,11 @@ sed -i '/^if/i [ "$(id -u)" -eq 0 ] && return' "${dest}"/etc/profile.d/zz-locale
{ echo "tmpfs /tmp tmpfs defaults,nosuid,nodev 0 0";
echo "/dev/mapper/voidvg.${diskid}-root / btrfs defaults,subvol=void-rootfs 0 0";
echo "/dev/mapper/voidvg.${diskid}-root /home btrfs defaults,subvol=home 0 0";
echo "/dev/mapper/voidvg.${diskid}-swap swap swap defaults 0 0"; } > "${dest}"/etc/fstab
echo "/dev/mapper/voidvg.${diskid}-swap swap swap defaults 0 0";
echo "/dev/mapper/voidvg.${diskid}-root /var/lib/backup/quelle btrfs defaults 0 0"; } > "${dest}"/etc/fstab
[[ "${cfg[fde_key_store]}" == "once" ]] && echo "UUID=${cfg[bootuuid]} /boot btrfs defaults 0 0" >> "${dest}"/etc/fstab
mkdir -p "${dest}"/etc/sudoers.d
{ echo 'Defaults timestamp_timeout=15';
echo 'Defaults !tty_tickets';
@ -81,4 +83,19 @@ if [[ ! ${cfg[fde_key_store]} == "none" ]]; then
fi
fi
echo "transaction_log /var/log/btrbk.log" > "${dest}"/etc/btrbk/btrbk.conf
echo "lockfile /tmp/btrbk.lock" >> "${dest}"/etc/btrbk/btrbk.conf
echo "stream_buffer 512m" >> "${dest}"/etc/btrbk/btrbk.conf
echo "incremental yes" >> "${dest}"/etc/btrbk/btrbk.conf
echo "btrfs_commit_delete after" >> "${dest}"/etc/btrbk/btrbk.conf
echo "timestamp_format long" >> "${dest}"/etc/btrbk/btrbk.conf
echo "noauto yes" >> "${dest}"/etc/btrbk/btrbk.conf
echo "volume /var/lib/backup/quelle/" >> "${dest}"/etc/btrbk/btrbk.conf
echo " group snapshot all" >> "${dest}"/etc/btrbk/btrbk.conf
echo " snapshot_dir snapshot" >> "${dest}"/etc/btrbk/btrbk.conf
echo " snapshot_preserve_min latest" >> "${dest}"/etc/btrbk/btrbk.conf
echo " snapshot_preserve no " >> "${dest}"/etc/btrbk/btrbk.conf
echo " subvolume void-rootfs" >> "${dest}"/etc/btrbk/btrbk.conf
echo " subvolume home" >> "${dest}"/etc/btrbk/btrbk.conf
module end

View File

@ -12,7 +12,7 @@ setconf add "lang_console" "de-latin1-nodeadkeys"
setconf add "timezone" "Europe/Berlin"
addpkg base-system void-repo-multilib void-repo-multilib-nonfree void-repo-nonfree btrfs-progs lvm2 cronie socklog-void ntp xtools sudo wireguard-tools gnupg2 progress pwgen net-tools ncdu nmap mtr iotop hdparm smartmontools htop git neovim
addpkg base-system void-repo-multilib void-repo-multilib-nonfree void-repo-nonfree btrfs-progs lvm2 cronie socklog-void ntp xtools sudo wireguard-tools gnupg2 progress pwgen net-tools ncdu nmap mtr iotop hdparm smartmontools htop git neovim btrbk
ignorepkg nvi
servicesenable acpid cronie socklog-unix nanoklogd uuidd
servicesdisable agetty-tty6 agetty-tty5