I have a system with a dedicated swap partition, running a custom distribution generated by Yocto.
On startup, during init, I can see the first swapon command successfully activating the swap space. A second swapon is sent, which subsequently fail (with a swapon failed: Device or resource busy
since the swap partition has already been activated).
However, once fully started, I realised the swap space was not used by the system and is shown as deleted by swapon --show
and cat /proc/swaps
:
root@machine:~# swapon --show
Filename Type Size Used Priority
/dev/mmcblk0p4 (deleted) partition 1023996 0 -1
I wonder what causes the swap partition to be shown as deleted?
udev
isn’t re-triggered (assuming it’s used at all). A simplerm
can remove a device node... However, I wouldn’t expect that to prevent the swap from being used. – Stephen Kitt Feb 28 '18 at 12:00/dev
. I didn't need this functionality, so I just prevented it from happening. Thanks for the details! – gromain Feb 28 '18 at 15:02