Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
SwapFile V partitioned Swap-Space
#1
In today's tech with virtual machines being the new norm for checking new distros why are we still using partitioned swap-space? swap-file is SO much easier to setup, and modify. I can not think of a single reason why a partition would be better. I used to think that it would be better if you had multiple Linux systems on metal, but that was squashed the first time I hibernated one system and loaded another. it messed up the hibernated system. so, now I am strictly swap-file. I am surre many will dissagree, and that is ok. if you have a swap partition I am not busting your chops. it works fine. it is just more difficult to modify. 

for those who use swapfile i have a simple script that makes modifying it as simple as it gets. it is not flashy, or fancy, but it works flawlessly and it is so fast.

It can be found here.


if you have an opinion, advice, an idea you would like to share I accept all input. even critics.

kudos
A computer without Microsoft is like a piece of chocolate cake without ketchup and mustard.
-
It is okay to not be able to answer a question,
however it should be a crime to not be able to question an answer.

@ArrowLinux
Reply
#2
I do test installs of Lots of distros. Using a virtual machine does not test the ease of use or capabilities of the Installer...so I do a bare metal install.
in my opinion any distro that has a funky installer (not having the facility to manipulate labels, names, locations, etc. of partitions, is crap).

Swap partitions are poorly treated by many installers...or ignored and screwed up.
you need a script to manipulate a swap file? seems like a bit of extra work to me.

BTW: I don't find swap partitions difficult at all. Can I help you with that?

whatever you prefer.
Reply
#3
I have begun using the zfs file system, which apparently does not support swap files. I have two virtual Ubuntu machines running now on zfs, 19.10 and 20.04. The default installer set up swap partitions on both.

I am attracted to zfs for a number of reasons, among them:
  • the capability to take snapshots of the current state using essentially no additional disk space.
  • the self-repairing aspect
I am currently in the process of installing an Arch virtual machine on zfs. Now, that is a challenge.

Richard
Reply
#4
(01-31-2020, 06:52 PM)mexsudo Wrote: Swap partitions are poorly treated by many installers...or ignored and screwed up.
you need a script to manipulate a swap file? seems like a bit of extra work to me.

You have a good point about the installers. To be honest, that is one of the things that got me looking at swapfile to begin with.
And as far as the script goes, need is not the word I would use, but the scrip does simplify things.

(01-31-2020, 06:52 PM)mexsudo Wrote: BTW: I don't find swap partitions difficult at all. Can I help you with that?
May I ask what file system you use?
On my metal I have to load into a USB  to be able to change any drive partition. Because the partitions on the drive have to be unmounted. And that is a little hard to do if you are using it.
I know that there are some file systems that allow for this but I am not familiar with them. that is why I ask.

(01-31-2020, 08:32 PM)Richard Wrote: I have begun using the zfs file system, which apparently does not support swap files. I have two virtual Ubuntu machines running now on zfs, 19.10 and 20.04. The default installer set up swap partitions on both.

I am attracted to zfs for a number of reasons, among them:
  • the capability to take snapshots of the current state using essentially no additional disk space.
  • the self-repairing aspect
I am currently in the process of installing an Arch virtual machine on zfs. Now, that is a challenge.

Interesting. I will look into that.

ZFS. what does that stand for?

I doubt I will use it on metal, because of the aforementioned swap issue. but there are other aspect that are very intriguing to me
I will definitely try it in a VM

Also, if you have any questions about Arch, you know how to reach me.

kudos

(01-31-2020, 06:52 PM)mexsudo Wrote: I do test installs of Lots of distros. Using a virtual machine does not test the ease of use or capabilities of the Installer...so I do a bare metal install.

You have a decent point there,
When I am choosing a distro to go on my metal I first spin it up in a VM to see if I like it, then after testing for a while I put it on metal
For the very reasons you mentioned. For hardware testing. then if all goes well, it stays there.
I do not disagree on this point. a VM can only show you so much about the system.

kudos
A computer without Microsoft is like a piece of chocolate cake without ketchup and mustard.
-
It is okay to not be able to answer a question,
however it should be a crime to not be able to question an answer.

@ArrowLinux
Reply
#5
@eliasw4u
I use Debian, Mate desktop, ext4 file system.
Typically I have 2 or three other operating systems on the same machine, with Gparted.

I already know what I want and like, but I test others to see if some feature is desired. Most ate already in the Debian repos.

The Calamares Installer (run from the desktop in the Live Debian versions) is a frequent problem.
The Debian Installer, manual mode, has a gazillion features and options, mostly the defaults are best for me.
with all of the systems aboard I really like to label as I go.


https://mega.nz/#!EOJyXSrQ!rWSR55eEnnhUh...Tqsodc6MoM
Reply
#6
(02-01-2020, 03:28 AM)mexsudo Wrote: @eliasw4u
I use Debian, Mate desktop, ext4 file system.
Typically I have 2 or three other operating systems on the same machine, with Gparted.

I already know what I want and like, but I test others to see if some feature is desired. Most ate already in the Debian repos.

The Calamares Installer (run from the desktop in the Live Debian versions) is a frequent problem.
The Debian Installer, manual mode, has a gazillion features and options, mostly the defaults are best for me.
with all of the systems aboard I really like to label as I go.

Whenever I go to put a system on metal, I first setup the partitions and labels with Gparted. I am old school and like my hardware to have its own home partition. As for the other partitions, it depends on the BOX I am putting it in.

I myself use Arch, Ubuntu, Mint, and Peppermint. my top choice is Arch. but its not for everyone. back in 2000-2004 I had a system with Debian. It is a solid system. Good choice.

However,

How do you manipulate your swap partition without loading into a different OS?
Sure, you could swapoff but your other partitions would still be mounted.
Which is my point. With my script swapfile size can be changed in less than a second, without leaving the system your changing.
Unless I am missing something, changing a partition is a little more involved and time consuming.
If I am wrong let me know, and please explain.

kudos
A computer without Microsoft is like a piece of chocolate cake without ketchup and mustard.
-
It is okay to not be able to answer a question,
however it should be a crime to not be able to question an answer.

@ArrowLinux
Reply
#7
I stated above:

Quote:I am currently in the process of installing an Arch virtual machine on zfs. Now, that is a challenge.

I decided not to reinvent the wheel. I found an .iso in GitHub that does the job.

https://github.com/danboid/ALEZ/releases

I now have an Arch virtual machine running on the ZFS file system. It is running in TTY with no desktop yet, but it seems to work fine.

The installer did not make a swap partition. We'll see what happens.

I will install either a LXDE or a LXQt desktop. Or maybe clone it and install one of each and see which works best.

I am working towards developing an OS to switch to on my main machine when Ubuntu 16.04 reaches its end of life. Right now Arch on ZFS is the prime candidate.

Richard
Reply
#8
(02-02-2020, 01:08 AM)eliasw4u Wrote:
(02-01-2020, 03:28 AM)mexsudo Wrote: @eliasw4u
I use Debian, Mate desktop, ext4 file system.
Typically I have 2 or three other operating systems on the same machine, with Gparted.

I already know what I want and like, but I test others to see if some feature is desired. Most ate already in the Debian repos.

The Calamares Installer (run from the desktop in the Live Debian versions) is a frequent problem.
The Debian Installer, manual mode, has a gazillion features and options, mostly the defaults are best for me.
with all of the systems aboard I really like to label as I go.

Whenever I go to put a system on metal, I first setup the partitions and labels with Gparted. I am old school and like my hardware to have its own home partition. As for the other partitions, it depends on the BOX I am putting it in.

I myself use Arch, Ubuntu, Mint, and Peppermint. my top choice is Arch. but its not for everyone. back in 2000-2004 I had a system with Debian. It is a solid system. Good choice.

However,

How do you manipulate your swap partition without loading into a different OS?
Sure, you could swapoff but your other partitions would still be mounted.
Which is my point. With my script swapfile size can be changed in less than a second, without leaving the system your changing.
Unless I am missing something,  changing a partition is a little more involved and time consuming.
If I am wrong let me know, and please explain.

kudos

it's all in the power and features of the installer.
some of the basic features of the Debian Installer:

during the install process
you create the swap partition size and location, or none if you prefer.
you can also select which pre-existing swap partitions are to Not be mounted. (default is mount and format, undesirable)

you can also label the new partitions when you create them.

when you run a Different OS the fstab of that OS does not point to the new swap partition, it is ignored.
when you later install a Different OS you are at the mercy of that installer and the options it provides... most seem to want to automatically mount All the swaps found in their fstab. that is a pain in the tush.

DI is a bit complicated(detailed) and the terminology may confound you at first.

PS: I use a swap partition out of habit. I am fortunate that few of the machines I install on need to use any swap space, ever.
I have setup several recently and put them in the office environment without swap to no ill effect.
Reply
#9
(02-02-2020, 03:58 PM)mexsudo Wrote: it's all in the power and features of the installer.
some of the basic features of the Debian Installer:

during the install process
you create the swap partition size and location, or none if you prefer.
you can also select which pre-existing swap partitions are to Not be mounted. (default is mount and format, undesirable)

you can also label the new partitions when you create them.

when you run a Different OS the fstab of that OS does not point to the new swap partition, it is ignored.
when you later install a Different OS you are at the mercy of that installer and the options it provides... most seem to want to automatically mount All the swaps found in their fstab. that is a pain in the tush.

DI is a bit complicated(detailed) and the terminology may confound you at first.

PS: I use a swap partition out of habit. I am fortunate that few of the machines I install on need to use any swap space, ever.
I have setup several recently and put them in the office environment without swap to no ill effect.

Oh ok so the trick is to have more than one swap partition. makes since. some might argue that it is a wast of space, but if you have the excess go for it.

As for the fstab having all swap-parts being regestered, just remove the ones you don't want from fstab. easy.

BUT! make sure to make a backup of fstab first.
simple as that. Then they wont be mounted at boot.


Gparted will give you the UUID info so you know which one(s) to remove

IMHO swapfile is still easier and faster. Big Grin ...... But there are some cases where a swap-part is needed, or a must, like Richard mentioned. And then there is the fact that we are creatures of habit (Including myself) we use what works for us. Generally we don't want to change, even if the change is vastly better. It is only when our habits stop working for us that we begin to look elsewhere. When I first learned about swapfiles I turned my nose up at it for a year. It wasn't until that swap-part fopar happened that I started looking at swapfile.

So, I am not judging anyone. If swap-part works for you then by all means keep using it.
My goal here Is not to bash (no pun intended) on swap-part users, it is only to broaden peoples horizons, to get opinions from fellow Linux users, and also to showcase my little swapfile scrip. even though it is a very basic and simple script, it is effective.

mexsudo, and Richard, Thank you for your opinions, input, and info. You actually changed my opinion (A little) Wink

kudos
A computer without Microsoft is like a piece of chocolate cake without ketchup and mustard.
-
It is okay to not be able to answer a question,
however it should be a crime to not be able to question an answer.

@ArrowLinux
Reply
#10
(02-02-2020, 08:21 PM)eliasw4u Wrote:
(02-02-2020, 03:58 PM)mexsudo Wrote: it's all in the power and features of the installer.
some of the basic features of the Debian Installer:

during the install process
you create the swap partition size and location, or none if you prefer.
you can also select which pre-existing swap partitions are to Not be mounted. (default is mount and format, undesirable)

you can also label the new partitions when you create them.

when you run a Different OS the fstab of that OS does not point to the new swap partition, it is ignored.
when you later install a Different OS you are at the mercy of that installer and the options it provides... most seem to want to automatically mount All the swaps found in their fstab. that is a pain in the tush.

DI is a bit complicated(detailed) and the terminology may confound you at first.

PS: I use a swap partition out of habit. I am fortunate that few of the machines I install on need to use any swap space, ever.
I have setup several recently and put them in the office environment without swap to no ill effect.

Oh ok so the trick is to have more than one swap partition. makes since. some might argue that it is a wast of space, but if you have the excess go for it.

As for the fstab having all swap-parts being regestered, just remove the ones you don't want from fstab. easy.

BUT! make sure to make a backup of fstab first.
simple as that. Then they wont be mounted at boot.


Gparted will give you the UUID info so you know which one(s) to remove

IMHO swapfile is still easier and faster. Big Grin ...... But there are some cases where a swap-part is needed, or a must, like Richard mentioned. And then there is the fact that we are creatures of habit (Including myself) we use what works for us. Generally we don't want to change, even if the change is vastly better. It is only when our habits stop working for us that we begin to look elsewhere. When I first learned about swapfiles I turned my nose up at it for a year. It wasn't until that swap-part fopar happened that I started looking at swapfile.

So, I am not judging anyone. If swap-part works for you then by all means keep using it.
My goal here Is not to bash (no pun intended) on swap-part users, it is only to broaden peoples horizons, to get opinions from fellow Linux users, and also to showcase my little swapfile scrip. even though it is a very basic and simple script, it is effective.

mexsudo, and Richard, Thank you for your opinions, input, and info. You actually changed my opinion (A little) Wink

kudos

for some unexplained reason the subject of "to swap or not to swap" woke me up several times last night... so I got up early dug into the Debian Wiki: https://wiki.debian.org/Swap

Clearly not definitive but still it is a nice overview, and some reminders: some of my habits are wasteful...
for Me/Us and the systems I mess with I think I will quit using swap entirely (almost):
1. none of the apps we use need more than the onboard RAM of any of the current or anticipated machines, not even close.
2. we never "Suspend" or "Hibernate" ... not a part of our workflow... machines run 24/7 or are fully shutdown.

I do know that many folks have very low resource machines, and they do need to consider swap.

just to test my thoughts I spent an hour or two editing a couple videos and did some major backups/syncs and watching my conky... not once did my swap get used!
My business partner (direct day to day contact with staff using the funkiest hardware) confirms that nobody (those using the machines without swap) are having any lag or stalling issues, even with the Humongous databases.

My best to all, Peter

PS: note that the article ((last modified 2019-09-14 18:52:46)) refers to Debian 6, that would be about a Decade in the past.
The common hardware of that day equates to the lowest end of the machines now being produced
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)