-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbackup0_1.sh
More file actions
executable file
·30 lines (25 loc) · 1.16 KB
/
backup0_1.sh
File metadata and controls
executable file
·30 lines (25 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/bash
# system will not be bootable if there has been a kernel update, need to run pacstrap on top of the system to be able to boot
# I'd like to know what pacstrap does specifically to make things work so I can add it here (don't want to run all of pacstrap here)
if [ $EUID != 0 ]; then
sudo "$0" "$@"
exit $?
fi
#should add some check that this is only run from LINUX0
mkdir /mnt/LINUX1
mount /dev/nvme0n1p6 /mnt/LINUX1
rsync -aHAXSv --delete --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found","/home/*"} / /mnt/LINUX1
cat <<EOF > /mnt/LINUX1/etc/fstab
#
# /etc/fstab: static file system information
#
# <file system> <dir> <type> <options> <dump> <pass>
# /dev/nvme0n1p6 UUID=c31b27bf-7b61-43b7-a3fd-1870708b07ba
LABEL=LINUX1 / ext4 rw,relatime,data=ordered 0 1
# /dev/nvme0n1p8 UUID=73cfc5dc-59b6-408a-9d98-6755797c2ff4
LABEL=HOME /home ext4 rw,relatime,data=ordered 0 2
EOF
# arch changed from xz to zst
arch-chroot /mnt/LINUX1 pacman -U /var/cache/pacman/pkg/linux-$(pacman -Qii linux | grep Version | awk '{print $3}')-x86_64.pkg.tar.zst
umount /mnt/LINUX1
rm -r /mnt/LINUX1