NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.6k stars 13.75k forks source link

messages about fd8 and fd9 leaking during stage 1 #342082

Open NightH4nter opened 2 weeks ago

NightH4nter commented 2 weeks ago

Describe the bug

during stage 1, after "starting device mapper and lvm", i get these messages alternating for a few seconds:

File descriptor 8 (/dev/console) leaked on lvm invocation. Parent PID 1: /nix/store/[hash]-extra-utils/bin/ash
File descriptor 9 (/dev/console) leaked on lvm invocation. Parent PID 1: /nix/store/[hash]-extra-utils/bin/ash

before finally getting presented with passphrase prompt for my zfs root device.

Steps To Reproduce

  1. checkout nixos-unstable to 4f807e
  2. use my config?
  3. rebuild
  4. reboot

Expected behavior

normal boot process without fd leak messages

Screenshots

can't make screenshots obviously, so hopefully this is sort of readable

screen photos ![image](https://github.com/user-attachments/assets/4be992c2-07e6-4675-88a7-0041ffeac2ff) ![image](https://github.com/user-attachments/assets/a9813b49-f1f2-4f12-a858-f10998b075a0)

Additional context

presumably, this happens at this line in stage 1, due to updates of lvm2 3 weeks ago

to be clear, i don't use lvm, so it doesn't prevent system boot in my particular case. it's just a minor annoyance and a delay

Notify maintainers

@ajs124 @7c6f434c @Conni2461

Metadata

 - system: `"x86_64-linux"`
 - host os: `Linux 6.10.9, NixOS, 24.11 (Vicuna), 24.11.20240911.4f807e8`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.5`
 - nixpkgs: `/nix/store/2pw5bsq1r80lcvvh2wp89m142nln1zpl-source`
ajs124 commented 2 weeks ago

lvm just does that sometimes, not sure when.

IMO this is an upstream issue.

NightH4nter commented 2 weeks ago

well, hopefully, it doesn't actually prevent those using lvm from booting. thanks, closing

pshirshov commented 1 week ago

It doesn't prevent from booting but in my case it delays boot process for about 1 minute: I'm getting these two messages in an long loop before the boot continues...

pshirshov commented 1 week ago

Bit more details:

I have an encrypted zfs root with separate swap volume in my pool:

zroot             783G   139G   192K  none
zroot/root        749G   139G  57.9G  legacy
zroot/root/home   502G   139G   410G  legacy
zroot/root/nix    189G   139G   189G  legacy
zroot/swap       34.0G   141G  32.4G  -

zroot/swap is encrypted too, previously that didn't cause any issues. After some recent update I had to remove /dev/zd0 from swapDevices in order to avoid 1-minute delay before ZFS key prompt appears.

NightH4nter commented 1 week ago

well, yeah, in my case it does add a delay, which isn't a huge deal to me, but yes, removing my swap device, which in my case is a separate dataset too, helped trim this delay down to one lvm call. i guess i could suppress it with something stupid like

boot.initrd.preLVMCommands = ''alias lvm=echo $@'';

but that's probably too much

cch000 commented 1 week ago

I'm also getting this message, but in my case it does not add a delay. My setup is a btrfs partition and no swap partition. Is this an issue with lvm2?

dschrempf commented 1 week ago

I am also getting this message. It does not add a (recognizable) delay in my case.

emmanuelrosa commented 4 days ago

I'm also getting this message. I don't use LVM, but I do use device-mapper for LUKS. I can still boot.

7c6f434c commented 4 days ago

As I am not using NixOS stage1 (I do use LVM2 in bootscripts though) I can only easily say that LVM2 is not doing it without fd8/fd9 redirections present…

The redirection in stage1 looks like one half of some automagic…

spitfire94 commented 1 day ago

This is a good visual bandage, but not sure if it will restore bootup speed. Also there's definitely a better way of setting initrd environment variables.

boot.initrd.preLVMCommands = ''
  export LVM_SUPPRESS_FD_WARNINGS=1
'';