diff options
Diffstat (limited to 'bin')
| -rwxr-xr-x | bin/byo | 6 | ||||
| -rwxr-xr-x | bin/repairboot | 14 |
2 files changed, 18 insertions, 2 deletions
@@ -2,7 +2,7 @@ # Backup to yoda [ "$USER" = root ] || exec sudo "$0" "$@" -usage='Usage: byo [-cdk] +usage='Usage: byo [-cdk] [/dev/sda2] Backup local disk to yoda external disk. Options: @@ -19,10 +19,12 @@ while getopts :Ccdk opt; do done shift $((OPTIND - 1)) +dev=$1 yoda_uuid='8c463221-6bb7-414e-9060-c9570bb3a6bb' +[ "$dev" ] || dev=$(blkid --uuid "$yoda_uuid") dest=/mnt/backup/$(hostname) -[ -b /dev/mapper/yoda ] && noclose=1 || cryptsetup open "$(blkid --uuid "$yoda_uuid")" yoda +[ -b /dev/mapper/yoda ] && noclose=1 || cryptsetup open "$dev" yoda findmnt /dev/mapper/yoda /mnt >/dev/null && noumount=1 || mount /dev/mapper/yoda /mnt time backup -v -d "$dest" [ ! "$optC" ] || backup -v -d "$dest" clean diff --git a/bin/repairboot b/bin/repairboot new file mode 100755 index 0000000..6cb9bb4 --- /dev/null +++ b/bin/repairboot @@ -0,0 +1,14 @@ +#!/bin/sh -ex + +# Repair boot from yoda (for acer swift5) + + +[ "$USER" = root ] || exec sudo "$0" "$@" + +cryptsetup open /dev/nvme0n1p2 swift +mount /dev/mapper/swift /mnt +mount /dev/nvme0n1p1 /mnt/boot + +arch-chroot /mnt << EOT +bootctl --path=/boot install +EOT |
