!oNSIfazDqEcwhcOjSL:matrix.org

disko

109 Members
disko - declarative disk partitioning - https://github.com/nix-community/disko41 Servers

Load older messages


SenderMessageTime
25 Apr 2024
@vartroc:matrix.orgvartroc *

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.orgvartroc *

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.orgvartroc *

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@adam:robins.wtf left the room.19:30:50
@jtojnar:matrix.orgJan Tojnar joined the room.20:07:10
@zraexy:nixos.devDavid Mell (zraexy) joined the room.23:38:25
@zraexy:nixos.devDavid Mell (zraexy) changed their display name from David Mell to David Mell (zraexy).23:51:57
26 Apr 2024
@raj-magesh:matrix.orgRaj

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-magesh:matrix.orgRaj *

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
@tim92:matrix.orgtimI don't think that this will work since you need to unmount the live USB to format it as storage device07:16:00
@raj-magesh:matrix.orgRaj
In reply to @tim92:matrix.org
I don't think that this will work since you need to unmount the live USB to format it as storage device
Not sure what you mean, exactly. To clarify, I'm not trying to format the USB while it's live; I'm running this from an existing NixOS install.

If the"live USB" bit uses only ~1 GiB, there should be some way to make use of the remaining space, hopefully.
07:57:47
@perchun:matrix.org@perchun:matrix.org left the room.07:57:54
@lassulus:lassul.uslassulus changed their profile picture.08:25:00
@vartroc:matrix.orgvartroc

Soooo,
I have decided to just try it.
After debugging some syntax issues, I have encountered this bug:

error:
       … while evaluating the attribute 'diskoScript'

         at /nix/store/3mlzsgflq3z4wsk2arffhd999h1hj17g-disko/share/disko/lib/default.nix:418:15:

          417|
          418|               diskoScript = (diskoLib.writeCheckedBash { inherit pkgs checked; }) "disko" ''
             |               ^
          419|                 export PATH=${lib.makeBinPath ((cfg.config._packages pkgs) ++ [ pkgs.bash ])}:$PATH

       … in the condition of the assert statement

         at /nix/store/y11h0vfmjaf8j1796x0n2454hqldnbbr-0vyi8f8l8cya10dmgfrj0df2iqxlhiyi-source/pkgs/build-support/writers/scripts.nix:32:5:

           31|     assert (types.path.check nameOrPath) || (builtins.match "([0-9A-Za-z._])[0-9A-Za-z._-]*" nameOrPath != null);
           32|     assert (types.path.check content) || (types.str.check content);
             |     ^
           33|     let

       (stack trace truncated; use '--show-trace' to show the full trace)

       error: The option `disko.devices.disk.lvm_vg.root_vg' does not exist. Definition values:
       - In `<unknown-file>':
           {
             lvs = {
               games = {
                 content = {
                   extraArgs = [
           ...

Does anybody have any idea how I can fix this?

Here's my disko.nix:

{
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:33:36
@vartroc:matrix.orgvartrocI couldn't find anything remotely connected with this bug15:34:34
@vartroc:matrix.orgvartrocIf you need anything else from me, please ask18:58:57
@lassulus:lassul.uslassulusin line 43 you have root_vg but your vg is called root21:38:05
@lassulus:lassul.uslassulusso you would need to change the name also to root instead of root_vg21:38:19
@lassulus:lassul.uslassulusah wait no21:38:30
@lassulus:lassul.uslassulusI misread21:38:32
@lassulus:lassul.uslassuluslvm_vg is under disk instead of of being under lvm_vg in the toplevel21:39:15
@lassulus:lassul.uslassulusso the stuff from line 50 onwards needs to go one lever higher21:39:38
@lassulus:lassul.uslassulussorry for it being so complicated21:40:02
@pxc:matrix.orgpxc changed their display name from pxc to pxc (why).23:32:11
@pxc:matrix.orgpxc changed their display name from pxc (why) to pxc.23:32:18
27 Apr 2024
@pxc:matrix.orgpxc set a profile picture.00:46:07
@pxc:matrix.orgpxc removed their profile picture.00:48:07
@io:meat.computerio joined the room.02:17:24
@lychee:lefishe.club@lychee:lefishe.club left the room.14:36:52
@ygt:matrix.orgnadir joined the room.18:24:47

There are no newer messages yet.


Back to Room ListRoom Version: 10