-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreplace.sh
More file actions
executable file
·39 lines (28 loc) · 763 Bytes
/
replace.sh
File metadata and controls
executable file
·39 lines (28 loc) · 763 Bytes
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
31
32
33
34
35
36
37
38
39
#!/bin/bash
set -ex
. ./config.sh
. ./${RAID_EXPLORATION}/common.sh
if [[ -z "$REPLACE_DISKS_GLOB" ]]; then
echo "[!!] you MUST specify REPLACE_DISKS_GLOB before execution"
exit 1
fi
export REPLACE_MODE=1
./remove.sh
./partition.sh
if [[ "$BOOT_MODE" = "efi" ]]; then
for dev in "${REPLACE_EFI_DEVICES[@]}"; do
mdadm --add /dev/md/efi "$dev"
done
fi
./${RAID_EXPLORATION}/map.sh
./${RAID_EXPLORATION}/replace.sh
for ((i=${#REPLACE_DISKS_DEVICES[@]}-1; i>=0; i--)); do
disk="${REPLACE_DISKS_DEVICES[$i]}"
if [[ "$BOOT_MODE" = "efi" ]]; then
label="debian-${disk##/dev/}"
efibootmgr -c -g -d ${disk} -p 1 -L "$label" -l '\EFI\debian\grubx64.efi'
else
grub-install ${disk}
fi
done
./status.sh