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

One-liner nukes your drive, installs a new OS; hackers cheer, sysadmins clutch pearls

TLDR: A dev showed how to replace your whole system by streaming a disk image directly onto your drive in one command. Commenters split between “epic hack” and “instant corruption,” with experts noting kernel settings, real risks, and safer A/B-style methods—turning a wild idea into a cautionary tech spectacle.

A blogger just flexed the ultimate “hold my beer” move: streaming a whole operating system straight onto the main drive with a single command, skipping installers and safety checks. The crowd went wild—and then immediately split. Half the comments are awe. The other half are screaming “please don’t.”

The nitpickers struck first: M95D coolly pointed out that some systems do block this chaos if a special kernel switch is flipped, essentially saying “your computer can be told not to let you chainsaw your own foot off.” Meanwhile, rwmj went full buzzkill—er, voice of reason—warning it’s not safe because the computer might keep writing to the “old” system while you replace it, corrupting the fresh install. Then, in peak mad-science energy, they added you can even boot a virtual machine directly from the real disk file—“do not actually do this!”

Others dropped war stories. matja described the rabbit hole of swapping a live server’s system without remote console access. dizhn recalled installing Alpine Linux over Ubuntu in the cloud with a clever console trick—here’s a similar blog. And veteran irishcoffee shrugged: embedded devices have done this for ages with A/B partitions—flip the other slot, reboot, done.

The vibe? Genius stunt or data-loss speedrun—and everyone’s here for the show.

Key Points

  • The article demonstrates installing or replacing a Linux system by streaming a disk image directly to a block device (e.g., curl ... > /dev/sda).
  • This approach can work on most EFI systems without extra efibootmgr steps because EFI firmware auto-discovers new EFI system partitions.
  • The feasibility relies on Unix’s model where block devices (e.g., /dev/sdX, /dev/nvmeX) are file-like and writable from the filesystem.
  • Command-line pipelines include downloading with curl/wget, optional on-the-fly decompression with gunzip, and writing with dd or direct redirection.
  • Examples extend to remote imaging via SSH and showcase multiple equivalent pipelines that avoid intermediate files.

Hottest takes

Not always true. There’s a kernel config option that allows it. CONFIG_BLK_DEV_WRITE_MOUNTED — M95D
you can (do not actually do this!) boot a qemu VM from /dev/sda — rwmj
I’ve been dd-ing A/B partitions for embedded yocto distributions for years and years — irishcoffee
Made with <3 by @siedrix and @shesho from CDMX. Powered by Forge&Hive.