LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   Swap partition options? (https://www.linuxquestions.org/questions/linux-hardware-18/swap-partition-options-4175573391/)

Keruskerfuerst 02-27-2016 03:09 AM

Swap partition options?
 
Are there some swap partition options for swap, that can written into fstab?

pan64 02-27-2016 03:55 AM

https://www.linux.com/news/software/...nux-swap-space

rknichols 02-27-2016 09:02 AM

The only option I'm aware of is priority, which would be entered as "pri=<value>" in the fstab options field. Higher numbers indicate higher priority (default is -1).

Emerson 02-27-2016 09:19 AM

Quote:

Originally Posted by rknichols (Post 5507124)
The only option I'm aware of is priority, which would be entered as "pri=<value>" in the fstab options field. Higher numbers indicate higher priority (default is -1).

Priority may be needed if you have more than one swap partition or file or combination of two.

jefro 03-01-2016 03:12 PM

For some reason I think you can set up a raid array of swap too. Can't find it right now.

Keruskerfuerst 03-02-2016 01:56 AM

I meant fstab options for mounting, not for raid setup.

BW-userx 03-02-2016 11:12 AM

as in how to mount a swap drive?

Code:

UUID=9fc76062-7c86-4d2a-945a-2ca4579eed24 none swap sw 0 0
then issue

sudo mount -a

I am assuming you know all about UUID's and /dev/sdax

if not
Code:

sudo blkid
to get both your UUID and /dev/sdxx

you can created a swap partition anywhere within the file system,
Code:

/dev/sda
/dev/sdb
/dev/sdc
etc..

even create a swap file on the fly mount it swap on .. then turn it off then delete it when you no longer need it.

if it is something other then what has already been presented to you by me and the others, please clarify.

jefro 03-02-2016 03:46 PM

I said raid swap. I didn't say raid. You can use swap in a raid configuration. I don't mean swap in a raid array.

Keruskerfuerst 03-09-2016 01:58 PM

When mounting "normal" partitions, some mount options do exist - like relatime, noatime, nodiratime,...

Is there any option, which affects swap partition performance?

Apart from that, I know two options not mentioned above:
1. crypt swap
2. clear swap on shutdown

pan64 03-10-2016 01:01 AM

relatime, noatime, nodiratime have no any meaning on a swap partition. crypting may affect performance.

BW-userx 03-10-2016 06:38 AM

I think that where you put it is what really matters. reminds me of a parse I once heard, but if you put your swap on the front end of the HDD that is actually in the middle of the platter where it spins the fastest. therefore, it reads and writes quicker.

which does fall into the options category because you do have the option of creating else where on the platter.

sundialsvcs 03-10-2016 07:56 AM

Today, that's somewhat irrelevant. Hard drives, themselves, have become quite "smart" (no pun intended), and have many on-board caching and self-diagnostic capabilities.

For ordinary purposes, though, I think it's hard to beat swapping to a disk file, and to then keep the "swappiness" to a reasonable default. Most computers these days don't spend much time swapping, and don't use much swap, although they should have "some place to swap to" when they actually need to do so.

Per contra, laptop computers often need to be able to quickly "hibernate," which does use the swap facility and which in some instances requires a partition. "YMMV.™"

rknichols 03-10-2016 08:27 AM

Quote:

Originally Posted by Keruskerfuerst (Post 5512834)
I know two options not mentioned above:
1. crypt swap
2. clear swap on shutdown

The original question was about options that can be put into the /etc/fstab entry, and neither of those qualify.


All times are GMT -5. The time now is 03:39 PM.