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 like the term rocket surgery, I will steal it from you for sure.
Takeover.sh – Wipe and reinstall a running Linux system via SSH without reboot
31–40 of 80 posts
Re: Takeover.sh – Wipe and reinstall a running Linux system via SSH without reboot
#32In short, the answer details how to switch your running system to use an in-memory only root filesystem, without restarting. This allows installing a new OS, resizing the OS disks, etc.
It's a risky operation, but the linked answer covers many pitfalls that you might run into - I recently used it to shrink the root partition on a remote server, very much appreciated the detail.
Re: Takeover.sh – Wipe and reinstall a running Linux system via SSH without reboot
#33This 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
What's interesting about takeover.sh, though, is that it goes a step further and causes the chrooted system to actually replace an existing OS without a reboot and (theoretically) without involving additional boot media.
Re: Takeover.sh – Wipe and reinstall a running Linux system via SSH without reboot
#34Re: Takeover.sh – Wipe and reinstall a running Linux system via SSH without reboot
#35Earlier quoted context omitted.
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.
Re: Takeover.sh – Wipe and reinstall a running Linux system via SSH without reboot
#36removed. No delete on HN comments? interesting
Re: Takeover.sh – Wipe and reinstall a running Linux system via SSH without reboot
#37Re: Takeover.sh – Wipe and reinstall a running Linux system via SSH without reboot
#38Pretty 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…
Re: Takeover.sh – Wipe and reinstall a running Linux system via SSH without reboot
#39Earlier quoted context omitted.
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.
You can ditch the initrd if you compile in the kernel the drivers you need to boot the system, as a minimal example SATA/SCSI, EXT4/JFS, that usually are compiled as kernel modules.
Build a kernel with the most common hardware built into it, and use that to bootstrap. No need for messy things like balled up temporary rootfs in a ram drive.
Initrd/initramfs have become an excuse for piling on complexities that frankly should be added by the sysadmin after initial install.
Re: Takeover.sh – Wipe and reinstall a running Linux system via SSH without reboot
#40removed. No delete on HN comments? interesting
You can delete comments but only up until a certain amount of time has passed, I think. I've been able to do it.