SOLVED clarification, swapfile swappartition HDD and SSD on installation

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
Post Reply
decrepit
Level 3
Level 3
Posts: 166
Joined: Mon Dec 03, 2018 4:07 am

SOLVED clarification, swapfile swappartition HDD and SSD on installation

Post by decrepit » Sun Aug 18, 2019 1:49 am

I'm asking this on Newbies, because I think the answer will be applicable to some of them.

I have a think pad and desktop with 19.1 and 19.2 mint mate. The thinkpad has only one SSD and has a swapfile of 2Gb on it.
The desktop has a 1Tb HDD with lots of old installs on it, with a 7.5Gb swap partition, and a recently installed SSD with 19.2 on it that has no swapfile.

So my question is, how the installer handles swap, it looks like if there's an existing swap partition, it uses that.
But in the case where there's no existing swap partition, but both a HDD and SSD present, and / going on the SSD, does the installer automatically put swap on the HDD?

If not should a swap partition be created on the HDD before installation?
Last edited by decrepit on Sun Aug 18, 2019 8:48 pm, edited 1 time in total.

Petermint
Level 5
Level 5
Posts: 653
Joined: Tue Feb 16, 2016 3:12 am

Re: clarification, swapfile swappartition HDD and SSD on installation

Post by Petermint » Sun Aug 18, 2019 4:11 am

The system can use a swap file in an existing partition without you creating a swap partition. You can easily change the size of the swap file without reallocating partitions. You might find it easier to remove all the swap partitions and use swap files.

My machine is a clean install of LM 19 with default settings and no swap partition. The memory is 4 GB and the default swap file was 2 GB. I recently changed that to 8 GB for one application.

decrepit
Level 3
Level 3
Posts: 166
Joined: Mon Dec 03, 2018 4:07 am

Re: clarification, swapfile swappartition HDD and SSD on installation

Post by decrepit » Sun Aug 18, 2019 4:52 am

Thanks Peter but maybe I'm not being clear here, that doesn't answer my question.

My main point is that it's not good for an SSD to use it for swap, too many read, write, delete operations wears it out quickly.
Swap is a bad offender in this regard.
That's why I'm interested to know whether it's necessary, to create a swap partition on the HDD so a swapfile isn't created and used on the SSD.

Petermint
Level 5
Level 5
Posts: 653
Joined: Tue Feb 16, 2016 3:12 am

Re: clarification, swapfile swappartition HDD and SSD on installation

Post by Petermint » Sun Aug 18, 2019 5:55 am

The swap file in my system rarely receives a write. It sits at zero most of the time. Of the 4 GB memory, the max usage in Linux Mint Cinnamon often sits below 2 GB. I do not use Google Chrome. Most of the applications i use will also run on Windows. Most use less memory than the Windows equivalents. The one time I had to use Windows 10, it sat up above 3 GB.

If paging is a big problem, then that is a good reason to use SSD to gain speed.

You can direct a swap file to any device, as shown in the following page and many others.
https://www.linuxuprising.com/2018/08/h ... -swap.html

decrepit
Level 3
Level 3
Posts: 166
Joined: Mon Dec 03, 2018 4:07 am

Re: clarification, swapfile swappartition HDD and SSD on installation

Post by decrepit » Sun Aug 18, 2019 7:16 am

So Peter, I'm still not sure what your answer is.
Are you saying creating a swap partition on the HDD before installation, isn't necessary because you can change the position of the swapfile to the HDD if it ends up on the SSD?
Or the swap file is OK on the SSD because it isn't used much?
Or something else?

pbear
Level 7
Level 7
Posts: 1839
Joined: Wed Jun 21, 2017 12:25 pm
Location: San Francisco

Re: clarification, swapfile swappartition HDD and SSD on installation

Post by pbear » Sun Aug 18, 2019 11:04 am

decrepit wrote:
Sun Aug 18, 2019 1:49 am
... in the case where there's no existing swap partition, but both a HDD and SSD present, and / going on the SSD, does the installer automatically put swap on the HDD?

If not should a swap partition be created on the HDD before installation?
Answer to the first question is "no" (swap file goes in root). Answer to the second question is "I wouldn't bother, but won't hurt either."

Understand, the fuss about coddling SSDs is anachronistic. Was a problem early on, but now their expected lifespan in service hours is greater than most HDDs. And, as Petermint says, swap gets used very little if you have 4 GB of memory, so this is much ado about nothing (imho).
Time flies like an arrow. Fruit flies like a banana.
If your problem has been solved, please edit the thread title.

gm10
Level 18
Level 18
Posts: 8749
Joined: Thu Jun 21, 2018 5:11 pm

Re: clarification, swapfile swappartition HDD and SSD on installation

Post by gm10 » Sun Aug 18, 2019 11:12 am

decrepit wrote:
Sun Aug 18, 2019 7:16 am
Are you saying creating a swap partition on the HDD before installation, isn't necessary because you can change the position of the swapfile to the HDD if it ends up on the SSD?
Or the swap file is OK on the SSD because it isn't used much?
Or something else?
You can put your swap file wherever you want after installation completes. The installer itself will always place it in the root partition, i.e. the place that you install Linux Mint to.

And to echo the sentiment expressed above, it also seems extremely absurd to me to want to place swap on a slow HDD when a fast SSD is available.
Tune up your LM 19.x: ppa:gm10/linuxmint-tools

Rocky Bennett
Level 5
Level 5
Posts: 528
Joined: Tue May 12, 2015 6:22 pm

Re: clarification, swapfile swappartition HDD and SSD on installation

Post by Rocky Bennett » Sun Aug 18, 2019 11:43 am

decrepit wrote:
Sun Aug 18, 2019 1:49 am
I'm asking this on Newbies, because I think the answer will be applicable to some of them.

I have a think pad and desktop with 19.1 and 19.2 mint mate. The thinkpad has only one SSD and has a swapfile of 2Gb on it.
The desktop has a 1Tb HDD with lots of old installs on it, with a 7.5Gb swap partition, and a recently installed SSD with 19.2 on it that has no swapfile.

So my question is, how the installer handles swap, it looks like if there's an existing swap partition, it uses that.
But in the case where there's no existing swap partition, but both a HDD and SSD present, and / going on the SSD, does the installer automatically put swap on the HDD?

If not should a swap partition be created on the HDD before installation?


Instead of asking this question of newbies, you might want to ask the veterans instead. Why are you only asking newbies anyway, they just usually install a new install in an automatic way.

As an aside, I never use a swap partition even if I don't have a swap file. I really feel that with 4 GB of RAM there is no need for a swap partition. I only use SSDs, I have not had a spinning hard drive in over 6 years.

athi
Level 6
Level 6
Posts: 1298
Joined: Sun Mar 30, 2014 10:15 am
Location: USA

Re: clarification, swapfile swappartition HDD and SSD on installation

Post by athi » Sun Aug 18, 2019 12:02 pm

decrepit wrote:
Sun Aug 18, 2019 1:49 am
I'm asking this on Newbies, because I think the answer will be applicable to some of them.

I have a think pad and desktop with 19.1 and 19.2 mint mate. The thinkpad has only one SSD and has a swapfile of 2Gb on it.
The desktop has a 1Tb HDD with lots of old installs on it, with a 7.5Gb swap partition, and a recently installed SSD with 19.2 on it that has no swapfile.

So my question is, how the installer handles swap, it looks like if there's an existing swap partition, it uses that.
But in the case where there's no existing swap partition, but both a HDD and SSD present, and / going on the SSD, does the installer automatically put swap on the HDD?

If not should a swap partition be created on the HDD before installation?
If you use the Something Else option, you can create a SWAP partition where you want or specify which SWAP partition to use during installation.
Mint Mate 19.1. Main rig is HP 800G2 I5 6500 16GB ram, 120GB boot drive, 2x3TB, 1x4TB data drives. Oldest rig is Mate 18.3 on Dell D620 with 32bits core duo.

gm10
Level 18
Level 18
Posts: 8749
Joined: Thu Jun 21, 2018 5:11 pm

Re: clarification, swapfile swappartition HDD and SSD on installation

Post by gm10 » Sun Aug 18, 2019 12:25 pm

Rocky Bennett wrote:
Sun Aug 18, 2019 11:43 am
Instead of asking this question of newbies, you might want to ask the veterans instead. Why are you only asking newbies anyway, they just usually install a new install in an automatic way.

As an aside, I never use a swap partition even if I don't have a swap file. I really feel that with 4 GB of RAM there is no need for a swap partition. I only use SSDs, I have not had a spinning hard drive in over 6 years.
He wasn't asking newbies, he explained why he asked in the Newbie Questions forum. Anyway, only answering to mention that having no swap can lead your system to lock up when you run out of RAM and the kernel doesn't find anything to kill, so it is very much not recommended not to have any form of swap. If you manage to stay within 4 GB RAM that's great - I'd never be able to, but it entirely depends on what you do with the machine, of course.
Tune up your LM 19.x: ppa:gm10/linuxmint-tools

decrepit
Level 3
Level 3
Posts: 166
Joined: Mon Dec 03, 2018 4:07 am

Re: clarification, swapfile swappartition HDD and SSD on installation

Post by decrepit » Sun Aug 18, 2019 8:47 pm

OK, thanks guys, and Peter, sorry for being obtuse, later posts have clarified what you meant.

The overall opinion, is that a swapfile on an SSD isn't a problem and it's fine to let the installer do it's thing.

User avatar
bob466
Level 5
Level 5
Posts: 622
Joined: Mon May 15, 2017 5:23 am
Location: Australia

Re: SOLVED clarification, swapfile swappartition HDD and SSD on installation

Post by bob466 » Sun Aug 18, 2019 9:52 pm

Years ago when 32bit Systems were used and Ram was limited to 4GB...a Swap partition (virtual memory) was needed. The rule was 1.5GB of Swap (virtual memory) x by that of physical memory but that is now a thing of the past. :D

These days with 64bit Systems a Swap File which is created upon installation of 2GB is just fine because if there's a Ram problem..add more. :D I'm running Cinnamon 19.1 on a 500GB SSD with 16GB of Ram installed...my Motherboard can handle 32GB of Ram...so I'll never need Swap. Image :lol: :lol: :D

If you're running an SSD you should Optimize your SSD for longer life...have a look at this by one of our members...https://easylinuxtipsproject.blogspot.com/p/ssd.html
Linux For Ever...Windoze Never Image

Post Reply

Return to “Newbie Questions”