KiaraGrouwstra / nix-config

my NixOS configuration
15 stars 1 forks source link

rebuilds can't access root #83

Closed KiaraGrouwstra closed 5 years ago

KiaraGrouwstra commented 5 years ago

see #80.

KiaraGrouwstra commented 5 years ago

./hardware-configuration.nix:

  fileSystems."/" =
    { device = "/dev/disk/by-uuid/42a1b149-72dd-4ed8-9c6a-b8bc4b1d581e";
      fsType = "ext4";
    };

  fileSystems."/boot" =
    { device = "/dev/disk/by-uuid/8567-0168";
      fsType = "vfat";
    };

  swapDevices =
    [ { device = "/dev/disk/by-uuid/bf670e78-9b9d-4e15-8508-aa2f15e85a12"; }
    ];
$ ls /dev/disk/by-uuid/
80b30b03-af17-4d65-8f2e-5f7c2067e3f6  c7ca628b-0645-4af0-95d5-741d47d5923f

so uh, this would seem exactly like the type of fatal error that'd happen with this kind of mismatch.

KiaraGrouwstra commented 5 years ago

sudo nixos-generate-config:

  fileSystems."/" =
    { device = "/dev/disk/by-uuid/c7ca628b-0645-4af0-95d5-741d47d5923f";
      fsType = "ext4";
    };

  swapDevices =
    [ { device = "/dev/disk/by-uuid/80b30b03-af17-4d65-8f2e-5f7c2067e3f6"; }
    ];

missing /boot this time. uh what?

KiaraGrouwstra commented 5 years ago

hardware is gitignore'd, so nothing to commit. preparing for impending crash.

KiaraGrouwstra commented 5 years ago

rebuild didn't like the missing /boot. but how do I find what it should be now?

KiaraGrouwstra commented 5 years ago

as per https://nixos.org/nixos/manual/#sec-configuration-file -> Sets, trying:

   fileSystems."/boot" =
      { device = "/dev/sda1";
        fsType = "ext4";
      };

... rather than vfat and by uuid.

other options:

$ ls /dev/sd
/dev/sda  /dev/sda1  /dev/sda2  /dev/sdb  /dev/sdb1
KiaraGrouwstra commented 5 years ago

sda1 and sda2 failed. master revision 15 works, after fail. probably coincided with merging in Gnome files that included a now-gitignore'd hardware config. checking where to check the hardware config for revision 15.

KiaraGrouwstra commented 5 years ago

sda failed too. don't see hardware-configuration.nix in /nix/var/nix/profiles/per-user/tycho/profile-15-link/. /etc/nixos/hardware-configuration.nix contains the crap I last copied there, rather than of the revision I just booted. hm.

KiaraGrouwstra commented 5 years ago

related: https://nixos.wiki/wiki/Bootloader

KiaraGrouwstra commented 5 years ago

tried mounting any devices as ext4/vfat to check if their contents matched /boot, but none did. so I've yet to identify what should go into /boot.

KiaraGrouwstra commented 5 years ago

https://webchat.freenode.net/

[13:43] <jasongrossman> tycho01: You could try running `lsblk`.
$ lsblk
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0 931.5G  0 disk 
├─sda1   8:1    0 923.5G  0 part /tmp/c7ca628b-0645-4af0-95d5-741d47d5923f
└─sda2   8:2    0     8G  0 part [SWAP]
sdb      8:16   0 119.2G  0 disk 
└─sdb1   8:17   0 119.2G  0 part 
sr0     11:0    1  1024M  0 rom  

Looks like sr0 matches in terms of size. Not sure what partition type / uuid, but /dev/sr0 might work.

KiaraGrouwstra commented 5 years ago

well, that worked with neither ext4 nor vfat.

KiaraGrouwstra commented 5 years ago

trying a sudo find / -name 'hardware-configuration.nix' just in case a copy was still stored somewhere.

KiaraGrouwstra commented 5 years ago

I better start backing up the hardware conf in a gist from now. :neutral_face:

KiaraGrouwstra commented 5 years ago

failed attempts to find more info: