Are swap partitions not needed anymore?

Archived topics about LMDE 1 and LMDE 2
Locked
simplex

Are swap partitions not needed anymore?

Post by simplex »

I just gave LMDE a whole, freshly formatted 160GB hard drive to install on. I wonder that the installer has not created more than one partition. Not even a swap partition. Nevertheless, hibernating to hard drive works out-of-the-box!

How is this achieved? By creating swap files when needed? If so, where are they placed?

If so, what's the use of creating a swap partition nowadays? Other installers let you explicitly create swap partition.

Greetings,
S.
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.
widget

Re: Are swap partitions not needed anymore?

Post by widget »

Please post the output of;

Code: Select all

sudo fdisk -l
That is a lower case L at the end the easiest way to do this is simply copy/paste the command to your terminal.
caf4926
Level 7
Level 7
Posts: 1916
Joined: Mon Mar 22, 2010 3:21 pm
Location: Argyll and Bute

Re: Are swap partitions not needed anymore?

Post by caf4926 »

simplex wrote:the installer has not created more than one partition. Not even a swap partition.
Umm.....really

I'd like to see the fdisk too
Linux Mint 21.1 Cinnamon
simplex

Re: Are swap partitions not needed anymore?

Post by simplex »

Seems that I have made some kind of mistake. I looked at the partitions created with gparted, and it showed me only 1 partition. Here is the output you have asked for:

Code: Select all

ziegler@MeinNC10-Debian ~ $ sudo fdisk -l
[sudo] password for ziegler: 

Platte /dev/sda: 160.0 GByte, 160041885696 Byte
255 Köpfe, 63 Sektoren/Spur, 19457 Zylinder
Einheiten = Zylinder von 16065 × 512 = 8225280 Bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00073eba

   Gerät  boot.     Anfang        Ende     Blöcke   Id  System
/dev/sda1   *           1       19076   153219072   83  Linux
/dev/sda2           19076       19458     3068929    5  Erweiterte
/dev/sda5           19076       19458     3068928   82  Linux Swap / Solaris
So the installer created one extended partition with 1 swap partition inside ("erweitert" = "extended" in German, 3 times the size of my physical memory).

Sorry, that was my mistake. Nevertehless, hibernating did not work yesterday, I do not know why.

Greetings,
S.
caf4926
Level 7
Level 7
Posts: 1916
Joined: Mon Mar 22, 2010 3:21 pm
Location: Argyll and Bute

Re: Are swap partitions not needed anymore?

Post by caf4926 »

I'm confused
In your first post you said hibernating worked
Now you are saying it doesn't

Is it a Box or a Laptop?


What about Sleep (Suspend)?
Linux Mint 21.1 Cinnamon
simplex

Re: Are swap partitions not needed anymore?

Post by simplex »

caf4926 wrote:I'm confused
In your first post you said hibernating worked
Now you are saying it doesn't
Is it a Box or a Laptop?
What about Sleep (Suspend)?
Yes, i am confused, too. :-)

It's a subnotebook, Samsung NC-10. Hibernating worked in the first days. Yesterday, after a lot of hibernations, it did not work anymore. Now that I have rebooted the machine, it works again. I have no explanation for this. The subnotebook has 1 GB of physical memory.

Sleep always works... at least until now.

The mistake I did was looking at the partitions with "df" instead of with "fdisk". I overlooked the various "/dev/sda*". Blame it on me. Sorry for this posting. I am always willing to help...

I think that everything is ok, and all mistakes were mine.

But back to my initial question: Are swap partitions still needed? I heard or read that Ubuntu does create files on-the-fly when swap space is needed.

Greetings from Germany,
S.
widget

Re: Are swap partitions not needed anymore?

Post by widget »

If you are hibernating you are going to need a /swap. Hard to create a file (a swap file) that will be hibernating and expect it to ever wake up.
caf4926
Level 7
Level 7
Posts: 1916
Joined: Mon Mar 22, 2010 3:21 pm
Location: Argyll and Bute

Re: Are swap partitions not needed anymore?

Post by caf4926 »

I never use hibernate. Mine boots from cold as quickly as coming back from H
Only sleep
Linux Mint 21.1 Cinnamon
widget

Re: Are swap partitions not needed anymore?

Post by widget »

caf4926 wrote:I never use hibernate. Mine boots from cold as quickly as coming back from H
Only sleep
Don't you need swap for that too?

I wouldn't know, don't use either.

I run boinc and usually just let the bugger run all the time. If I am rebooting it is usually to go play with my other installs. Have to do that or start messing with the one I use all the time. That can lead to breakage. I mean excessive improvements.

Just broke an install today. Sid netboot install. Got it all set for a DE and told it;

Code: Select all

apt-get -t experimental install xfce4
and like a fool didn't read everything, hit Y and went to do something else. Removed the kernel. Will fix it and wait for the upgrade to 3.5. Already have linux-base 3.5 so it shouldn't be too long and experimental has xfce4.10 that I really want to see.

I don't want to brag too much but I am pretty good at breaking things.
caf4926
Level 7
Level 7
Posts: 1916
Joined: Mon Mar 22, 2010 3:21 pm
Location: Argyll and Bute

Re: Are swap partitions not needed anymore?

Post by caf4926 »

@OP you started asking if swap was needed. The answer is Yes (there are some times you might not). And you thought Mint installed without it, but we see it didn't.

Regarding the options for Hibernate and Suspend(Sleep):

I personally don't recommend using Hibernate for the following reasons. It has little if any advantage over a cold boot. If the user also has windows installed, it can prove very problematic if you have hibernated in one system, (forget) and when you resume, allow it to boot the other...

Suspend or Sleep does use some power though, so it's a matter of deciding how that fits your lifestyle/needs.

I can't tell the extent to which each uses swap.

But the swap use in my system (Laptop) increases over time, because I don't reboot very often, maybe once every week or 2. But this is normal, as the system will also be seemingly using most of your RAM (although in reality it's not)
Linux Mint 21.1 Cinnamon
simplex

Re: Are swap partitions not needed anymore?

Post by simplex »

caf4926 wrote: I personally don't recommend using Hibernate for the following reasons. It has little if any advantage over a cold boot. If the user also has windows installed, it can prove very problematic if you have hibernated in one system, (forget) and when you resume, allow it to boot the other...

Suspend or Sleep does use some power though, so it's a matter of deciding how that fits your lifestyle/needs.
- I earn my money with IT (programming, giving courses...). It is very important for me that I start the next day exactly where I left the day before.
- My lifestyle includes the pragma that we should save as much energy as possible around the globe, so I do not want to sleep in winter, I want to hibernate. Latin "hibernare" = "to survive the winter" ;-) It's a deeper sleep, with pulse going down to zero beats per minute.

Thank you very much for all your comments. I am interested in improving your "product", just because it gives me something, and I want to give something back.

S.
Locked

Return to “LMDE Archive”