You are not logged in.

#1 2025-09-17 12:37:38

rupeshforu3
Member
Registered: 2023-01-06
Posts: 122

Allocation of swap memory to separate partition.

Hi I Rupesh from India and I have brought a new system with AMD Ryzen zen3 5500GT and Asus prime b450 motherboard. I have installed and using Linux from the past three years.

Actually I have installed linux on 56 GB partition with xfs file system. My system has 16 GB main memory and so I have created a separate swap partition of size 3 GB.

At present when I issue the command "top" it is showing that 8 GB swap is being used.

At some time I have seen that /swap.img file is being used for swap.

As my root partition is of size 56 GB 20 percent of the disk space is being used for swap. If I run kernel compilation or other tasks the swap usage is being increased.

My requirement is I want to create a new swap partition upto 16 GB and not use any disk space from root partition that is /.

Sometimes I compile software and those times I think more swap is going to be used.

How much space is necessary for swap partition can I use 8 GB for it.

Kindly try to suggest how to disable swap from root partition and use separate swap partition instead.


Regards,
Rupesh.

Offline

#2 2025-09-17 12:57:14

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,084

Re: Allocation of swap memory to separate partition.

How did you install this OS?

Offline

#3 2025-09-17 13:08:41

rupeshforu3
Member
Registered: 2023-01-06
Posts: 122

Re: Allocation of swap memory to separate partition.

Through Arch Linux iso image and arch-install script.

Last edited by rupeshforu3 (2025-09-17 13:11:28)

Offline

#4 2025-09-17 13:25:22

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,084

Re: Allocation of swap memory to separate partition.

See, Arch doesn't do anything like that by default unless you configure it that way. That's why I asked. You used a script to take a shortcut to set up the system, and it configured things you didn't know about or want. There's a separate subforum for that script.

I can guess that it follows https://wiki.archlinux.org/title/Swap#Swap_file, but I don't know that for sure.

Last edited by Scimmia (2025-09-17 13:41:04)

Offline

#5 2025-09-17 13:42:18

rupeshforu3
Member
Registered: 2023-01-06
Posts: 122

Re: Allocation of swap memory to separate partition.

I have seen the word zram of size 8 GB in the output of top command.

Just now I have searched web for zram and it is compression technique used by kernel.

How to know if any swap file from root partition is being used or not.

How much size is sufficient for swap partition 8 GB enough or not.

Offline

#6 2025-09-17 14:46:43

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 69,096

Re: Allocation of swap memory to separate partition.

Scimmia linked you the arch wiki article on swap space, you might want to read it.

Eg. https://wiki.archlinux.org/title/Swap#Swap_space tells you how to figure which and what swap and how much of it is being used.
Since you've no idea what kind of swap is actually configured and all we can tell is that you're not using 8GB swap if there're only 3GB available, you'll better share that information as well as the status of https://wiki.archlinux.org/title/Zswap and https://wiki.archlinux.org/title/Zram#Using_zramswap

Offline

#7 2025-09-17 14:47:15

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 8,999
Website

Re: Allocation of swap memory to separate partition.

Please also share the archinstall log. Thanks.


Jin, Jîyan, Azadî

Offline

#8 2025-09-17 15:35:07

rupeshforu3
Member
Registered: 2023-01-06
Posts: 122

Re: Allocation of swap memory to separate partition.

I have issued the following command

cat /proc/swaps

I got output with zram

So there are no issues.

Last edited by rupeshforu3 (2025-09-17 15:36:03)

Offline

#9 2025-09-17 18:25:36

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 69,096

Re: Allocation of swap memory to separate partition.

So there are no issues.

Please always remember to mark resolved threads by editing your initial posts subject - so others will know that there's no task left, but maybe a solution to find.
Thanks.

Offline

Board footer

Powered by FluxBB