Hacker News new | ask | show | jobs
by qrmn 3797 days ago
I've experimented with doing this kind of thing myself, especially with servers where I don't have ready access to the console and where the provider doesn't offer custom ISO support and I wanted a clean (and/or customised) install, perhaps of something not yet supported.

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.

5 comments

> dd if=install.iso of=/dev/sda - right over the top of the partition table and everything.

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.

How does something like the Arch Linux installer handle being "overwritten" as it installs? Or do you skip the first ~700mb of the drive when installing?
Interesting approach, skipping the space. But I think it would be simpler to just start with whatever's configured on the install disc. It's a pretty normal archlinux install, just need to change the passwords.
There's no need for an ISO image. Just prepare the system on either bare metal or a virtual machine, then tar the entire disk to a file, transfer and feed that file to dd instead. Of course, make sure you use the same (or smaller, but you'll have to claim unused space later) disk size, and be careful when choosing partition table type and aligning partitions.
> 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.

Don't forget Gentoo! That's precisely how they installed it.

You don't even have to copy the installer, you can just copy an existing install in-place (just as you'd copy an image to a Raspberry Pi SD card).