Live data from Hacker News

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

github.com

21–30 of 80 posts

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

#21
post #17

Seeing if I understand what this is doing: this keeps running the same Linux kernel and kernel modules, but swaps out absolutely everything else up to and including the init system - is that right?

More precisely, what it does is start a new init system on a pseudofilesystem, starts an sshd chrooted to that new system, and lets you then login there, where you can then, if you want, umount the original root fs, wipe it, install a new os, then reboot the system.

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

#23

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.

Which is fundamentally how an installer works already.

Look up the chroot-install method for Debian/Ubuntu, as an example of this in a user-accessible manner. The process uses debootstrap, but as I understand was originally developed via a chroot shell on a running system and either partition or ramdisk-based bootstrapping of a new system.

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

#24

Earlier quoted context omitted.

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

I was thinking the exact same thing.

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

#26
This is conceptually similar to the chroot installation method, which has been a documented, if not entirely standard, method on Debian for quite some time.

https://www.debian.org/releases/stable/amd64/apds03.html.en

https://wiki.debian.org/chroot

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

#29
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

Something like this has been my default way of installing Linux for years - and I've installed Debian, Ubuntu (with debootstrap), Gentoo and Arch this way. Typically I just create another partition to my LVM volume group, chroot and install over there and then reboot without removing the old OS install and I run the install procedure from the old OS (instead of booting from a Live CD / usb stick).

I do this because I know it works and there's no guesswork involved in what the OS installer does. They aren't really intended for installing beside another system and the default partitioning options aren't always that great (RAID, LVM, crypto, etc).

Basically you only need 3 things to run Linux: kernel, initramfs and rootfs.

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

#30
post #29
post #7

Earlier quoted context omitted.

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

Something like this has been my default way of installing Linux for years - and I've installed Debian, Ubuntu (with debootstrap), Gentoo and Arch this way. Typically I just create another partition to my LVM volume group, chroot and install over there and then reboot without removing the old OS install and I run the install procedure from the old OS (instead of booting from a Live CD / usb stick). I do this because I…

You really only need two (kernel and initrd/initramfs), at least to get into a basic running state. This requires building your own initrd, of course, but it's pretty common in non-graphical Linux installers (Slackware's install media still does this, IIRC).

I think it's even possible to embed the initrd in the kernel binary itself, but I've never really investigated that.

Post reply on HN