| 14 Apr 2024 |
zonnebloem | Hi all
During a nixos-rebuild switch, my system froze.
After a hard reset my system doesn't boot anymore. It shows a grub prompt. Is there a way to make it boot? and repair it? Or do I need to reinstall the system with a live image and backup some date to a backup disk?
My guess is my system crashed during the grub update ..
I'm using disko with 2 mirrored ssd's: 1G vfat boot & luks-zfs rpool
I'm using grub because systemd boot didn't work for this mirror. | 15:23:12 |
Fernando Rodrigues | You can try pointing grub to the NixOS kernel and initrd for your latest generation, and booting manually. Once you’re booted, rebuild the system with the --install-bootloader option. | 15:26:59 |
Fernando Rodrigues | Alternatively, mount your disks on a NixOS live image and run nixos-install --no-root-password. | 15:27:26 |
Fernando Rodrigues | * You can try pointing grub to the NixOS kernel and initrd for your latest generation, and booting manually. Once you’re booted, rebuild the system with the --install-bootloader option. | 15:27:36 |
zonnebloem | Could you point me towards a source which explains the first option? | 15:30:53 |
| hxr404 ✨ [it/she] changed their display name from hxr404 ✨ [they/them] (offline) to hxr404 ✨ [they/them]. | 15:31:15 |
Fernando Rodrigues | The paths will be more complicated, since they also include the hashes of the package, but the general gist of it is defined in the manual: https://www.gnu.org/software/grub/manual/grub/grub.html#GNU_002fLinux | 15:33:47 |
Fernando Rodrigues | search for your root, set your kernel, use the initrd command to boot. | 15:34:22 |
Fernando Rodrigues | Though this might be very difficult if you aren’t already used to the GRUB CLI. The NixOS wiki has a nice walkthrough on how to do this from a NixOS installation image: https://nixos.wiki/wiki/Bootloader#Re-installing_the_bootloader | 15:35:33 |
Fernando Rodrigues | * Though this might be very difficult if you aren’t already used to the GRUB CLI. The NixOS wiki has a nice walkthrough on how to skip this and reinstall the bootloader from a NixOS installation image: https://nixos.wiki/wiki/Bootloader#Re-installing_the_bootloader | 15:36:28 |
zonnebloem | thank you | 17:06:52 |
zonnebloem | I couldn't get it to work, I'm backing up and reinstalling | 17:07:18 |
Fernando Rodrigues | There probably isn’t a need to reinstall the entire system, just mounting and rebuilding should work. | 18:09:20 |
| 17 Apr 2024 |
| JoelMcCracken joined the room. | 16:29:40 |
| @lychee:lefishe.club changed their display name from kay to kaylee. | 17:10:15 |
| 19 Apr 2024 |
| @lychee:lefishe.club changed their profile picture. | 12:19:28 |
| 23 Apr 2024 |
| @vartroc:matrix.org joined the room. | 13:51:35 |
| @min:min.rip joined the room. | 23:36:08 |
| 25 Apr 2024 |
| @me:indeednotjames.com left the room. | 14:43:59 |
@vartroc:matrix.org | Hi everyone, I would ask you to please just take a look at my config, answer some questions and maybe give some recommendation.
First, my questions:
- extraArgs = ["-f"]` What does this do?
- if I first specify 25%FREE for root at the lvm-lvs and then specify 100%FREE for games, 25% of the file is for root and 75% is for games, right?
Here my config:
| 15:19:35 |
@vartroc:matrix.org | * Hi everyone, I would ask you to please just take a look at my config, answer some questions and maybe give some recommendation.
First, my questions:
- extraArgs = ["-f"]` What does this do?
- if I first specify 25%FREE for root at the lvm-lvs and then specify 100%FREE for games, 25% of the file is for root and 75% is for games, right?
Here my config:
{
disko.devices = {
disk = {
disk0 = {
type = "disk";
device = "/dev/nvme1n1";
content = {
type = "gpt";
partitions = {
esp = {
name = "ESP";
size = "500M";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
};
};
root = {
name = "root0";
size = "100%";
content = {
type = "lvm_pv";
vg = "root_vg";
};
};
};
};
};
disk1 = {
type = "disk";
device = "/dev/nvme0n1";
content = {
type = "gpt";
partitions = {
root = {
name = "root1";
size = 100%;
content = {
type = "lvm_pv";
vg = "root_vg";
};
};
};
};
};
lvm_vg = {
root_vg = {
type = "lvm_vg";
lvs = {
root = {
size = "25%FREE";
content = {
type = "btrfs";
extraArgs = ["-f"];
subvolumes = {
"/root" = {
mountpoint = "/";
};
"/persist" = {
mountOptions = ["subvol=persist" "noatime"];
mountpoint = "/persist";
};
"/nix" = {
mountOptions = ["subvol=nix" "noatime"];
mountpoint = "/nix";
};
};
};
};
games = {
size = "100%FREE";
content = {
type = "btrfs";
extraArgs = ["-f"];
subvolumes = {
"/games" = {
mountOptions = ["noatime"];
mountpoint = "/games";
};
};
};
};
};
};
};
};
}
| 15:20:47 |
@vartroc:matrix.org | * Hi everyone, I would ask you to please just take a look at my config, answer some questions and maybe give some recommendation.
First, my questions:
- extraArgs = ["-f"]` What does this do?
- if I first specify 25%FREE for root at the lvm-lvs and then specify 100%FREE for games, 25% of the file is for root and 75% is for games, right?
- does the
mountOptions = ["subvol=games" "noatime"] sense? I coudnt find anything about thesubvol=games` part
Here my config:
{
disko.devices = {
disk = {
disk0 = {
type = "disk";
device = "/dev/nvme1n1";
content = {
type = "gpt";
partitions = {
esp = {
name = "ESP";
size = "500M";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
};
};
root = {
name = "root0";
size = "100%";
content = {
type = "lvm_pv";
vg = "root_vg";
};
};
};
};
};
disk1 = {
type = "disk";
device = "/dev/nvme0n1";
content = {
type = "gpt";
partitions = {
root = {
name = "root1";
size = 100%;
content = {
type = "lvm_pv";
vg = "root_vg";
};
};
};
};
};
lvm_vg = {
root_vg = {
type = "lvm_vg";
lvs = {
root = {
size = "25%FREE";
content = {
type = "btrfs";
extraArgs = ["-f"];
subvolumes = {
"/root" = {
mountpoint = "/";
};
"/persist" = {
mountOptions = ["subvol=persist" "noatime"];
mountpoint = "/persist";
};
"/nix" = {
mountOptions = ["subvol=nix" "noatime"];
mountpoint = "/nix";
};
};
};
};
games = {
size = "100%FREE";
content = {
type = "btrfs";
extraArgs = ["-f"];
subvolumes = {
"/games" = {
mountOptions = ["subvol=games" "noatime"];
mountpoint = "/games";
};
};
};
};
};
};
};
};
}
| 15:23:54 |
@vartroc:matrix.org | * Hi everyone, I would ask you to please just take a look at my config, answer some questions and maybe give some recommendation.
First, my questions:
- extraArgs = ["-f"]` What does this do?
- if I first specify 25%FREE for root at the lvm-lvs and then specify 100%FREE for games, 25% of the file is for root and 75% is for games, right?
- does the
mountOptions = ["subvol=games" "noatime"] sense? I coudnt find anything about thesubvol=games` part
Here my config:
{
disko.devices = {
disk = {
disk0 = {
type = "disk";
device = "/dev/nvme1n1";
content = {
type = "gpt";
partitions = {
esp = {
name = "ESP";
size = "500M";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
};
};
root = {
name = "root0";
size = "100%";
content = {
type = "lvm_pv";
vg = "root_vg";
};
};
};
};
};
disk1 = {
type = "disk";
device = "/dev/nvme0n1";
content = {
type = "gpt";
partitions = {
root = {
name = "root1";
size = 100%;
content = {
type = "lvm_pv";
vg = "root_vg";
};
};
};
};
};
lvm_vg = {
root_vg = {
type = "lvm_vg";
lvs = {
root = {
size = "25%FREE";
content = {
type = "btrfs";
extraArgs = ["-f"];
subvolumes = {
"/root" = {
mountpoint = "/";
};
"/persist" = {
mountOptions = ["subvol=persist" "noatime"];
mountpoint = "/persist";
};
"/nix" = {
mountOptions = ["subvol=nix" "noatime"];
mountpoint = "/nix";
};
};
};
};
games = {
size = "100%FREE";
content = {
type = "btrfs";
extraArgs = ["-f"];
subvolumes = {
"/games" = {
mountOptions = ["subvol=games" "noatime"];
mountpoint = "/games";
};
};
};
};
};
};
};
};
}
| 15:24:19 |
| @adam:robins.wtf left the room. | 19:30:50 |
| Jan Tojnar joined the room. | 20:07:10 |
| David Mell (zraexy) joined the room. | 23:38:25 |
| David Mell (zraexy) changed their display name from David Mell to David Mell (zraexy). | 23:51:57 |
| 26 Apr 2024 |
Raj | Couple of questions about NixOS live USBs:
I want to partition my 64 GB USB flash drive into two partitions (FAT32 live USB + ext4 storage), so I used the following disko config:
let
usb = "/dev/disk/by-id/usb-USB_SanDisk_3.2Gen1_0401a943ae4197a38a6f9070194e9ea2b3fb8dbb7997e05ed1b197c0e28946be4b8f000000000000000000001cf4be6800926418a955810751ab6336-0:0";
in {
disko.devices = {
disk = {
live = {
type = "disk";
device = usb;
content = {
type = "gpt";
partitions = {
ESP = {
type = "EF00";
device = "${usb}-part1";
priority = 0;
size = "8192M";
content = {
type = "filesystem";
format = "vfat";
};
};
storage = {
device = "${usb}-part2";
priority = 1;
size = "100%";
content = {
type = "filesystem";
format = "ext4";
};
};
};
};
};
};
};
}
I then copied over the files from the (minimal, non-graphical) NixOS live ISO into partition 1, hoping that the instructions on the Arch wiki would generalize to NixOS, but then my live ISO gets stuck with the following error message:
[...]
Timed out waiting for device /dev/root, trying to mount anyway
mounting /dev/root on /iso...
mount: mounting /dev/root on /mnt-root/iso failed: No such file or directory
An error occurred [...]
How can I use my USB flash drive as both a live USB and as a storage device? I found this relevant Discourse link but there was no resolution to the problem there.
I realize this might not be the best place to ask this, but I figured that folks here would have expertise configuring boot partitions correctly.
| 02:02:16 |
Raj | * Couple of questions about NixOS live USBs:
I want to partition my 64 GB USB flash drive into two partitions (FAT32 live USB + ext4 storage), so I used the following disko config:
let
usb = "/dev/disk/by-id/usb-USB_SanDisk_3.2Gen1_0401a943ae4197a38a6f9070194e9ea2b3fb8dbb7997e05ed1b197c0e28946be4b8f000000000000000000001cf4be6800926418a955810751ab6336-0:0";
in {
disko.devices = {
disk = {
live = {
type = "disk";
device = usb;
content = {
type = "gpt";
partitions = {
ESP = {
type = "EF00";
device = "${usb}-part1";
priority = 0;
size = "8192M";
content = {
type = "filesystem";
format = "vfat";
};
};
storage = {
device = "${usb}-part2";
priority = 1;
size = "100%";
content = {
type = "filesystem";
format = "ext4";
};
};
};
};
};
};
};
}
I then copied over the files from the (minimal, non-graphical) NixOS live ISO into partition 1, hoping that the instructions on the Arch wiki would generalize to NixOS, but then my live ISO gets stuck with the following error message:
[...]
Timed out waiting for device /dev/root, trying to mount anyway
mounting /dev/root on /iso...
mount: mounting /dev/root on /mnt-root/iso failed: No such file or directory
An error occurred [...]
How can I use my USB flash drive as both a live USB and as a storage device? I found this relevant Discourse link but there was no resolution to the problem there.
I realize this might not be the best place to ask this, but I figured that folks here would have expertise configuring boot partitions correctly.
For reference, the NixOS manual says I should dd the ISO to the disk directly: sudo dd if=<path-to-image> of=/dev/sdX bs=4M conv=fsync
| 02:12:28 |
tim | I don't think that this will work since you need to unmount the live USB to format it as storage device | 07:16:00 |