Live data from Hacker News

Takeover.sh – Wipe and reinstall a running Linux system via SSH without reboot

github.com

11–20 of 80 posts

Re: Takeover.sh – Wipe and reinstall a running Linux system via SSH without reboot

#12
post #7
post #4

Pretty cool, although I'm pretty sure I would never use something like this. What has saved my skin on a number of occasions is the ability to boot remote servers into rescue mode and chroot into the broken system. That way you can use package managers, all your diagnostic tools, and everything else the boot image doesn't provide. Basically you just mount the different partitions and then chroot just swaps /proc /sys…

Haha yes, this is the default install procedure for Gentoo! :D

Arch also does it. The first time I encountered this was when I accidentally deleted my EFI partition and was unable to boot. Boot into live media, chroot, run grub-install and rejoice.

Re: Takeover.sh – Wipe and reinstall a running Linux system via SSH without reboot

#13

Somebody correct if I am wrong, but this script somehow allows the session to live in the RAM. Once the OS is running directly from the RAM, the hard drive can be wiped and a new OS can be installed. The system is then booted to run off of the hard drive.

This scripts creates another root, then substitutes /sbin/init using `mount --bind`, then reloads /sbin/init, which pivots into new root with fakeinit.

IMHO, systemd in container mode can be used instead of fakeinit.

Re: Takeover.sh – Wipe and reinstall a running Linux system via SSH without reboot

#14
post #8
post #5

Earlier quoted context omitted.

I like the term rocket surgery, I will steal it from you for sure.

If I'm not mistaken, credit goes to Chris Rock (who is not me).

Pretty sure the conflation has been around ever since rocket science and brain surgery have been used as a comparison. :)

Re: Takeover.sh – Wipe and reinstall a running Linux system via SSH without reboot

#15
post #8

Earlier quoted context omitted.

If I'm not mistaken, credit goes to Chris Rock (who is not me).

Pretty sure the conflation has been around ever since rocket science and brain surgery have been used as a comparison. :)

I don't tend to link youtube videos on HN, particularly of the comedic type, but I'm just going to leave this here for anyone who wants a good laugh for their morning.

https://www.youtube.com/watch?v=THNPmhBl-8I

Re: Takeover.sh – Wipe and reinstall a running Linux system via SSH without reboot

#16
post #10
post #4

Pretty cool, although I'm pretty sure I would never use something like this. What has saved my skin on a number of occasions is the ability to boot remote servers into rescue mode and chroot into the broken system. That way you can use package managers, all your diagnostic tools, and everything else the boot image doesn't provide. Basically you just mount the different partitions and then chroot just swaps /proc /sys…

I recommend to copy a rescue disk iso image or/and network installation image to boot partition and add it to GRUB menu. This way it is possible to boot into working environment without risk to damage root partition. https://wiki.archlinux.org/index.php/Multiboot_USB_drive

That usually doesn't work for remote servers because you can't access the grub menu over SSH and you want something that works even in those cases that grub or your boot record are trashed. So you just want to do a netboot from a generic rescue iso. Zero dependencies. Works even when your hard drives are severely damaged and you just need to /bin/dd some raw sectors.

Re: Takeover.sh – Wipe and reinstall a running Linux system via SSH without reboot

#18

I guess this could be really useful for installing distributions that are not available at some VPS providers.

Another trick to do that is to use the VPS's rescue mode, download qemu, and start it with the remote desktop / VNC console. Then, do the install from there. Poor man's IPMI.

Re: Takeover.sh – Wipe and reinstall a running Linux system via SSH without reboot

#19
post #12
post #7

Earlier quoted context omitted.

Haha yes, this is the default install procedure for Gentoo! :D

Arch also does it. The first time I encountered this was when I accidentally deleted my EFI partition and was unable to boot. Boot into live media, chroot, run grub-install and rejoice.

Yeah as an Arch user I've used it a few times where an pacman -Syu has caused something to break and it's pretty easy to chroot into your system and fix the broken package.
Post reply on HN