Page 1 of 1

Does 11.2 need the swap partition

Posted: 2022-01-17 17:31
by Waldo Jeffers
We don't want the swap partition. Can you delete it while on live boot? Or is there anything depending on that?

Re: Does 11.2 need the swap partition

Posted: 2022-01-17 20:09
by zwab

Code: Select all

swapoff - a
Edit /etc/fstab and remove the UUID of the swap partition.
Edit /etc/initramfs-tools/conf.d/resume and remove the UUID of the swap partition.
If you had encrypted swap edit /etc/crypttab and remove the UUID of the swap partition.

Code: Select all

update-initramfs -u

Code: Select all

update-grub
You won't be able to hibernate, and if you run out of RAM you'll have a kernel panic. But if you have enough ram it isn't really an issue (in my opinion).

Re: Does 11.2 need the swap partition

Posted: 2022-01-17 22:47
by p.H
Waldo Jeffers wrote: 2022-01-17 17:31 We don't want the swap partition. Can you delete it while on live boot?
Why just not create a swap partition during installation ?
You do not need a live boot to remove it.
zwab wrote: 2022-01-17 20:09 If you had encrypted swap edit /etc/crypttab and remove the UUID of the swap partition.
And stop the encrypted device before deleting the partition.

Code: Select all

cryptsetup close <partition>_crypt
No need to run update-grub.

Re: Does 11.2 need the swap partition

Posted: 2022-01-23 19:16
by Waldo Jeffers
You won't be able to hibernate,
O... have to think about it again...

Why just not create a swap partition during installation ?
There is no standard possibility for that. Have no clue how to set up partitions myself. Like 500mb for grub? Isn't it more common to use just 30mb?

Re: Does 11.2 need the swap partition

Posted: 2022-01-23 21:23
by Victor Brand
It's overall better to have a swap partition even if you have plenty of RAM and don't plan to use hibernation. Linux extensively uses RAM not only for storing programs and their data, but also for various caches and sometimes swap may be useful for that. Swap size is not so important, 1 or 2 GB will be enough for most cases. Of course, if you want to hibernate, you must make swap at least as big as your RAM.

You can also use a swap file, but I prefer to have a dedicated partition for that.

Re: Does 11.2 need the swap partition

Posted: 2022-01-23 22:17
by CwF

Re: Does 11.2 need the swap partition

Posted: 2022-01-23 22:52
by p.H
Waldo Jeffers wrote: 2022-01-23 19:16 Why just not create a swap partition during installation ?
There is no standard possibility for that.
Of course yes. Manual partitioning.
Victor Brand wrote: 2022-01-23 21:23 Linux extensively uses RAM not only for storing programs and their data, but also for various caches and sometimes swap may be useful for that.
Useful for what ? The swap stores only program data and ramfs/tmpfs, not any cached data. Swap is useful only if you do not have "enough" memory.
Victor Brand wrote: 2022-01-23 21:23 if you want to hibernate, you must make swap at least as big as your RAM.
No, it depends on your memory usage. The hibernation image does not need to store cached data.
Victor Brand wrote: 2022-01-23 21:23 You can also use a swap file, but I prefer to have a dedicated partition for that.
Swap files are a dirty hack.

Re: Does 11.2 need the swap partition

Posted: 2022-01-23 23:52
by Waldo Jeffers
ON a mint system we've been checking the swap file on a regular basis via system monitor. It hardly ever was used in our situation. So it is pretty useless and waste of didk space.

Re: Does 11.2 need the swap partition

Posted: 2022-01-24 11:28
by arzgi
I just installed Debian 11 to a new computer. I did not remember to create a swap partition, but the installer adviced to do so. Did not test, if I could get past it without. I used expert mode installation.

Re: Does 11.2 need the swap partition

Posted: 2022-01-24 12:14
by p.H
You can get past the advice and install without a swap.

Re: Does 11.2 need the swap partition

Posted: 2022-01-24 22:39
by Waldo Jeffers
Like i've said in #4 you can. But manually. So you must know what you are doing.

Re: Does 11.2 need the swap partition

Posted: 2022-01-25 00:23
by NFT5
Gparted. Makes setting up disks and partitions a breeze, especially if you're new to Linux and not yet familiar with the command line.

Personally I believe in Swap partitions. Linux does use swap sometimes, even if you have a lot of RAM. I have 32GB on the main desktop and on my server and I've seen swap used quite regularly. I set swap at 32.5GB which, in these days of even 1TB drives, is a drop in the ocean. Desktops are not set to hibernate but on notebooks I think it's a must and mine run 8GB RAM, so 8.5GB swap. On the smaller one, with just a 500GB HDD, it is still a very small amount of the total storage available.

Re: Does 11.2 need the swap partition

Posted: 2022-01-25 16:57
by Hallvor
A little anecdote: I ran Debian on my Raspberry Pi 1 with a mere 256 MB of RAM - without swap. For some reason a swap partition wasn't made during the install. I suppose PEBKAC. Anyway, I had no idea that it was lacking, and everything seemed to be working fine for a few days. Then I noticed that Transmission-cli has stopped running. After investigating, I found that the kernel shut down Transmission as RAM was about to run out. No kernel panic, just well designed.

Needless to say, after installing a swap partition, it has been rock solid.

A GNU/Linux system with enough RAM can work fine without it. However, if RAM is starting to fill up, the computer can move "less important" items to swap, while you have plenty of room for the most important items in RAM. A large swap partition also allows you to hibernate your computer.

GNU/Linux isn't a bad design; most GNU/Linux systems have swap because it's an advantage. Besides, disk space is cheap.