Swap partition vs swap file?

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post please read how to get help
Post Reply
octathlon
Level 2
Level 2
Posts: 61
Joined: Sat Jun 28, 2014 3:14 pm

Swap partition vs swap file?

Post by octathlon » Wed Jun 06, 2018 1:06 pm

I am still on Mint 17.2, planning to do a fresh install of 19 when it comes out. I read that instead of the usual swap partition, Mint now uses a swap file by default. Apparently this started sometime in version 18(?), but I haven't been able to find very much info on the implications.

I already have a swap partition, plenty of disk space available, and see no advantage to switching to a file, other than the ability to change its size later.

My questions are:
1. Will I be able to continue using my swap partition instead of a file, by mapping the partition to /swap at install as in the past?

2. If yes, then is there any reason I shouldn't just stick with my traditional swap partition?

Any other comments on file vs. partition welcome :)
Mint 19 Cinnamon 64bit on Dell Inspiron N7110 Dual core Intel Core i5-2450M
Mint 19 XFCE 64bit on System76 Pangolin Intel Core 2 duo
Full-time Linux user since 2007, Mint since 2014

User avatar
sdibaja
Level 5
Level 5
Posts: 676
Joined: Sun May 08, 2011 12:57 pm
Location: Baja California, Mexico

Re: Swap partition vs swap file?

Post by sdibaja » Wed Jun 06, 2018 1:55 pm

I don't know the answer to that but would sure like to.


slightly off topic
I already have a swap partition, plenty of disk space available, and see no advantage to switching to a file, other than the ability to change its size later.
You actually can change the size of any partition later, Gparted is the preferred tool. (I did that just yesterday, I made it smaller)
Peter
Mate desktop https://mate-desktop.org/
Debian GNU/Linux operating system: https://www.debian.org/distrib/

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

Re: Swap partition vs swap file?

Post by pbear » Wed Jun 06, 2018 2:24 pm

I've only just started my research on the topic, but my preliminary understanding is that the main motivation for the switch to swap file (which apparently came in with Ubuntu 17.04) is simplicity. Main disadvantage is that it's complicated to set up for hibernation.

Pretty sure you'll still be able to use a swap partition, but haven't seen anything indicating exactly what steps to follow.
Time flies like an arrow. Fruit flies like a banana.
If your problem has been solved, please edit the thread title.

User avatar
sdibaja
Level 5
Level 5
Posts: 676
Joined: Sun May 08, 2011 12:57 pm
Location: Baja California, Mexico

Re: Swap partition vs swap file?

Post by sdibaja » Wed Jun 06, 2018 2:49 pm

pbear wrote:
Wed Jun 06, 2018 2:24 pm
I've only just started my research on the topic, but my preliminary understanding is that the main motivation for the switch to swap file (which apparently came in with Ubuntu 17.04) is simplicity. Main disadvantage is that it's complicated to set up for hibernation.

Yes, you can still use a swap partition, but you'll have to do a custom ("Something Else") installation.
I did try "Something Else" with the M19 Beta... there no provision for even a /home partition ... I Did It but the contortions I needed to go thru were unreasonable. Maybe the older versions have a better installer.
Peter
Mate desktop https://mate-desktop.org/
Debian GNU/Linux operating system: https://www.debian.org/distrib/

octathlon
Level 2
Level 2
Posts: 61
Joined: Sat Jun 28, 2014 3:14 pm

Re: Swap partition vs swap file?

Post by octathlon » Wed Jun 06, 2018 3:08 pm

sdibaja wrote:
Wed Jun 06, 2018 2:49 pm

I did try "Something Else" with the M19 Beta... there no provision for even a /home partition ... I Did It but the contortions I needed to go thru were unreasonable. Maybe the older versions have a better installer.
That's bizarre, considering how many people use a separate partition for /home. :shock: Has there been any announcement about the change? I've watched a bunch of videos on the Beta and no one has mentioned that.
What did you do, then? Manually edit fstab to add it?
Mint 19 Cinnamon 64bit on Dell Inspiron N7110 Dual core Intel Core i5-2450M
Mint 19 XFCE 64bit on System76 Pangolin Intel Core 2 duo
Full-time Linux user since 2007, Mint since 2014

User avatar
sdibaja
Level 5
Level 5
Posts: 676
Joined: Sun May 08, 2011 12:57 pm
Location: Baja California, Mexico

Re: Swap partition vs swap file?

Post by sdibaja » Wed Jun 06, 2018 4:37 pm

octathlon wrote:
Wed Jun 06, 2018 3:08 pm
sdibaja wrote:
Wed Jun 06, 2018 2:49 pm

I did try "Something Else" with the M19 Beta... there no provision for even a /home partition ... I Did It but the contortions I needed to go thru were unreasonable. Maybe the older versions have a better installer.
That's bizarre, considering how many people use a separate partition for /home. :shock: Has there been any announcement about the change? I've watched a bunch of videos on the Beta and no one has mentioned that.
What did you do, then? Manually edit fstab to add it?
I don't know about announcements. This was my first LM install for a couple years or more.

No editing of fstab, I did not even look. I will to see if there is a swap file.
My notes are tied up on that machine, but from memory... I quit the installer, used Gparted to create the required partitions, then running the installer again I selected them, changing the properties with right click options.... specifically not formatting any (to preserve my labels) and choosing ignore for all of the swap partitions except the one I created for M19 (being concerned that they would be formatted changing the UUIDs, forcing me to edit fstab on 4 or 5 other distros on that machine.)
Peter
Mate desktop https://mate-desktop.org/
Debian GNU/Linux operating system: https://www.debian.org/distrib/

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

Re: Swap partition vs swap file?

Post by pbear » Wed Jun 06, 2018 5:53 pm

Hey sdibaja. Notice I edited my prior post while you were in the process of replying. Sorry about that. Made the change because I THINK I saw the suggestion about Something Else installation somewhere last evening, but not certain (might have been inference) and don't recall where.

Anyhoo, I'm now giving it a test. Seems to work, actually. At least, acknowledged I had set up a swap partition (and also allowed me to designate root and home mount points). Same installer as 18.x, by the way, though maybe different from the one you used in the past.

Will post back when the install completes, but felt I should make this post to clarify the confusion (my fault) about the prior post.

ETA: Install now complete without a hitch. fstab shows swap on a partition, root and home mounted on their partitions. Not sure what you did differently, but that's the problem, not any inherent impediment to using a swap partition in LM19.
Time flies like an arrow. Fruit flies like a banana.
If your problem has been solved, please edit the thread title.

User avatar
sdibaja
Level 5
Level 5
Posts: 676
Joined: Sun May 08, 2011 12:57 pm
Location: Baja California, Mexico

Re: Swap partition vs swap file?

Post by sdibaja » Wed Jun 06, 2018 6:29 pm

cool, I checked and my fstab looks normal with the sawp I intended to use... using the correct UUID
Peter
Mate desktop https://mate-desktop.org/
Debian GNU/Linux operating system: https://www.debian.org/distrib/

octathlon
Level 2
Level 2
Posts: 61
Joined: Sat Jun 28, 2014 3:14 pm

Re: Swap partition vs swap file?

Post by octathlon » Wed Jun 06, 2018 9:44 pm

Sounds like everything will be fine, then! :mrgreen:
Mint 19 Cinnamon 64bit on Dell Inspiron N7110 Dual core Intel Core i5-2450M
Mint 19 XFCE 64bit on System76 Pangolin Intel Core 2 duo
Full-time Linux user since 2007, Mint since 2014

User avatar
JoeFootball
Level 7
Level 7
Posts: 1728
Joined: Tue Nov 24, 2009 1:52 pm
Location: /home/usa/mn/minneapolis/joe

Re: Swap partition vs swap file?

Post by JoeFootball » Thu Jun 07, 2018 4:03 pm

octathlon wrote:I read that instead of the usual swap partition, Mint now uses a swap file by default. Apparently this started sometime in version 18(?) ...
It's my understanding that this feature started with Ubuntu 17.04. Since Linux Mint 18.x was built on Ubuntu 16.04, it didn't appear until Linux Mint 19.

Joe

fabien85
Level 7
Level 7
Posts: 1517
Joined: Tue Mar 11, 2014 4:30 pm

Re: Swap partition vs swap file?

Post by fabien85 » Fri Jun 08, 2018 1:40 pm

Yes indeed, everytime I installed Mint 18.x it created by default a swap partition. I tried Xubuntu 18.04 and Mint 19 beta and they use a swap file, but you can force them to use a swap partition using the "something else" option in the installer. With that option you can also have a separate /home, it works as it always used to.
So you can keep having you setup the way you want, no pb.

User avatar
Moem
Level 18
Level 18
Posts: 8674
Joined: Tue Nov 17, 2015 9:14 am
Location: The Netherlands
Contact:

Re: Swap partition vs swap file?

Post by Moem » Fri Jun 08, 2018 3:03 pm

octathlon wrote:
Wed Jun 06, 2018 3:08 pm
sdibaja wrote:
Wed Jun 06, 2018 2:49 pm
I did try "Something Else" with the M19 Beta... there no provision for even a /home partition ... I Did It but the contortions I needed to go thru were unreasonable. Maybe the older versions have a better installer.
That's bizarre, considering how many people use a separate partition for /home. :shock: Has there been any announcement about the change?
Are we sure this is a change? I've always had to make a /home partition by hand (Mint 17 and 18).
I would very much like to see an option for automated creation of a separate /home partition... doesn't even have to be default or recommended, just available.
Image

If your issue is solved, kindly indicate that by editing the first post in the topic, and adding [SOLVED] to the title. Thanks!

User avatar
sdibaja
Level 5
Level 5
Posts: 676
Joined: Sun May 08, 2011 12:57 pm
Location: Baja California, Mexico

Re: Swap partition vs swap file?

Post by sdibaja » Fri Jun 08, 2018 3:42 pm

Moem wrote:
Fri Jun 08, 2018 3:03 pm
>snip<
Are we sure this is a change? I've always had to make a /home partition by hand (Mint 17 and 18).
I would very much like to see an option for automated creation of a separate /home partition... doesn't even have to be default or recommended, just available.

Perhaps the Mint 19 installer is different than years past. I don't know. I forget.

Moem: just for grins download MX Linux and try their installer. I think it is pretty slick...
but maybe it is not "user friendly" for the typical LM user.
Peter
Mate desktop https://mate-desktop.org/
Debian GNU/Linux operating system: https://www.debian.org/distrib/

octathlon
Level 2
Level 2
Posts: 61
Joined: Sat Jun 28, 2014 3:14 pm

Re: Swap partition vs swap file?

Post by octathlon » Fri Jun 08, 2018 3:44 pm

Moem wrote:
Fri Jun 08, 2018 3:03 pm
Are we sure this is a change? I've always had to make a /home partition by hand (Mint 17 and 18).
I would very much like to see an option for automated creation of a separate /home partition... doesn't even have to be default or recommended, just available.
I think I just misunderstood. :oops: I thought sdibaja was saying that "something else" didn't give you the option to point /home or /swap to a different partition any more. But from the other responses here, it sounds like "something else" still works the same, no changes.
Mint 19 Cinnamon 64bit on Dell Inspiron N7110 Dual core Intel Core i5-2450M
Mint 19 XFCE 64bit on System76 Pangolin Intel Core 2 duo
Full-time Linux user since 2007, Mint since 2014

User avatar
Moem
Level 18
Level 18
Posts: 8674
Joined: Tue Nov 17, 2015 9:14 am
Location: The Netherlands
Contact:

Re: Swap partition vs swap file?

Post by Moem » Fri Jun 08, 2018 3:45 pm

sdibaja wrote:
Fri Jun 08, 2018 3:42 pm
Moem: just for grins download MX Linux and try their installer. I think it is pretty slick...
but maybe it is not "user friendly" for the typical LM user.
Been there, done that... and yes, I agree on both counts.
Image

If your issue is solved, kindly indicate that by editing the first post in the topic, and adding [SOLVED] to the title. Thanks!

diesel79
Level 1
Level 1
Posts: 37
Joined: Mon Jan 09, 2012 7:35 am

Re: Swap partition vs swap file?

Post by diesel79 » Sat Jun 09, 2018 7:09 am

Moem wrote:
Fri Jun 08, 2018 3:03 pm
octathlon wrote:
Wed Jun 06, 2018 3:08 pm
sdibaja wrote:
Wed Jun 06, 2018 2:49 pm
I did try "Something Else" with the M19 Beta... there no provision for even a /home partition ... I Did It but the contortions I needed to go thru were unreasonable. Maybe the older versions have a better installer.
That's bizarre, considering how many people use a separate partition for /home. :shock: Has there been any announcement about the change?
Are we sure this is a change? I've always had to make a /home partition by hand (Mint 17 and 18).
I would very much like to see an option for automated creation of a separate /home partition... doesn't even have to be default or recommended, just available.
I second that. I'd also love to see an automated creation processes for separate /home partition.

User avatar
Moem
Level 18
Level 18
Posts: 8674
Joined: Tue Nov 17, 2015 9:14 am
Location: The Netherlands
Contact:

Re: Swap partition vs swap file?

Post by Moem » Sat Jun 09, 2018 7:16 am

Image

If your issue is solved, kindly indicate that by editing the first post in the topic, and adding [SOLVED] to the title. Thanks!

Post Reply

Return to “Installation & Boot”