How to set up proper use of swapspace?Mounting a pendrive as a swap partition, having problemsSwap not available on System Monitorswapon: /dev/sdb1: swapon failed: Invalid argumentShould my swap size be zero or am I misunderstanding the output?How can I redetect swap partition after formating to enable hibernationSwap priority gets set to -1 on each bootAnother question about Using ZRAM for swapNot sure my swap is being used
Coworkers accusing me of "cheating" for working more efficiently
How to answer to the "We do not want to create any precedent" argument in salary negotiation?
Do you celebrate paying your mortgage off with colleagues?
Stripping the prefix of environment variable dynamically
How can I increase the rate of regeneration in humans without the possibility of tumors developing?
How to delete music as it's being played
How do the other crew members know the xenomorph is "big", if they haven't seen it?
Logical all/any in bash
How does this template code to get the size of an array work?
Does the UA Blade Mastery feat stack with itself?
As tourist in China do I have to fear consequences for having publicly liked South Park?
Plain Hunt Bell-Ringing
Did the Allies reverse the threads on secret microfilm-hiding buttons to thwart the Germans?
What's the short and accented note at the very end of a song called?
Why are Buddhist concepts so difficult?
Is there any physical evidence for motion?
What does exhaust smell on oil and transmission dipstick mean?
Why is Robin Hood French in Shrek?
What does "crank old Sabbath" refer to?
Trying to draw a circle with nodes
Rational Number RNG
Do players roll their own die?
For the Single Entry Schengen visa, do the microstates (Monaco, San Marino and the Vatican City) count?
Is Bcrypt a hashing algorithm or is my study material wrong?
How to set up proper use of swapspace?
Mounting a pendrive as a swap partition, having problemsSwap not available on System Monitorswapon: /dev/sdb1: swapon failed: Invalid argumentShould my swap size be zero or am I misunderstanding the output?How can I redetect swap partition after formating to enable hibernationSwap priority gets set to -1 on each bootAnother question about Using ZRAM for swapNot sure my swap is being used
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty
margin-bottom:0;
A somewhat long-ish question this time: How can I ensure my PC uses the proper swapspace? I'm lucky enough to have an SSD disk where I have formatted a partition as Linux Swap. Problem is: it is not used.
This is what the system reports:
$ cat /proc/swaps
Filename Type Size Used Priority
/swapfile file 2097148 0 -2
If I turn on my swap partition,
$ sudo swapon /dev/sdb5
I get:
$ cat /proc/swaps
Filename Type Size Used Priority
/swapfile file 2097148 0 -2
/dev/sdb5 partition 16831484 0 -3
Then turning off the swapfile:
$ sudo swapoff /swapfile
$ cat /proc/swaps
Filename Type Size Used Priority
/dev/sdb5 partition 16831484 0 -2
This all works very well, but how can I make this stick also across a reboot?
I could add these commands to my .profile I guess, but I would like the system to use proper swap space also when someone else (potentially) logs in, i.e. as a system setting. Most likely I'll see a big improvement when the system is taxed... But how? I'd love to see the /swapfile gone, but I'm terrified I might end up with a system that won't boot :)
(As a sidenote - I know I should avoid using /dev/sdb5 and rather use the UUID – well, I'll get there eventually..!)
swap
|
show 1 more comment
A somewhat long-ish question this time: How can I ensure my PC uses the proper swapspace? I'm lucky enough to have an SSD disk where I have formatted a partition as Linux Swap. Problem is: it is not used.
This is what the system reports:
$ cat /proc/swaps
Filename Type Size Used Priority
/swapfile file 2097148 0 -2
If I turn on my swap partition,
$ sudo swapon /dev/sdb5
I get:
$ cat /proc/swaps
Filename Type Size Used Priority
/swapfile file 2097148 0 -2
/dev/sdb5 partition 16831484 0 -3
Then turning off the swapfile:
$ sudo swapoff /swapfile
$ cat /proc/swaps
Filename Type Size Used Priority
/dev/sdb5 partition 16831484 0 -2
This all works very well, but how can I make this stick also across a reboot?
I could add these commands to my .profile I guess, but I would like the system to use proper swap space also when someone else (potentially) logs in, i.e. as a system setting. Most likely I'll see a big improvement when the system is taxed... But how? I'd love to see the /swapfile gone, but I'm terrified I might end up with a system that won't boot :)
(As a sidenote - I know I should avoid using /dev/sdb5 and rather use the UUID – well, I'll get there eventually..!)
swap
2
You have to edit your/etc/fstab
file - this is what configures which file systems get mounted where, including swap. Most people prefer to use a swap file these days though, because it is more flexible. Any specific reason why you'd prefer a partition?
– Byte Commander♦
May 29 at 21:14
2
New installs default to a swap file, but will use a swap partition. Most of the info on swap partitions is now old & outdated. You really do not want to use swap and probably do not need it if normal use and 4GB of RAM or more. help.ubuntu.com/community/SwapFaq Only if editing videos or have large databases in RAM may you need larger swap. Swap is orders of magnitude slower than RAM, so if you start using swap, you may want more RAM.
– oldfred
May 29 at 21:20
The only reason is that I want the swap space to be on the quick SSD disk. I could of course mount the disk somewhere in my directory structure, but then I would have to move the swapfile to this directory. That's maybe easier?
– Bernt Ribbum
May 29 at 21:25
Thanks for that info, @oldfred. My experience is 8GB of RAM and quite a bit of swapping, but that was a year or two ago. Things move quickly here!
– Bernt Ribbum
May 29 at 21:28
My old system had 4GB of RAM and never used swap. But ordinary desktop use. What were you doing to use 8GB of RAM? RAM is normally full, as it caches activity as we often go back and run something again and then it is in RAM, but that is released if needed for a new application.
– oldfred
May 29 at 21:37
|
show 1 more comment
A somewhat long-ish question this time: How can I ensure my PC uses the proper swapspace? I'm lucky enough to have an SSD disk where I have formatted a partition as Linux Swap. Problem is: it is not used.
This is what the system reports:
$ cat /proc/swaps
Filename Type Size Used Priority
/swapfile file 2097148 0 -2
If I turn on my swap partition,
$ sudo swapon /dev/sdb5
I get:
$ cat /proc/swaps
Filename Type Size Used Priority
/swapfile file 2097148 0 -2
/dev/sdb5 partition 16831484 0 -3
Then turning off the swapfile:
$ sudo swapoff /swapfile
$ cat /proc/swaps
Filename Type Size Used Priority
/dev/sdb5 partition 16831484 0 -2
This all works very well, but how can I make this stick also across a reboot?
I could add these commands to my .profile I guess, but I would like the system to use proper swap space also when someone else (potentially) logs in, i.e. as a system setting. Most likely I'll see a big improvement when the system is taxed... But how? I'd love to see the /swapfile gone, but I'm terrified I might end up with a system that won't boot :)
(As a sidenote - I know I should avoid using /dev/sdb5 and rather use the UUID – well, I'll get there eventually..!)
swap
A somewhat long-ish question this time: How can I ensure my PC uses the proper swapspace? I'm lucky enough to have an SSD disk where I have formatted a partition as Linux Swap. Problem is: it is not used.
This is what the system reports:
$ cat /proc/swaps
Filename Type Size Used Priority
/swapfile file 2097148 0 -2
If I turn on my swap partition,
$ sudo swapon /dev/sdb5
I get:
$ cat /proc/swaps
Filename Type Size Used Priority
/swapfile file 2097148 0 -2
/dev/sdb5 partition 16831484 0 -3
Then turning off the swapfile:
$ sudo swapoff /swapfile
$ cat /proc/swaps
Filename Type Size Used Priority
/dev/sdb5 partition 16831484 0 -2
This all works very well, but how can I make this stick also across a reboot?
I could add these commands to my .profile I guess, but I would like the system to use proper swap space also when someone else (potentially) logs in, i.e. as a system setting. Most likely I'll see a big improvement when the system is taxed... But how? I'd love to see the /swapfile gone, but I'm terrified I might end up with a system that won't boot :)
(As a sidenote - I know I should avoid using /dev/sdb5 and rather use the UUID – well, I'll get there eventually..!)
swap
swap
asked May 29 at 21:11
Bernt RibbumBernt Ribbum
307 bronze badges
307 bronze badges
2
You have to edit your/etc/fstab
file - this is what configures which file systems get mounted where, including swap. Most people prefer to use a swap file these days though, because it is more flexible. Any specific reason why you'd prefer a partition?
– Byte Commander♦
May 29 at 21:14
2
New installs default to a swap file, but will use a swap partition. Most of the info on swap partitions is now old & outdated. You really do not want to use swap and probably do not need it if normal use and 4GB of RAM or more. help.ubuntu.com/community/SwapFaq Only if editing videos or have large databases in RAM may you need larger swap. Swap is orders of magnitude slower than RAM, so if you start using swap, you may want more RAM.
– oldfred
May 29 at 21:20
The only reason is that I want the swap space to be on the quick SSD disk. I could of course mount the disk somewhere in my directory structure, but then I would have to move the swapfile to this directory. That's maybe easier?
– Bernt Ribbum
May 29 at 21:25
Thanks for that info, @oldfred. My experience is 8GB of RAM and quite a bit of swapping, but that was a year or two ago. Things move quickly here!
– Bernt Ribbum
May 29 at 21:28
My old system had 4GB of RAM and never used swap. But ordinary desktop use. What were you doing to use 8GB of RAM? RAM is normally full, as it caches activity as we often go back and run something again and then it is in RAM, but that is released if needed for a new application.
– oldfred
May 29 at 21:37
|
show 1 more comment
2
You have to edit your/etc/fstab
file - this is what configures which file systems get mounted where, including swap. Most people prefer to use a swap file these days though, because it is more flexible. Any specific reason why you'd prefer a partition?
– Byte Commander♦
May 29 at 21:14
2
New installs default to a swap file, but will use a swap partition. Most of the info on swap partitions is now old & outdated. You really do not want to use swap and probably do not need it if normal use and 4GB of RAM or more. help.ubuntu.com/community/SwapFaq Only if editing videos or have large databases in RAM may you need larger swap. Swap is orders of magnitude slower than RAM, so if you start using swap, you may want more RAM.
– oldfred
May 29 at 21:20
The only reason is that I want the swap space to be on the quick SSD disk. I could of course mount the disk somewhere in my directory structure, but then I would have to move the swapfile to this directory. That's maybe easier?
– Bernt Ribbum
May 29 at 21:25
Thanks for that info, @oldfred. My experience is 8GB of RAM and quite a bit of swapping, but that was a year or two ago. Things move quickly here!
– Bernt Ribbum
May 29 at 21:28
My old system had 4GB of RAM and never used swap. But ordinary desktop use. What were you doing to use 8GB of RAM? RAM is normally full, as it caches activity as we often go back and run something again and then it is in RAM, but that is released if needed for a new application.
– oldfred
May 29 at 21:37
2
2
You have to edit your
/etc/fstab
file - this is what configures which file systems get mounted where, including swap. Most people prefer to use a swap file these days though, because it is more flexible. Any specific reason why you'd prefer a partition?– Byte Commander♦
May 29 at 21:14
You have to edit your
/etc/fstab
file - this is what configures which file systems get mounted where, including swap. Most people prefer to use a swap file these days though, because it is more flexible. Any specific reason why you'd prefer a partition?– Byte Commander♦
May 29 at 21:14
2
2
New installs default to a swap file, but will use a swap partition. Most of the info on swap partitions is now old & outdated. You really do not want to use swap and probably do not need it if normal use and 4GB of RAM or more. help.ubuntu.com/community/SwapFaq Only if editing videos or have large databases in RAM may you need larger swap. Swap is orders of magnitude slower than RAM, so if you start using swap, you may want more RAM.
– oldfred
May 29 at 21:20
New installs default to a swap file, but will use a swap partition. Most of the info on swap partitions is now old & outdated. You really do not want to use swap and probably do not need it if normal use and 4GB of RAM or more. help.ubuntu.com/community/SwapFaq Only if editing videos or have large databases in RAM may you need larger swap. Swap is orders of magnitude slower than RAM, so if you start using swap, you may want more RAM.
– oldfred
May 29 at 21:20
The only reason is that I want the swap space to be on the quick SSD disk. I could of course mount the disk somewhere in my directory structure, but then I would have to move the swapfile to this directory. That's maybe easier?
– Bernt Ribbum
May 29 at 21:25
The only reason is that I want the swap space to be on the quick SSD disk. I could of course mount the disk somewhere in my directory structure, but then I would have to move the swapfile to this directory. That's maybe easier?
– Bernt Ribbum
May 29 at 21:25
Thanks for that info, @oldfred. My experience is 8GB of RAM and quite a bit of swapping, but that was a year or two ago. Things move quickly here!
– Bernt Ribbum
May 29 at 21:28
Thanks for that info, @oldfred. My experience is 8GB of RAM and quite a bit of swapping, but that was a year or two ago. Things move quickly here!
– Bernt Ribbum
May 29 at 21:28
My old system had 4GB of RAM and never used swap. But ordinary desktop use. What were you doing to use 8GB of RAM? RAM is normally full, as it caches activity as we often go back and run something again and then it is in RAM, but that is released if needed for a new application.
– oldfred
May 29 at 21:37
My old system had 4GB of RAM and never used swap. But ordinary desktop use. What were you doing to use 8GB of RAM? RAM is normally full, as it caches activity as we often go back and run something again and then it is in RAM, but that is released if needed for a new application.
– oldfred
May 29 at 21:37
|
show 1 more comment
2 Answers
2
active
oldest
votes
Unused swap is normal. For example here's my memory usage - this is my laptop and it's been up for 7 hours today while I'm working:
$ free -h
total used free shared buff/cache available
Mem: 15Gi 3.2Gi 8.5Gi 1.5Gi 3.8Gi 10Gi
Swap: 979Mi 0B 979Mi
The fact is that you don't want to be actively using swap. Sometimes Linux will put unused programs in swap if there is enough memory pressure and that's fine. But if you are actually running out of memory you should really just add more RAM. Even if you are using an SSD swapping is slooow.
The only reason to add more swap is if you want to hibernate your machine. In that case you will need at least as much swap as you have RAM.
Anyway - if for some reason you are unable to add more RAM you need to put another line in your /etc/fstab
for the new swap file. Something like this:
/dev/sdb5 none swap sw 0 0
It will now persist across reboots.
Side note:
If you want to see if your system is actively using swap use the dstat
command and look at the paging column.
Thanks, montjoy! That turned out to be exactly the solution in fact :)
– Bernt Ribbum
May 29 at 23:40
add a comment
|
As it was pointed out by @Byte Commander, you have to edit the /etc/fstab
file - this is what configures which file systems get mounted where, including swap.
All I had to do was to include the following line in my /etc/fstab
file:
/dev/sdb5 none swap sw 0 0
if your problem was solved, please include the necessary steps in your answer so future readers can benefit from it.
– danzel
May 29 at 23:25
Sure! The only reference to swap in my /etc/fstab is now this line: /dev/sdb5 none swap sw 0 0
– Bernt Ribbum
May 29 at 23:30
add a comment
|
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "89"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1147241%2fhow-to-set-up-proper-use-of-swapspace%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Unused swap is normal. For example here's my memory usage - this is my laptop and it's been up for 7 hours today while I'm working:
$ free -h
total used free shared buff/cache available
Mem: 15Gi 3.2Gi 8.5Gi 1.5Gi 3.8Gi 10Gi
Swap: 979Mi 0B 979Mi
The fact is that you don't want to be actively using swap. Sometimes Linux will put unused programs in swap if there is enough memory pressure and that's fine. But if you are actually running out of memory you should really just add more RAM. Even if you are using an SSD swapping is slooow.
The only reason to add more swap is if you want to hibernate your machine. In that case you will need at least as much swap as you have RAM.
Anyway - if for some reason you are unable to add more RAM you need to put another line in your /etc/fstab
for the new swap file. Something like this:
/dev/sdb5 none swap sw 0 0
It will now persist across reboots.
Side note:
If you want to see if your system is actively using swap use the dstat
command and look at the paging column.
Thanks, montjoy! That turned out to be exactly the solution in fact :)
– Bernt Ribbum
May 29 at 23:40
add a comment
|
Unused swap is normal. For example here's my memory usage - this is my laptop and it's been up for 7 hours today while I'm working:
$ free -h
total used free shared buff/cache available
Mem: 15Gi 3.2Gi 8.5Gi 1.5Gi 3.8Gi 10Gi
Swap: 979Mi 0B 979Mi
The fact is that you don't want to be actively using swap. Sometimes Linux will put unused programs in swap if there is enough memory pressure and that's fine. But if you are actually running out of memory you should really just add more RAM. Even if you are using an SSD swapping is slooow.
The only reason to add more swap is if you want to hibernate your machine. In that case you will need at least as much swap as you have RAM.
Anyway - if for some reason you are unable to add more RAM you need to put another line in your /etc/fstab
for the new swap file. Something like this:
/dev/sdb5 none swap sw 0 0
It will now persist across reboots.
Side note:
If you want to see if your system is actively using swap use the dstat
command and look at the paging column.
Thanks, montjoy! That turned out to be exactly the solution in fact :)
– Bernt Ribbum
May 29 at 23:40
add a comment
|
Unused swap is normal. For example here's my memory usage - this is my laptop and it's been up for 7 hours today while I'm working:
$ free -h
total used free shared buff/cache available
Mem: 15Gi 3.2Gi 8.5Gi 1.5Gi 3.8Gi 10Gi
Swap: 979Mi 0B 979Mi
The fact is that you don't want to be actively using swap. Sometimes Linux will put unused programs in swap if there is enough memory pressure and that's fine. But if you are actually running out of memory you should really just add more RAM. Even if you are using an SSD swapping is slooow.
The only reason to add more swap is if you want to hibernate your machine. In that case you will need at least as much swap as you have RAM.
Anyway - if for some reason you are unable to add more RAM you need to put another line in your /etc/fstab
for the new swap file. Something like this:
/dev/sdb5 none swap sw 0 0
It will now persist across reboots.
Side note:
If you want to see if your system is actively using swap use the dstat
command and look at the paging column.
Unused swap is normal. For example here's my memory usage - this is my laptop and it's been up for 7 hours today while I'm working:
$ free -h
total used free shared buff/cache available
Mem: 15Gi 3.2Gi 8.5Gi 1.5Gi 3.8Gi 10Gi
Swap: 979Mi 0B 979Mi
The fact is that you don't want to be actively using swap. Sometimes Linux will put unused programs in swap if there is enough memory pressure and that's fine. But if you are actually running out of memory you should really just add more RAM. Even if you are using an SSD swapping is slooow.
The only reason to add more swap is if you want to hibernate your machine. In that case you will need at least as much swap as you have RAM.
Anyway - if for some reason you are unable to add more RAM you need to put another line in your /etc/fstab
for the new swap file. Something like this:
/dev/sdb5 none swap sw 0 0
It will now persist across reboots.
Side note:
If you want to see if your system is actively using swap use the dstat
command and look at the paging column.
answered May 29 at 23:30
montjoymontjoy
112 bronze badges
112 bronze badges
Thanks, montjoy! That turned out to be exactly the solution in fact :)
– Bernt Ribbum
May 29 at 23:40
add a comment
|
Thanks, montjoy! That turned out to be exactly the solution in fact :)
– Bernt Ribbum
May 29 at 23:40
Thanks, montjoy! That turned out to be exactly the solution in fact :)
– Bernt Ribbum
May 29 at 23:40
Thanks, montjoy! That turned out to be exactly the solution in fact :)
– Bernt Ribbum
May 29 at 23:40
add a comment
|
As it was pointed out by @Byte Commander, you have to edit the /etc/fstab
file - this is what configures which file systems get mounted where, including swap.
All I had to do was to include the following line in my /etc/fstab
file:
/dev/sdb5 none swap sw 0 0
if your problem was solved, please include the necessary steps in your answer so future readers can benefit from it.
– danzel
May 29 at 23:25
Sure! The only reference to swap in my /etc/fstab is now this line: /dev/sdb5 none swap sw 0 0
– Bernt Ribbum
May 29 at 23:30
add a comment
|
As it was pointed out by @Byte Commander, you have to edit the /etc/fstab
file - this is what configures which file systems get mounted where, including swap.
All I had to do was to include the following line in my /etc/fstab
file:
/dev/sdb5 none swap sw 0 0
if your problem was solved, please include the necessary steps in your answer so future readers can benefit from it.
– danzel
May 29 at 23:25
Sure! The only reference to swap in my /etc/fstab is now this line: /dev/sdb5 none swap sw 0 0
– Bernt Ribbum
May 29 at 23:30
add a comment
|
As it was pointed out by @Byte Commander, you have to edit the /etc/fstab
file - this is what configures which file systems get mounted where, including swap.
All I had to do was to include the following line in my /etc/fstab
file:
/dev/sdb5 none swap sw 0 0
As it was pointed out by @Byte Commander, you have to edit the /etc/fstab
file - this is what configures which file systems get mounted where, including swap.
All I had to do was to include the following line in my /etc/fstab
file:
/dev/sdb5 none swap sw 0 0
edited May 30 at 6:17
efthialex
2,70118 silver badges30 bronze badges
2,70118 silver badges30 bronze badges
answered May 29 at 23:16
Bernt RibbumBernt Ribbum
307 bronze badges
307 bronze badges
if your problem was solved, please include the necessary steps in your answer so future readers can benefit from it.
– danzel
May 29 at 23:25
Sure! The only reference to swap in my /etc/fstab is now this line: /dev/sdb5 none swap sw 0 0
– Bernt Ribbum
May 29 at 23:30
add a comment
|
if your problem was solved, please include the necessary steps in your answer so future readers can benefit from it.
– danzel
May 29 at 23:25
Sure! The only reference to swap in my /etc/fstab is now this line: /dev/sdb5 none swap sw 0 0
– Bernt Ribbum
May 29 at 23:30
if your problem was solved, please include the necessary steps in your answer so future readers can benefit from it.
– danzel
May 29 at 23:25
if your problem was solved, please include the necessary steps in your answer so future readers can benefit from it.
– danzel
May 29 at 23:25
Sure! The only reference to swap in my /etc/fstab is now this line: /dev/sdb5 none swap sw 0 0
– Bernt Ribbum
May 29 at 23:30
Sure! The only reference to swap in my /etc/fstab is now this line: /dev/sdb5 none swap sw 0 0
– Bernt Ribbum
May 29 at 23:30
add a comment
|
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1147241%2fhow-to-set-up-proper-use-of-swapspace%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
2
You have to edit your
/etc/fstab
file - this is what configures which file systems get mounted where, including swap. Most people prefer to use a swap file these days though, because it is more flexible. Any specific reason why you'd prefer a partition?– Byte Commander♦
May 29 at 21:14
2
New installs default to a swap file, but will use a swap partition. Most of the info on swap partitions is now old & outdated. You really do not want to use swap and probably do not need it if normal use and 4GB of RAM or more. help.ubuntu.com/community/SwapFaq Only if editing videos or have large databases in RAM may you need larger swap. Swap is orders of magnitude slower than RAM, so if you start using swap, you may want more RAM.
– oldfred
May 29 at 21:20
The only reason is that I want the swap space to be on the quick SSD disk. I could of course mount the disk somewhere in my directory structure, but then I would have to move the swapfile to this directory. That's maybe easier?
– Bernt Ribbum
May 29 at 21:25
Thanks for that info, @oldfred. My experience is 8GB of RAM and quite a bit of swapping, but that was a year or two ago. Things move quickly here!
– Bernt Ribbum
May 29 at 21:28
My old system had 4GB of RAM and never used swap. But ordinary desktop use. What were you doing to use 8GB of RAM? RAM is normally full, as it caches activity as we often go back and run something again and then it is in RAM, but that is released if needed for a new application.
– oldfred
May 29 at 21:37