!oNSIfazDqEcwhcOjSL:matrix.org

disko

365 Members
disko - declarative disk partitioning - https://github.com/nix-community/disko93 Servers

Load older messages


SenderMessageTime
12 Nov 2024
@azahi:azahi.ccazahi changed their profile picture.18:51:18
13 Nov 2024
@inayet:matrix.orgInayet joined the room.22:18:42
14 Nov 2024
@raj-magesh:matrix.orgRaj
In reply to @raj-magesh:matrix.org

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

Bumping this. I'm trying to use my USB stick to store (i) a live USB and (ii) a partition to store files. How can I achieve this?
20:24:16
@alina:kescher.atalina🏳️‍⚧️🐾 left the room.21:13:11
15 Nov 2024
@mfed3:matrix.orgmfed3 left the room.17:13:03
@rungmc:matrix.orgrungmc joined the room.21:21:52
16 Nov 2024
@intergalactic-turtle-fucker:arcticfoxes.net@intergalactic-turtle-fucker:arcticfoxes.net joined the room.07:28:01
@magic_rb:matrix.redalder.orgmagic_rb
In reply to @kamillaova:matrix.org
Is there a way to run a command after creating a filesystem with disko?
I want to run mkdir $target/{home,nix} to allow these directories binding to their real locations, e.g. something like this

fileSystems."/nix" = {
	device = "/persist/nix";
	fsType = "none";
	options = [ "bind" ];
	depends = [ "/persist" ];
	neededForBoot = true;
};
did you figure this one out? im trying to do exactly what youre doing right now, i need to setup a bind mount /nix -> /persist/nix
13:40:12
@intergalactic-turtle-fucker:arcticfoxes.net@intergalactic-turtle-fucker:arcticfoxes.netRedacted or Malformed Event13:57:55
@magic_rb:matrix.redalder.orgmagic_rb
In reply to @magic_rb:matrix.redalder.org
did you figure this one out? im trying to do exactly what youre doing right now, i need to setup a bind mount /nix -> /persist/nix
    nodev."/nix" = {
      fsType = "ext4";
      device = "/dev/disk/by-id/ata-SK_hynix_SC311_SATA_128GB_MJ88N52701150940J-part3";
      mountOptions = [
        "X-mount.subdir=nix"
      ];
      preMountHook = ''
        tmpdir=$(mktemp -d)

        mount /dev/disk/by-id/ata-SK_hynix_SC311_SATA_128GB_MJ88N52701150940J-part3 $tmpdir
        mkdir $tmpdir/nix
        umount $tmpdir
      '';
    };

jfc way too complex

14:20:15
17 Nov 2024
@shift:c-base.orgshift joined the room.01:53:28
@orzklv:matrix.org@orzklv:matrix.org joined the room.02:29:01
@shift:c-base.orgshiftAnyone got a bcachefs, encrypted config I could work from?17:08:11
@sigmasquadron:matrix.orgSigmaSquadronLUKS-encrypted bcachefs or bcachefs-encrypted bcachefs?17:08:48
@shift:c-base.orgshiftBcache encrypted. Luka plus bcachefs doesn't make sense to me :)17:09:15
@shift:c-base.orgshift* Bcachefs encrypted. Luks plus bcachefs doesn't make sense to me :)17:09:29
@shift:c-base.orgshift Maybe I need to make @lassulus:lassul.us provide me an example at the next NixOS Berlin Meetup ;P 17:15:55
@lassulus:lassul.uslassulushmm, maybe not implemented yet17:16:39
@shift:c-base.orgshift
In reply to @lassulus:lassul.us
hmm, maybe not implemented yet
I was told as the conference people had it working already. Got promised example configs but never received them, hehe.
17:18:27
@shift:c-base.orgshiftSo possibly.17:18:35
@kamillaova:matrix.orgKamilla 'ova
In reply to@magic_rb:matrix.redalder.org
did you figure this one out? im trying to do exactly what youre doing right now, i need to setup a bind mount /nix -> /persist/nix
https://yaso.su/Ur4CNRQ8
20:40:14
@kamillaova:matrix.orgKamilla 'ova* https://yaso.su/Ur4CNRQ8 https://yaso.su/bHoQgySf20:40:45
@magic_rb:matrix.redalder.orgmagic_rbthats also a valid way, i did it slightly differently20:40:56
18 Nov 2024
@kamillaova:matrix.orgKamilla 'ova
In reply to@magic_rb:matrix.redalder.org
thats also a valid way, i did it slightly differently
how?
07:16:42
@kamillaova:matrix.orgKamilla 'ova
In reply to@magic_rb:matrix.redalder.org
    nodev."/nix" = {
      fsType = "ext4";
      device = "/dev/disk/by-id/ata-SK_hynix_SC311_SATA_128GB_MJ88N52701150940J-part3";
      mountOptions = [
        "X-mount.subdir=nix"
      ];
      preMountHook = ''
        tmpdir=$(mktemp -d)

        mount /dev/disk/by-id/ata-SK_hynix_SC311_SATA_128GB_MJ88N52701150940J-part3 $tmpdir
        mkdir $tmpdir/nix
        umount $tmpdir
      '';
    };

jfc way too complex

ah I see
07:17:18
@kamillaova:matrix.orgKamilla 'ovahmmm07:18:19
@kamillaova:matrix.orgKamilla 'ovaimage.png
Download image.png
07:18:20
@matthewcroughan:defenestrate.itmatthewcroughan

Even today I still get

++ mkdir -p /mnt/nix/store
++ xargs cp --recursive --target /mnt/nix/store
cp: cannot access '/nix/store/jdrm9vk8z5lixyaalnl61wy2gjw64l3h-kmod-blacklist-31+20240202-2ubuntu8': Cannot allocate memory

on the latest disko

16:37:43
@matthewcroughan:defenestrate.itmatthewcroughanbut why 16:37:44
@matthewcroughan:defenestrate.itmatthewcroughanI have never been able to get to the bottom of it 16:44:48

Show newer messages


Back to Room ListRoom Version: 10