Swap partition vs swap file?

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
octathlon
Level 2
Level 2
Posts: 65
Joined: Sat Jun 28, 2014 3:14 pm

Swap partition vs swap file?

Post by octathlon »

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 :)
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Full-time Linux user since 2007, Mint since 2014
User avatar
sdibaja
Level 5
Level 5
Posts: 900
Joined: Sun May 08, 2011 12:57 pm
Location: Baja California, Mexico

Re: Swap partition vs swap file?

Post by sdibaja »

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://wiki.debian.org/MATE
Debian GNU/Linux operating system: https://www.debian.org/download
pbear
Level 16
Level 16
Posts: 6569
Joined: Wed Jun 21, 2017 12:25 pm
Location: San Francisco

Re: Swap partition vs swap file?

Post by pbear »

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.
User avatar
sdibaja
Level 5
Level 5
Posts: 900
Joined: Sun May 08, 2011 12:57 pm
Location: Baja California, Mexico

Re: Swap partition vs swap file?

Post by sdibaja »

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://wiki.debian.org/MATE
Debian GNU/Linux operating system: https://www.debian.org/download
octathlon
Level 2
Level 2
Posts: 65
Joined: Sat Jun 28, 2014 3:14 pm

Re: Swap partition vs swap file?

Post by octathlon »

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?
Full-time Linux user since 2007, Mint since 2014
User avatar
sdibaja
Level 5
Level 5
Posts: 900
Joined: Sun May 08, 2011 12:57 pm
Location: Baja California, Mexico

Re: Swap partition vs swap file?

Post by sdibaja »

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://wiki.debian.org/MATE
Debian GNU/Linux operating system: https://www.debian.org/download
pbear
Level 16
Level 16
Posts: 6569
Joined: Wed Jun 21, 2017 12:25 pm
Location: San Francisco

Re: Swap partition vs swap file?

Post by pbear »

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.
User avatar
sdibaja
Level 5
Level 5
Posts: 900
Joined: Sun May 08, 2011 12:57 pm
Location: Baja California, Mexico

Re: Swap partition vs swap file?

Post by sdibaja »

cool, I checked and my fstab looks normal with the sawp I intended to use... using the correct UUID
Peter
Mate desktop https://wiki.debian.org/MATE
Debian GNU/Linux operating system: https://www.debian.org/download
octathlon
Level 2
Level 2
Posts: 65
Joined: Sat Jun 28, 2014 3:14 pm

Re: Swap partition vs swap file?

Post by octathlon »

Sounds like everything will be fine, then! :mrgreen:
Full-time Linux user since 2007, Mint since 2014
User avatar
JoeFootball
Level 13
Level 13
Posts: 4674
Joined: Tue Nov 24, 2009 1:52 pm
Location: /home/usa/mn/minneapolis/joe

Re: Swap partition vs swap file?

Post by JoeFootball »

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: 1877
Joined: Tue Mar 11, 2014 4:30 pm

Re: Swap partition vs swap file?

Post by fabien85 »

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 22
Level 22
Posts: 16224
Joined: Tue Nov 17, 2015 9:14 am
Location: The Netherlands
Contact:

Re: Swap partition vs swap file?

Post by Moem »

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: 900
Joined: Sun May 08, 2011 12:57 pm
Location: Baja California, Mexico

Re: Swap partition vs swap file?

Post by sdibaja »

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://wiki.debian.org/MATE
Debian GNU/Linux operating system: https://www.debian.org/download
octathlon
Level 2
Level 2
Posts: 65
Joined: Sat Jun 28, 2014 3:14 pm

Re: Swap partition vs swap file?

Post by octathlon »

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.
Full-time Linux user since 2007, Mint since 2014
User avatar
Moem
Level 22
Level 22
Posts: 16224
Joined: Tue Nov 17, 2015 9:14 am
Location: The Netherlands
Contact:

Re: Swap partition vs swap file?

Post by Moem »

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

Re: Swap partition vs swap file?

Post by diesel79 »

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 22
Level 22
Posts: 16224
Joined: Tue Nov 17, 2015 9:14 am
Location: The Netherlands
Contact:

Re: Swap partition vs swap file?

Post by Moem »

Image

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

Return to “Installation & Boot”