akavel's digital garden

NixOS rescue

I managed to rescue my existing NixOS installation on a dual-boot Asus laptop with Windows, using a Sandisk MobileMate SD-card reader and a 4GB microSD card.

I flashed the NixOS graphical .iso image on the microSD card using Rufus. Then, after inserting it in the MobileMate into the USB drive of the Asus laptop, I booted it and immediately pressed F2. This allowed me to enter BIOS, and it then showed a Boot option for the Sandisk device. I had to reboot the machine manually once again, but then it showed NixOS.

In NixOS, I opened a terminal window and did the following steps:

  1. sudo su -
  2. fdisk -l to find the EFI partition (via)
  3. mkdir -p /mnt/boot ; mount /dev/$THE_EFI_PARTITION /mnt/boot
  4. mv /mnt/boot/EFI/Microsoft{,.bak} (via)
  5. Reboot
  6. NixOS image choice GRUB menu should show up - pick as appropriate.
  7. In NixOS, assuming /dev/$THE_EFI_PARTITION is mounted at /boot, revert back the EFI contents: sudo mv /boot/EFI/Microsoft{.bak,}
  8. Shutdown, then boot again, but hold F2 pressed when booting.
  9. In BIOS, adjust the boot order, to put “EFI Partition…” first (this is the NixOS).
🌱 seedling — contents of this article got classified among young, unrefined ideas that I’ve just planted—or old, unrefined ideas that need watering. If I am a diligent, caring gardener, they’ll grow into budding and maybe even ripe.
© Mateusz Czapliński 🐘 Mastodon 🐙 GitHub 🎮 Itch.io ♟️ BGG 🧶 Ravelry