Page 1 of 2

Removing SWAP <SOLVED>

Posted: Sat Sep 02, 2017 9:21 pm
by mrmajik45
How do i remove my SWAP partition because I have 4 GB of RAM and my swap just wastes 3.91 GB of disk space :?
Don't know if this helps but my CPU is: Intel Celeron CPU N3060 @ 1.60GHZ x 2 Cores

Re: Removing SWAP

Posted: Sat Sep 02, 2017 9:28 pm
by WharfRat
Are you sure it's never used :?:


I had a 4GB RAM desktop and according to the conky monitor it was being utilized occasionally.

Re: Removing SWAP

Posted: Sat Sep 02, 2017 9:29 pm
by mrmajik45
WharfRat wrote:Are you sure it's never used :?:


I had a 4GB RAM desktop and according to the conky monitor it was being utilized occasionally.
Gparted says used: 0.00 B

Re: Removing SWAP

Posted: Sat Sep 02, 2017 9:30 pm
by rene
Run sudo swapoff -a, comment or delete the line regarding your swap partition in /etc/fstab and then just delete the partition 5 (and 2; there's nu use for an extended partition without any logicals).

Quite sure though? 4G is not a lot for current day usage. I'd definitely keep at least 1G of swap for some overflow capacity. Note that the "0.00" figure from gparted doesn't mean anything: you want to check what the command free has to say about things when running for some time. Also, that you need swap if you wish to hibernate...

Re: Removing SWAP

Posted: Sat Sep 02, 2017 9:31 pm
by WharfRat
Well if you must then sudo swapoff -a, remove the swap line in /etc/fstab and delete the partition with gparted.

Re: Removing SWAP

Posted: Sat Sep 02, 2017 9:34 pm
by mrmajik45
rene wrote:Run sudo swapoff -a, comment or delete the line regarding your swap partition in /etc/fstab and then just delete the partition 5 (and 2; there's nu use for an extended partition without any logicals).

Quite sure though? 4G is not a lot for current day usage. I'd definitely keep at least 1G of swap for some overflow capacity. Note that the "0.00" figure from gparted doesn't mean anything: you want to check what the command free has to say about things when running for some time. Also, that you need swap if you wish to hibernate...
First i don't understand Run sudo swapoff -a, comment or delete the line regarding your swap partition in /etc/fstab and then just delete the partition 5 (and 2; there's nu use for an extended partition without any logicals).

Second heres what free says:
ghostslayer989@mrmajik45 ~ $ free
total used free shared buff/cache available
Mem: 3956004 1066048 315620 155676 2574336 2400468
Swap: 4104188 0 4104188

Re: Removing SWAP

Posted: Sat Sep 02, 2017 9:36 pm
by mrmajik45
Now im a bit worried because someone said that 4 GB isn't much so how do i lower Swap to 1GB

Re: Removing SWAP

Posted: Sat Sep 02, 2017 9:39 pm
by Schultz
mrmajik45 wrote:
Now im a bit worried because someone said that 4 GB isn't much
That's all I have and I don't even have a swap partition. Then again, I don't do anything that consumes a lot of memory.

Re: Removing SWAP

Posted: Sat Sep 02, 2017 9:41 pm
by mrmajik45
Well all i play is GARRYS MOD Steam and use chrome

Re: Removing SWAP

Posted: Sat Sep 02, 2017 9:42 pm
by rene
(note; WharfRat and I were posting concurrently)

The free result is saying that currently no swap is being used. But start a few firefox and libreoffice sessions and that may change. As to you "not understanding" that first bit: it's fairly straightforward advise so this would mean you're quite new. I'd in that case for now keep the swap partition around until you know you don't want it.

Seeing your next post upon hitting "submit" on the above: why is it so important for you to lower it? Just leave it be for now I'd say: combining your apparent nature and Linux's nature, you'll be reinstalling quite a few times over the coming year anyway...

But basically, you'd first remove the old one as per above, create a new one, format it, enable it and reenter it into /etc/fstab. That's only a sketch though. I'm sort of reluctant to provide step-by-step on a case where it's not clear that you should be doing anything.

Re: Removing SWAP

Posted: Sat Sep 02, 2017 9:45 pm
by MintBean
I would advise you to keep it. That one day where you end up doing something a bit heavier than usual, do you want your system to slow down a bit as it starts paging swap or would you rather it just went tilt and crashed, possibly losing your work? 4GB of disc seems a small price to pay, plus it allows you to suspend the system.

Re: Removing SWAP

Posted: Sat Sep 02, 2017 9:49 pm
by mrmajik45
If it allowed me to suspend the system you could've told me EDIT: gonna keep swap = SOLVED

Re: Removing SWAP

Posted: Sat Sep 02, 2017 9:50 pm
by rene
You can suspend without swap. As said above, you do need it for hibernation.

Re: Removing SWAP

Posted: Sat Sep 02, 2017 9:50 pm
by WharfRat
mrmajik45,

Before you delete the partition why not just turn it off and comment the /etc/fstab line so it won't restart at boot and test it for a week or two.

You have plenty of space in your / partition so you can't be in dire need of disk space at this time unless you have something planned that we don't know about :?

Re: Removing SWAP

Posted: Sat Sep 02, 2017 9:51 pm
by mrmajik45
rene wrote:You can suspend without swap. As said above, you do need it for hibernation.
Yeah I Meant that :wink:

Re: Removing SWAP

Posted: Sat Sep 02, 2017 9:52 pm
by mrmajik45
WharfRat wrote:mrmajik45,

Before you delete the partition why not just turn it off and comment the /etc/fstab line so it won't restart at boot and test it for a week or two.

You have plenty of space in your / partition so you can't be in dire need of disk space at this time unless you have something planned that we don't know about :?
As i said it's solved

Re: Removing SWAP <SOLVED>

Posted: Sat Sep 02, 2017 9:52 pm
by mrmajik45
Also when do I rank up?

Re: Removing SWAP <SOLVED>

Posted: Sat Sep 02, 2017 9:54 pm
by rene
At your current rate of posting, tomorrow.

Re: Removing SWAP <SOLVED>

Posted: Sat Sep 02, 2017 9:59 pm
by mrmajik45
rene wrote:At your current rate of posting, tomorrow.
Well 8)

Re: Removing SWAP <SOLVED>

Posted: Sat Sep 02, 2017 10:22 pm
by MintBean
My bad, meant hibernate. Thumbs up for Garry's mod... it's a hoot.