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:
sudo su -
fdisk -l
to find the EFI partition (via)mkdir -p /mnt/boot ; mount /dev/$THE_EFI_PARTITION /mnt/boot
mv /mnt/boot/EFI/Microsoft{,.bak}
(via)- Reboot
- NixOS image choice GRUB menu should show up - pick as appropriate.
- In NixOS, assuming
/dev/$THE_EFI_PARTITION
is mounted at/boot
, revert back the EFI contents:sudo mv /boot/EFI/Microsoft{.bak,}
- Shutdown, then boot again, but hold F2 pressed when booting.
- In BIOS, adjust the boot order, to put “EFI Partition…” first (this is the NixOS).