Skip to content

Commit

Permalink
proxmox: wip restore rootfs
Browse files Browse the repository at this point in the history
  • Loading branch information
koush committed Aug 6, 2024
1 parent f1bebd0 commit d4b77ca
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions install/local/install-scrypted-proxmox.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ fi
if [ -n "$SCRYPTED_RESTORE" ]
then
RESTORE_VMID=$VMID
$VMID="10444 --force"
VMID=10444
pct destroy $VMID 2> > /dev/null
fi

echo "Downloading scrypted container backup."
Expand Down Expand Up @@ -81,18 +82,25 @@ else
echo "$CONF not found? Start on boot must be enabled manually."
fi

if [ -n "$RESTORE_VMID" ]
if [ -n "$SCRYPTED_RESTORE" ]
then
readyn "Running this script will reset Scrypted to a factory state while preserving existing data. IT IS RECOMMENDED TO CREATE A BACKUP FIRST. Are you sure you want to continue?"
if [ "$yn" != "y" ]
then
exit 1
fi

echo "Preparing rootfs reset..."
pct set 10444 --delete mp0
pct set 10444 --delete unused0
pct move-volume $RESTORE_VMID mp0 --target-vmid 10444 --target-volume mp0
# this copies the

This comment has been minimized.

Copy link
@RSully

RSully Aug 20, 2024

This sentence needs an end :)

pct set 10444 --delete mp0 && pct set 10444 --delete unused0 && pct move-volume $RESTORE_VMID mp0 --target-vmid 10444 --target-volume mp0

rm *.tar
vzdump $RESTORE_VMID --dumpdir /tmp
vzdump 10444 --dumpdir /tmp
VMID=$RESTORE_VMID
echo "Moving data volume to backup..."
pct restore 10444 *.tar $@
pct restore $VMID *.tar $@

# todo: back to VMID...
pct destroy 10444
fi

echo "Adding udev rule: /etc/udev/rules.d/65-scrypted.rules"
Expand Down

0 comments on commit d4b77ca

Please sign in to comment.