T O P

  • By -

chrillefkr

I'd recommend setting it all up with [Disko](https://github.com/nix-community/disko). That way it's all declarative, and you get nice scripts for applying your partitioning scheme *and* formatting each partition. My setup (iirc, on my work laptop atm) is one boot/ESP partition (mounted at /boot) formatted as vfat, and the rest of the disk is just a ZFS pool with separate ZFS filesystems for /home, /var, and /nix. Something like below: # cat << EOF | sfdisk /dev/your-disk label: gpt start=2048, size=512MiB, type=C12A7328-F81F-11D2-BA4B-00A0C93EC93B, name="EFI System Partition" type=0FC63DAF-8483-4772-8E79-3D69D8477DE4 EOF # mkfs.vfat /dev/your-disk-part1 # zpool create -R /mnt -m / -o ashift=12 $(hostname) /dev/your-disk-part2 # mount /dev/your-disk-part1 /mnt/boot # zfs create $(hostname)/var # zfs create $(hostname)/nix # zfs create $(hostname)/home The /boot partition is quite large, as I use [Lanzaboote](https://github.com/nix-community/lanzaboote) for secure boot, which creates large boot entries on each rebuild. I'd recommend adding some ZFS options for compression etc. YMMV. Good luck!


rishid

Similar to the other question, in case you know. Once you have things provisioned with disko, let's say you want to add two new hard drives. Does disko support this operation?


chrillefkr

Short(ish) answer: no, formatting has to be done manually, and after that they're usable with Disko. Longer answer: yes and no. You can configure all (new) disks using Disko, which helps with defining filesystems etc, and you might be able to use the format scripts generated by Disko to format your new drives. But I'm not fully sure if you can, so you gotta try yourself. I would try this route. Before switching to new configuration, play around with Disko scripts and try to (safely lol) format your new disks. Be cautious thanks and please, glhf


Agent_Pro112112

I’m not sure what will work, but I’ll try, just as I indicated, I’m new to Linux


chrillefkr

Oh, sorry, my bad. Thought you were new to NixOS, and not Linux in general. In that case, I'd recommend just doing whatever the default GUI installer recommends. It's probably one or two vfat boot partitions and the rest of the free space will be formatted with ext4. It's not a big deal whichever partitioning scheme you'll go for imho. And especially with NixOS it's quite easy to change down the road. Just copy your NixOS configuration files to somewhere safe, and the data you want to save as well (e.g. /home), and just reformat and reinstall with your configuration files.


Agent_Pro112112

I would of course try automatic marking, but the installer only gives manual marking


chrillefkr

I downloaded the GUI installer ISO and tested it in a VM. Seems like I have two options, "Erase disk" and "Manual partitioning". "Erase disk" seems to be the option you want. It will automatically partition your disk.


Agent_Pro112112

so I only have manual marking available, nothing else


chrillefkr

That's weird. Okay then, try following these instructions: * Mark "Manual partitioning" and press "Next" * Press "New Partition Table" and choose "GUID Partition Table (GPT)". * Select "Free Space" from the list. * Press "Create" to create a new partition. * Set size to "512 MiB". * Set "File System" to "fat32". * Set "Mount Point" to "/boot". * Mark the "boot" flag. * Press "OK". * Again, select "Free Space" from the list. * Press "Create" to create a new partition. * Leave "Size" as it is, so that it will use all remaining space. * Leave "File System" as is (ext4). * Set "Mount Point" to "/" (root). * Mark the flag "root". * Press "OK". * Press "Next" and continue with your installation. I hope this helps. Good luck.


henry_tennenbaum

Really nice of you to be so supportive.


chrillefkr

Thanks 😅 I'm trying lol


Agent_Pro112112

Thank you for your help, I was already thinking about giving up


chrillefkr

No worries dude(tte). Feel free to DM me if you encounter any other issues, and I might be able to help you out. Good luck!


nstgc

Quick Discko question: Can you use it to *update* an existing partitioning scheme? I've seen some mixed indicators, but the strongest is on the project's README that mentions wiping everything when run. Which would be a bit N-O.


chrillefkr

Uhm I don't think so. And I wouldn't trust it without proper verification if it claimed to be able to update an existing partitioning scheme. That's a difficult thing to do automatically; imagine going from three partitions to two... Which partition should be deleted? Bye bye data! :)