Open jeltsch opened 5 years ago
Please add:
findmnt
prior to running nixos-generate-config
nixos-generate-config --show-hardware-config
Feel free to (carefully) anonymize the output of the above. The above commands should illustrate which mount points you have set and what nixos-generate-config
is coming up with.
@jeltsch are you able to provide the requested data?
Sorry for not responding earlier. When reading the answer by @emmanuelrosa, I had already changed the partitioning and mounting scheme for another reason. Under the new scheme I don’t mount subvolumes and thus don’t experience the described problems anymore. Given this situation, I cannot easily provide the requested data.
Definitely sounds like this issue should remain open and hopefully someone will take interest in the future.
Glad to hear you at least found a workaround.
Thank you for your contributions.
This has been automatically marked as stale because it has had no activity for 180 days.
If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity.
Here are suggestions that might help resolve this more quickly:
I think this issue is still important.
I marked this as stale due to inactivity. → More info
@jeltsch Still relevant ?
Not for me, but in general it might still be relevant.
I didn't experience the second issue when running nixos-generate-config --root /mnt
with BTRFS subvolumes from a NixOS 22.11 live USB. For each subvolume, options
was set to [ "subvol=@" ]
, [ "subvol=@home" ]
, etc.
I did notice that since I was using a LUKS volume, device
was set to "/dev/mapper/name"
. The configuration worked fine. However, when I ran nixos-generate-config
again directly from the installed system, device
pointed to the UUID of the partition (within the LUKS volume). This also works fine and doesn't create any errors, but this inconsistency could be related to the first issue in the original report.
However, in general I was unable to reproduce any errors or failures.
Generated from Live USB:
boot.initrd.luks.devices."nixos".device = "/dev/disk/by-uuid/<my-uuid>";
fileSystems."/" =
{ device = "/dev/mapper/nixos";
fsType = "btrfs";
options = [ "subvol=@" ];
};
fileSystems."/home" =
{ device = "/dev/mapper/nixos";
fsType = "btrfs";
options = [ "subvol=@home" ];
};
Generated from running system:
boot.initrd.luks.devices."nixos".device = "/dev/disk/by-uuid/<myuuid>";
fileSystems."/" =
{ device = "/dev/disk/by-uuid/<different-uuid>";
fsType = "btrfs";
options = [ "subvol=@" ];
};
fileSystems."/home" =
{ device = "/dev/disk/by-uuid/<different-uuid>";
fsType = "btrfs";
options = [ "subvol=@home" ];
};
Findmnt output (/dev and such omitted):
TARGET SOURCE FSTYPE OPTIONS
/ /dev/mapper/nixos[/@] btrfs rw,ssd,space_cache=v2,subvolid=<num>,subvol=/@
├─/boot /dev/nvme0n1p1 vfat rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro
├─/home /dev/mapper/nixos[/@home] btrfs rw,ssd,space_cache=v2,subvolid=<num>,subvol=/@home
I’m trying to install NixOS 18.09 from a rescue system running Debian 9 with the Linux kernel updated to 4.19.4. The rescue system comes with version 4.7.3 of
btrfs-progs
. I’m following the instructions from Subsubsection 2.5.4 of the NixOS 18.09 manual.I’ve mounted several subvolumes from a single btrfs partition. The problem is that
nixos-generate-config
generates incorrect file system settings for the subvolumes:It sets
device
to the actual devices (like/dev/sda1
) instead of the UUID-based symlinks, making the settings vulnerable to device name changes.It sets
subvol
erroneously to the mount points of the subvolumes instead of the subvolumes (the values of thesubvol
mount option).No such errors occur when just the full btrfs partition is mounted.