While I did have some success with in-place install shenanigans, I eventually settled on creating a customised install ISO for the distribution I wanted (with a script to have it automatically listening for remote shell connections, and so on), using isohybrid on the ISO (which makes the ISO's first sector also a bootable MBR), and then simply dd if=install.iso of=/dev/sda - right over the top of the partition table and everything.
It's inelegant, to say the very least, but it works just fine! I'm pretty sure I saw that technique used a few times during Twitch Installs Arch Linux, during the more exotic segments when some joker hijacked the effort temporarily by installing Windows 95, and TempleOS, and so on.
I do the same thing. Then reboot and use fdisk to delete the main partition and recreate it again, except this time using all the available space of install drive. Then resize2fs to expand the filesystem.
Don't forget Gentoo! That's precisely how they installed it.
Saying "I'm doing this this weekend!" doesn't contribute anything, there's no information of value to be gained from it, nothing to learn, nothing to think about. It was a waste of time to post. So it gets downvoted so the rest of us don't have to spend a second reading a useless comment.
All those useless seconds add up. The downvotes make us all better off in the long run.
[0]: http://www.daemonology.net/blog/2008-01-29-depenguinator-2.0...
It's been extended in some interesting ways, including unattended remote installations. Debian's inherehent flexability is impressive in this regard.
I wonder if this is possible with Windows at all?
reboot # And pray it'll boot.
My success rate with such projects is sufficiently low that I only attempt it when I have no other option. And that's for Debian -> Debian bootstrapping. Most of the time I manage to fumble a crucial parameter and the boot fails. I wouldn't even think of doing this remotely except as a challenge.
But that's not to mean you shouldn't try it for the fun of it!
Is there any actual utility to scripting such a thing? I'm a strange person who enjoys distro-hopping and setting up PXE servers and such, so it seems like something I'd try.
works on everything I've thrown it at so far
The OP: Instructions to replace a live Debian installation with Arch
(Emphasis mine)
Edit: looks like the scripts / source to create the AMI are available so you could build it yourself if you wanted. Bonus points if you can build it on an EC2 spot instance and deploy it, CI/CD style.
Let's do this in production.
> reboot # And pray it'll boot.
This kind of thing should be performed by a well-tested script, not an interactive session. Otherwise you might have an "Oh, what did I just type?" moment.
http://www.daemonology.net/blog/2008-01-29-depenguinator-2.0...
Works on DigitalOcean etc.
Switch those two out with appropriate sed or echo commands, add a bash shebang at line 1, and baby, you've got a stew going!
# Restart sshd in the new root.
cp /mnt/etc/ssh/* /etc/ssh
killall -HUP sshd
# You'll have to reconnect at this point. Let's hope it works.
Use a dead man's switch: set an 'at' job to undo everything in 10 minutes. If you screw up and get disconnected, the at job runs.ps: I was completely blind to that vim statement just above. Ha, humans.
pps: also learned about mount --move and pivot_root from util_linux.
Mostly, the non-user parts are /etc /boot /usr and /var (for package management), and things aren't always in the same places and conf files may vary in options because of version/patch differences.
Using symlinks and seperate directories, it's theoretically possible to switch OSes at boot time assuming everything is symlink-agonistic (stow for operating systems)
It's possible and rarely necessary except for personal playgrounds but a production box would follow 12factors standards and lifecycle the entire OS by switching the underlying base image with something like unionfs + hypervisor.
Lots of ways to shoot yourself in the feet, and in box rebuilds it's usually much faster to just start fresh and deploy using configuration management than try to hammer a bank into the shape of plane.
Definitely make verified backups before attempting a lobotomy on anything real.