|
|
Log in / Subscribe / Register

Swap across multiple storage hardware

Swap across multiple storage hardware

Posted Apr 22, 2025 7:00 UTC (Tue) by mathstuf (subscriber, #69389)
In reply to: Swap across multiple storage hardware by Wol
Parent article: Three ways to rework the swap subsystem

> To the best of my knowledge, (by default) swap is allocated a priority based on its order in fstab. So you should list devices in order of speed.

Is this just "mount order"? How else are manually-mounted swap devices or systemd `.mount` swap units prioritized? It feels strange (to me) that the kernel would read `/etc/fstab` and make such policy decisions based on it.


to post comments

Swap across multiple storage hardware

Posted Apr 22, 2025 18:52 UTC (Tue) by edgewood (subscriber, #1123) [Link]

"swapon" on the command line accepts a priority option, and passes that priority to the kernel. "pri=" in fstab does the same thing, and systemd presumably also does the same. So the kernel tracks the priority, no matter where it came from originally.

The swapon(2) man page describes what the kernel does with priorities if there is more than one swap device.


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds