Hello everyone,
I have been running NixOS in a VM to setup my config. I tried to update to 24.11 by adding the new channel and using:
nixos-rebuild switch --upgrade
However, during the rebuild process the OS ran out of disk space causing it to hang mid-install. When I rebooted the VM (after clearing up some space on the host OS) neither of my two NixOS generations would load past the bootloader.
The console readout on boot is as follows:
<<< NixOS Stage 1 >>>
loading module virtio_balloon...
loading module virtio_console...
loading module virtio_rng...
loading module dm_mod...
running udev...
Starting systemd-udevd version 254.6
kbd_mode: KDSKBMODE: Inappropriate ioctl for device
starting device mapper and LVM...
checking /dev/disk/by-uuid/a51d187e-018d-478b-91f2-b1321d5983e2...
fsck (busybox 1.36.1)
[fsck.ext4 (1) -- /mnt-root/] fsck.ext4 -a /dev/disk/by-uuid/a51d187e-018d-478b-91f2-b1321d5983e2
fsck.ext4: Operation not permitted while trying to open /dev/disk/by-uuid/a51d187e-018d-478b-91f2-b1321d5983e2
You must have r/w access to the filesystem or be root
fsck on /dev/disk/by-uuid/a51d187e-018d-478b-91f2-b1321d5983e2 failed.
An error occurred in stage 1 of the boot process, which must mount the
root filesystem on `/mnt-root' and then start stage 2. Press one
of the following keys:
r) to reboot immediately
*) to ignore the error and continue
Ignoring this error to continue boot just crashes the VM.
I have have tried booting into a NixOS live CD, but any time I try to run any repairs to the partition using gparted or fsck via terminal I get an error stating I lack permissions to do so (even when running as root).
When I try to mount it manually I get an error stating I lack r/w permissions and the partition appears blank when mounted in read only.
As such, I’m not too sure how to go about repairing or recovering the data.
I’m not too fussed if I lose the install itself or most of the data, but if anyone has any ideas on how to fix this up so I can recover my configuration.nix, that would be great.
If not, I guess I just chalk it up to a learning experience and make sure my config is better backed up in the future.
Thanks for any assistance