Live data from Hacker News

curl > /dev/sda: How I made a Linux distro that runs wget | dd

astrid.tech

31–40 of 70 posts

Re: curl > /dev/sda: How I made a Linux distro that runs wget | dd

#32

and we've gone full circle, back in the day you installed os on diskettes like that!

please insert diskette 34... now go back to diskette 2... now please put diskette 15 again....

That was Windows. Linux floppy-based installs usually just got through the whole series and then asked for disk 1 prior to reboot ..

Re: curl > /dev/sda: How I made a Linux distro that runs wget | dd

#33
post #8

Reminded me of how to install Alpine linux (which isn't available) on Oracle cloud over an ubuntu install. It uses dd and has the advantage of having a console. I had found it in a github gist when I used it but here's a similar blog post. https://alextsang.net/articles/20191006-063049/index.html

From what it sounds like, because you have a console and therefore aren't dependent on SSHD not getting overwritten, you can just dd the live running system here?

Re: curl > /dev/sda: How I made a Linux distro that runs wget | dd

#34
post #28

Why not just use netboot?

you may be in a restricted environment with no boot option selections, like on some VPS and dedi server providers.

i've seen similar techniques used to shove windows on "linux" VPS/dedis boxes by booting into rescue mode and then applying a raw Windows boot image that's preconfigured and rebooting back to the Windows install and hoping you stood the image up right.

good ol' days of getting Windows up on Kimsufi boxen.

Re: curl > /dev/sda: How I made a Linux distro that runs wget | dd

#35
This reminds me of netbooting workflows from things like MaaS, Tinkerbell, and Dan's old Plunder tool.

They'd netboot.. not mount the disks, then download an ISO/IMG and write it directly to the primary boot disk.

If netbooting is a heavy lift, why not boot into a custom initramfs you built, with i.e. dd/curl installed, and flash the disk that way, without mounting / at all? Then kexec/chroot into it?

I'd much prefer this as a way to provision Raspberry Pis.

Re: curl > /dev/sda: How I made a Linux distro that runs wget | dd

#36
post #30
post #4

Unfortunately it's not safe as the kernel can still write to (what it thinks is) the old filesystem on the device, which will introduce corruption to the new disk image. However a fun fact is that you can (do not actually do this!) boot a qemu VM from /dev/sda. You have to use an overlay (eg. qemu -drive snapshot=on flag) so that qemu won't write through to /dev/sda. I use this trick in supernested, a script I wrote…

I used to dual-boot windows, but I was too lazy to actually reboot, so naturally I had Virtualbox just boot the physical Windows partition while Linux was running. Which is totally fine! It's not a real dual boot if you don't boot both partitions at the same time. As long as you don't install guest VBox drivers, those would make it hang when it boots as the host on physical hardware, since there's no longer someone a…

Yeah. That is a valid use. I mean, this is how I installed Windows to begin with, from Linux via QEMU, onto my other hard drive. I did reboot and test it out, and it worked just fine.

Re: curl > /dev/sda: How I made a Linux distro that runs wget | dd

#37
post #30
post #4

Unfortunately it's not safe as the kernel can still write to (what it thinks is) the old filesystem on the device, which will introduce corruption to the new disk image. However a fun fact is that you can (do not actually do this!) boot a qemu VM from /dev/sda. You have to use an overlay (eg. qemu -drive snapshot=on flag) so that qemu won't write through to /dev/sda. I use this trick in supernested, a script I wrote…

I used to dual-boot windows, but I was too lazy to actually reboot, so naturally I had Virtualbox just boot the physical Windows partition while Linux was running. Which is totally fine! It's not a real dual boot if you don't boot both partitions at the same time. As long as you don't install guest VBox drivers, those would make it hang when it boots as the host on physical hardware, since there's no longer someone a…

I think Windows refused to do that at some point? So I booted the physical Linux partition from Windows if I needed both at the same time. That's on a laptop that otherwise almost always ran Linux.

Re: curl > /dev/sda: How I made a Linux distro that runs wget | dd

#38

This reminds me of netbooting workflows from things like MaaS, Tinkerbell, and Dan's old Plunder tool. They'd netboot.. not mount the disks, then download an ISO/IMG and write it directly to the primary boot disk. If netbooting is a heavy lift, why not boot into a custom initramfs you built, with i.e. dd/curl installed, and flash the disk that way, without mounting / at all? Then kexec/chroot into it? I'd much prefer…

Part 2 presents a fully automated proof of concept that does all of this: https://astrid.tech/2026/03/24/2/how-to-pass-secrets-between...
Post reply on HN