For the most part, NixOS has been quite impervious for me… except when you’re in the middle of an nixos-rebuild.
I was in the middle of running sudo nixos-rebuild switch --upgrade
until my system froze (I waited 1 hour, and still no response from the computer; I did a dirty forced shutdown). When booting the system, came across this error:
<<< NixOS Stage 1 >>>
loading module btrfs...
loading module dm_mod...
running udev...
Starting systemd-udevd version 254.6
Passphrase for /dev/disk/by--uuid/b90c2010-a53c-4f76-9802-95fdde248601 to appear. . . . -successs
Verifying passphrase for /dev/disk/by--uuid/b90c2010-a53c-4f76-9802-95fdde248601... - successs
starting device mapper and LVM...
Scanning for Btrfs filesystems
registered: /dev/mapper/luks-/b90c2010-a53c-4f76-9802-95fdde248601
mounting /dev/disk/by--uuid/b90c2010-a53c-4f76-9802-95fdde248601 on /...
[ 8.956086] BTRFS error(device dm-0_: openk_ctree failed
mount: mounting /dev/disk/by--uuid/b90c2010-a53c-4f76-9802-95fdde248601 on /mnt-root/ failed: Input/output error
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
When I opt for “ignore the error and continue,” I’m notified the following:
Continuing...
BusyBox v.136.1 () multi-call binary.
Usage: switch_root [-c CONSOLE_DEV] NEW_ROOT NEW_INIT [ARGS]
Free initramfs and switch to another root fs:
chroot to NEW_ROOT, delete all in /, move NEW_ROOT to /.
execute NEW_INIT. PID must be 1. NEW_ROOT must be a mountpoint.
When I booted to a live disk, and ran GNOME-disks, it gives me these errors when trying to open the drive or running Repair Disk:
I think the worst part of the situation is that I’m unable to extract my Home files since they’re all saved on root. Normally, this has never been an issue for me.
Any idea on how I can fix the filesystem or at least extract these files?