You are not logged in.
I've made a backup using borg to my local server, using the script below (note the excluded folders).
#!/bin/sh
# Setting this, so the repo does not need to be given on the commandline:
export BORG_REPO=ssh://borg@192.168.1.100/volume1/Backup/ArchLinux
# Setting this, so you won't be asked for your repository passphrase:
export BORG_PASSPHRASE=''
# or this to ask an external program to supply the passphrase:
#export BORG_PASSCOMMAND=''
# some helpers and error handling:
info() { printf "\n%s %s\n\n" "$( date )" "$*" >&2; }
trap 'echo $( date ) Backup interrupted >&2; exit 2' INT TERM
info "Starting backup"
# Backup the most important directories into an archive named after
# the machine this script is currently running on:
borg create \
--verbose \
--list \
--stats \
--show-rc \
--compression lz4 \
--exclude-caches \
--exclude '/home/*/Downloads' \
--exclude '/home/*/.cayche' \
--exclude '/home/*/VirtualBox VMs' \
--exclude '/var/cache' \
--exclude '/var/tmp' \
--exclude '/var/run' \
--exclude '/var/lib/lxcfs' \
--exclude '/dev' \
--exclude '/lost+found' \
--exclude '/mnt' \
--exclude '/proc' \
--exclude '/run' \
--exclude '/sys' \
--exclude '/tmp' \
\
::'{hostname}.{now:%Y-%m-%d}' \
/ \
backup_exit=$?
info "Pruning repository"
# Use the `prune` subcommand to maintain 7 daily, 4 weekly and 6 monthly
# archives of THIS machine. The '{hostname}-' prefix is very important to
# limit prune's operation to this machine's archives and not apply to
# other machines' archives also:
borg prune \
--list \
--prefix '{hostname}-' \
--show-rc \
--keep-daily 7 \
--keep-weekly 4 \
--keep-monthly 6 \
prune_exit=$?
# use highest exit code as global exit code
global_exit=$(( backup_exit > prune_exit ? backup_exit : prune_exit ))
if [ ${global_exit} -eq 1 ];
then
info "Backup and/or Prune finished with a warning"
fi
if [ ${global_exit} -gt 1 ];
then
info "Backup and/or Prune finished with an error"
fi
exit ${global_exit}To test if the backup is working correctly I've been trying to restore the system on a virtualbox installation of Arch.
Here are the steps I've gone through;
1. Boot from arch iso - mount my new fs to /mnt,
2. Run pacstrap /mnt filesystem to get all folders in place.
3. Mount boot and home partitions to /mnt/boot and /mnt/home
4. Run mkinitcpio -p linux from chroot in /mnt
5. Run refind-install in chroot and make sure that refind_linux.conf in /mnt/boot has the correct part UUID for the VM storage.
6. Exit chroot and run genfstab /mnt > /mnt/etc/fstab to create a new file for the VM.
7. Finally exit the live media and boot from VM storage.
At this point the machine wont boot up Arch, it just gets stuck right at the start with the text "Booting..."
What am I missing here?
Last edited by 7thSon (2017-10-25 11:48:24)
Offline
Moved, by request.
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way
Offline
I solved this by enabling EFI in VirtualBox and reinstalling rEFInd on the boot partition.
Offline