NixOS / calamares-nixos-extensions

NixOS calamares [maintainer=@vlinkz]
25 stars 20 forks source link

`swapon` executed twice #34

Open SuibianP opened 1 month ago

SuibianP commented 1 month ago

swapon was executed in both mount and nix during installation and errored out.

2024-05-21 - 14:50:33 [6]:     Starting job "mount" ( 11 / 15 ) 
2024-05-21 - 14:50:34 [6]: [PYTHON JOB]: Found gettext "en_GB" in "/nix/store/jx4z74g6hrw32l3cga2bcj64hc6y3sz4-calamares-3.3.3/share/locale/en_GB" 
2024-05-21 - 14:50:34 [6]:     .. Running ("swapon", "/dev/nvme0n1p3") 
2024-05-21 - 14:50:35 [6]:     .. Running ("mount", "-t", "ext4", "-o", "defaults", "/dev/nvme0n1p2", "/tmp/calamares-root-ydqidv1z/") 
2024-05-21 - 14:50:35 [6]:     .. Running ("udevadm", "settle") 
2024-05-21 - 14:50:35 [6]:     .. Running ("sync") 
2024-05-21 - 14:50:35 [6]:     .. Running ("mount", "-t", "vfat", "-o", "defaults", "/dev/nvme0n1p1", "/tmp/calamares-root-ydqidv1z/boot") 
2024-05-21 - 14:50:35 [6]:     .. Running ("udevadm", "settle") 
2024-05-21 - 14:50:35 [6]:     .. Running ("sync") 
2024-05-21 - 14:50:35 [6]:     .. Running ("mount", "-o", "b,i,n,d", "/dev", "/tmp/calamares-root-ydqidv1z/dev") 
2024-05-21 - 14:50:35 [6]:     .. Target cmd: ("mount", "-o", "b,i,n,d", "/dev", "/tmp/calamares-root-ydqidv1z/dev") Exit code: 32 output:
 mount: /tmp/calamares-root-ydqidv1z/dev: /dev is not a block device.
       dmesg(1) may have more information after failed mount system call.
2024-05-21 - 14:50:35 [6]:     .. Running ("udevadm", "settle") 
2024-05-21 - 14:50:35 [6]:     .. Running ("sync") 
2024-05-21 - 14:50:35 [2]: WARNING: [PYTHON JOB]: "Cannot mount /dev" 
2024-05-21 - 14:50:35 [6]:     .. Running ("mount", "-t", "proc", "-o", "defaults", "proc", "/tmp/calamares-root-ydqidv1z/proc") 
2024-05-21 - 14:50:35 [6]:     .. Running ("udevadm", "settle") 
2024-05-21 - 14:50:35 [6]:     .. Running ("sync") 
2024-05-21 - 14:50:36 [6]:     .. Running ("mount", "-t", "tmpfs", "-o", "defaults", "tmpfs", "/tmp/calamares-root-ydqidv1z/run") 
2024-05-21 - 14:50:36 [6]:     .. Running ("udevadm", "settle") 
2024-05-21 - 14:50:36 [6]:     .. Running ("sync") 
2024-05-21 - 14:50:36 [6]:     .. Running ("mount", "-o", "b,i,n,d", "/run/udev", "/tmp/calamares-root-ydqidv1z/run/udev") 
2024-05-21 - 14:50:36 [6]:     .. Target cmd: ("mount", "-o", "b,i,n,d", "/run/udev", "/tmp/calamares-root-ydqidv1z/run/udev") Exit code: 32 output:
 mount: /tmp/calamares-root-ydqidv1z/run/udev: /run/udev is not a block device.
       dmesg(1) may have more information after failed mount system call.
2024-05-21 - 14:50:36 [6]:     .. Running ("udevadm", "settle") 
2024-05-21 - 14:50:36 [6]:     .. Running ("sync") 
2024-05-21 - 14:50:36 [2]: WARNING: [PYTHON JOB]: "Cannot mount /run/udev" 
2024-05-21 - 14:50:36 [6]:     .. Running ("mount", "-t", "sysfs", "-o", "defaults", "sys", "/tmp/calamares-root-ydqidv1z/sys") 
2024-05-21 - 14:50:36 [6]:     .. Running ("udevadm", "settle") 
2024-05-21 - 14:50:36 [6]:     .. Running ("sync") 
2024-05-21 - 14:50:36 [6]: virtual void Calamares::JobThread::run()
2024-05-21 - 14:50:36 [6]:     Starting job "nixos" ( 12 / 15 ) 
2024-05-21 - 14:50:37 [6]: [PYTHON JOB]: Found gettext "en_GB" in "/nix/store/jx4z74g6hrw32l3cga2bcj64hc6y3sz4-calamares-3.3.3/share/locale/en_GB" 
2024-05-21 - 14:50:37 [2]: Calamares::Python::Object Calamares::Python::GlobalStorageProxy::value(const std::string&) const
2024-05-21 - 14:50:37 [2]:     WARNING: Unknown GS key hostname 
2024-05-21 - 14:50:37 [2]: Calamares::Python::Object Calamares::Python::GlobalStorageProxy::value(const std::string&) const
2024-05-21 - 14:50:37 [2]:     WARNING: Unknown GS key keyboardVConsoleKeymap 
2024-05-21 - 14:50:37 [6]:     .. Running ("swapon", "/dev/nvme0n1p3") 
2024-05-21 - 14:50:37 [6]:     .. Target cmd: ("swapon", "/dev/nvme0n1p3") Exit code: 255 output:
 swapon: /dev/nvme0n1p3: swapon failed: Device or resource busy
2024-05-21 - 14:50:37 [1]: ERROR: [PYTHON JOB]: "Failed to activate swap: /dev/mapper//dev/nvme0n1p3" 

Full session log: https://termbin.com/two0

Mistera91 commented 1 month ago

I still don't understand under which conditions this happens, because it does work sometimes, under specific conditions

dalto8 commented 1 month ago

This is potentially due to a change in Calamares 3.3 where swap is now activated automatically as part of the mount module.

Mistera91 commented 1 month ago

I got it working via a very very dirty fix : a well-timed sudo swapoff /dev/nvme0n1p3 (~2 seconds time frame) in-between the two swapons

cjshearer commented 1 week ago

I got it working via a very very dirty fix : a well-timed sudo swapoff /dev/nvme0n1p3 (~2 seconds time frame) in-between the two swapons

I used to think game devs were just getting lazy, but it turns out the quick time events were actually just training for installing NixOS.

jetpham commented 3 days ago

I got it working via a very very dirty fix : a well-timed sudo swapoff /dev/nvme0n1p3 (~2 seconds time frame) in-between the two swapons

Unfortunately this worked for me