Swap priority during boot
Posted: 07 Sep 2023, 11:12
How do I fine-tune the swap priority during boot.
In cheatcodes.txt there is only noswap and zram=some_value% mentioning swap, and both are not about the priority.
Details: I have one larger swap partition from my internal drive (8703 MB) - and currently also one from an external USB3-drive (4095 MB) and I would like to give the internal drive a higher priority.
man swapon says
Is there a way to use some kernel cheat code to adjust that or would I have to put code into /etc/rc.d/rc.local to swapoff the external drive swap partition and swapon that partition with lower priority. Default for the harddrive swap partitions is 1, so I could use e.g. -p -5
But that would mean when the order of the drives change, I would have to use another method to make sure the correct drive is handled, e.g. via UUID and not via /dev/sdc1
In cheatcodes.txt there is only noswap and zram=some_value% mentioning swap, and both are not about the priority.
Details: I have one larger swap partition from my internal drive (8703 MB) - and currently also one from an external USB3-drive (4095 MB) and I would like to give the internal drive a higher priority.
man swapon says
Code: Select all
Calls to swapon normally occur in the system boot scripts making all
swap devices available, so that the paging and swapping activity is
interleaved across several devices and files.
But that would mean when the order of the drives change, I would have to use another method to make sure the correct drive is handled, e.g. via UUID and not via /dev/sdc1