r/archlinux • u/Embarrassed-Leek-398 • 24d ago
SHARE I just installed without a USB key
I just pulled off a "crazy" trick I'm feeling kind of happy about so I thought I'd mention it. I got a great deal on a CWWK NAS board so I'm commissioning a new homelab server, and I'm "borrowing" a few parts from other machines I have laying around until all the parts get here.
As such, I was already going to be pulling the NVMe disk out from another machine, so I got to thinking. The / partition was already located further into the disk than the size of the install disc, so I justdd'd the install ISO directly to /dev/nvme0n1, and then installed the drive into the server. It boots fine that way! And since the ISO copies to RAM, it doesn't matter that you're paradoxically running from the same drive you're installing to.
I found this works with NixOS and maybe others as well that have copy-to-ram as an optional GRUB selection, except on distros that use Calamares the installer won't find any installable partitions since now it'll think the hard drive is the CD, which is easily fixed by running sudo wipefs -a /dev/nvme0n1 from the booted live image, and then re-opening the installer :P.
10
u/Ape3000 24d ago
Instead of copying the install iso there, you could just install the OS to the disk and boot directly to the installed system.
22
u/gmes78 24d ago
Alternatively, after creating a new partition table and EFI partition, you can create a partition at the end of the disk, extract the ISO there, then find a way to boot into it.
Either by installing a bootloader and configuring it to boot the installer, or by using an EFI shell to load the installer's bootloader (you're not restricted to FAT32, there are UEFI drivers for ext4, NTFS, exFAT, etc.).
After you're done, you can just delete the installer partition and extend the main partition to the right.
This works for images that don't load to RAM, and it even works for installing Windows.
Though, you could've just used the Arch netboot image in this case.
5
u/ang-p 24d ago edited 24d ago
than what?
The second you
dd'd to/dev/nvme0n1any partitions there ceased to be defined.... info about them they may still be in memory, but until that record is erased, the partition with your newly written installation image is not visiblePartly because yup, the drive is seen as a CD, and, obvs, you cannot write to a CD.... but mainly because there are no partitions to be found... your
ddstomped over the table.Seems a long-winded way of doing it.... with a easy way of getting stuck if you goof the bootloader....
ur-huh?
Are you sure AI didn't "help" you with this scenario?
.... O rlly - so you were repurposing one board but tried multiple experiments to find out what would "work"??
2
u/urielrocks5676 24d ago
That is a valid way, I have her to set it up, but I have a sizable partition on my esp so I can put an arch ISO in case I fuck up
-1
u/SDG_Den 24d ago
uhm... not to ruin your fun, but
nixos-anywherecan deploy nixOS with a custom config to a remote device over the network given only ssh access and kexec functionality. no need for this reformat-and-make-an-iso stuffthis is a fun trick though! i used to do this with windows.
-1
u/Supernoxus 24d ago
I would be terrified of having to create an usb iso anyway after I realize that broke my initial install and wiped the original iso already.