Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Does 11.2 need the swap partition

New to Debian (Or Linux in general)? Ask your questions here!
Post Reply
Message
Author
Waldo Jeffers
Posts: 52
Joined: 2021-12-30 19:38
Has thanked: 1 time
Been thanked: 2 times

Does 11.2 need the swap partition

#1 Post 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?
Waldo Jeffers has reached his limits.

zwab
Posts: 27
Joined: 2021-08-27 15:41
Been thanked: 3 times

Re: Does 11.2 need the swap partition

#2 Post 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).

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: Does 11.2 need the swap partition

#3 Post 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.

Waldo Jeffers
Posts: 52
Joined: 2021-12-30 19:38
Has thanked: 1 time
Been thanked: 2 times

Re: Does 11.2 need the swap partition

#4 Post 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?
Waldo Jeffers has reached his limits.

Victor Brand
Posts: 26
Joined: 2021-09-10 16:35
Location: St. Petersburg, Russia
Been thanked: 4 times

Re: Does 11.2 need the swap partition

#5 Post 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.

CwF
Global Moderator
Global Moderator
Posts: 2636
Joined: 2018-06-20 15:16
Location: Colorado
Has thanked: 41 times
Been thanked: 192 times

Re: Does 11.2 need the swap partition

#6 Post by CwF »


p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: Does 11.2 need the swap partition

#7 Post 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.

Waldo Jeffers
Posts: 52
Joined: 2021-12-30 19:38
Has thanked: 1 time
Been thanked: 2 times

Re: Does 11.2 need the swap partition

#8 Post 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.
Waldo Jeffers has reached his limits.

arzgi
Posts: 1185
Joined: 2008-02-21 17:03
Location: Finland
Been thanked: 31 times

Re: Does 11.2 need the swap partition

#9 Post 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.

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: Does 11.2 need the swap partition

#10 Post by p.H »

You can get past the advice and install without a swap.

Waldo Jeffers
Posts: 52
Joined: 2021-12-30 19:38
Has thanked: 1 time
Been thanked: 2 times

Re: Does 11.2 need the swap partition

#11 Post by Waldo Jeffers »

Like i've said in #4 you can. But manually. So you must know what you are doing.
Waldo Jeffers has reached his limits.

User avatar
NFT5
df -h | grep > 20TiB
df -h | grep > 20TiB
Posts: 597
Joined: 2014-10-10 11:38
Location: Canberra, Australia
Has thanked: 10 times
Been thanked: 43 times

Re: Does 11.2 need the swap partition

#12 Post 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.

User avatar
Hallvor
Global Moderator
Global Moderator
Posts: 2029
Joined: 2009-04-16 18:35
Location: Kristiansand, Norway
Has thanked: 139 times
Been thanked: 206 times

Re: Does 11.2 need the swap partition

#13 Post 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.
[HowTo] Install and configure Debian bookworm
Debian 12 | KDE Plasma | ThinkPad T440s | 4 × Intel® Core™ i7-4600U CPU @ 2.10GHz | 12 GiB RAM | Mesa Intel® HD Graphics 4400 | 1 TB SSD

Post Reply