Skip to content

Re Imaging a server

skyper edited this page Jul 3, 2023 · 2 revisions

install Debian (or any other OS) on the remote server at an ISP without rescue system.

apt install -y grml-rescueboot
update-grml-rescueboot

http://grml.org/cheatcodes/

echo 'CUSTOM_BOOTOPTIONS="ssh=SECRETPASS toram debnet"' >> /etc/default/grml-rescueboot
update-grub
grub-reboot 2
update-grub
reboot

ssh root@ip

tmux #^a + command

wget https://boot.netboot.xyz/ipxe/netboot.xyz.iso
# or
mkdir /mnt/ramdisk
mount -t tmpfs -o size=2000m tmpfs /mnt/ramdisk
cd /mnt/ramdisk
wget url.iso
lsblk

qemu-system-x86_64 \
    -enable-kvm \
    -m 4000M \
    -net nic -net user \
    -cpu host,nx \
    -M pc \
    -smp 2 \
    -vga std \
    -drive file=/dev/sda,format=raw,index=0,media=disk \
    -vnc :0,password=on \
    -monitor stdio \
    -cdrom netboot.xyz.iso \
    -boot d

change vnc password SECRET12 # 8 simbol

  • vnc connect to install, load - os
  • do not reboot the main system, first change the network settings to the ones you need and the names of the stem interfaces (perhaps they will be called differently than in the main system, you can check if you start the live sd with the desired system before installation.) on a newly installed system. you can do everything in the same place in vnc in a virtual machine, or by mounting a partition.
  • if nothing happened before installation, just reboot the system and the previous item in the boot menu will be loaded. if, as a result, nothing works, set the preset from the server parenel and try again.

By loki.

Clone this wiki locally