You are not logged in.

#1 2023-05-27 17:09:50

avidseeker
Member
Registered: 2022-09-06
Posts: 68
Website

Arc hinstall: is swapon relevant?

During mounting, Arch install guide instructs: "If you created a swap volume, enable it with swapon(8):"

# swapon /dev/swap_partition

But

man swapon

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.

So as I understand,

swapon

would only enable swap in the live installation medium. And when the installation finishes, and Arch boots up from hard disk, init scripts will issue swapon. So what is the purpose of swapon in the first place?

Offline

#2 2023-05-27 18:04:30

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,471
Website

Re: Arc hinstall: is swapon relevant?

Caveat: I've not used swap in decades.

I believe running swapon ensures genfstab will create the proper fstab for the swap partition which will ensure it is enabled on each boot.  However, this can be less relevant on some systems (GPT disks perhaps) on which systemd will auto-detect swap partition types anways.

So you might say it's less relevant than it once was, but still good practice - and for some configurations it would be important to have the fstab entry and thus necessary to enable swap during the installation for genfstab to create it.

Last edited by Trilby (2023-05-27 20:00:00)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

Board footer

Powered by FluxBB