How to properly delete swap?

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
Post Reply
renzor
Level 1
Level 1
Posts: 48
Joined: Thu Jul 30, 2015 3:22 pm

How to properly delete swap?

Post by renzor »

I want to remove my swap I created during initial installation but I'd like to know what's the proper method to do it so it won't effect my current setup. Anyone?
Cosmo.
Level 23
Level 23
Posts: 17817
Joined: Sat Dec 06, 2014 7:34 am

Re: How to properly delete swap?

Post by Cosmo. »

First question is, if this is a good idea at all. Open a terminal, press F11 and enter

Code: Select all

inxi -Fxz
than paste the output here.

The other question is what you can do with the space you make free. A screenshot of the drive with Gparted would help to see this. You can either install gparted in your system or launch the live system, where it is pre-installed.
renzor
Level 1
Level 1
Posts: 48
Joined: Thu Jul 30, 2015 3:22 pm

Re: How to properly delete swap?

Post by renzor »

thank you
Last edited by renzor on Sun Sep 20, 2015 4:21 am, edited 1 time in total.
Cosmo.
Level 23
Level 23
Posts: 17817
Joined: Sat Dec 06, 2014 7:34 am

Re: How to properly delete swap?

Post by Cosmo. »

You only answered my questions partly, so we do not know, how big your swap is and where it is located.

I would even with this amount of RAM not remove swap entirely, but reduce it to e.g. 1 GB. If there is no swp at all and you should at any time come into the situation where the system needs to swap, but cannot, your session would irrecoverably stall.

For doing this launch your live system. Open gparted, right click the swap partition and choose unswap. Then you can reduce the size (also with gparted).
renzor
Level 1
Level 1
Posts: 48
Joined: Thu Jul 30, 2015 3:22 pm

Re: How to properly delete swap?

Post by renzor »

Cosmo. wrote:You only answered my questions partly, so we do not know, how big your swap is and where it is located.

I would even with this amount of RAM not remove swap entirely, but reduce it to e.g. 1 GB. If there is no swp at all and you should at any time come into the situation where the system needs to swap, but cannot, your session would irrecoverably stall.

For doing this launch your live system. Open gparted, right click the swap partition and choose unswap. Then you can reduce the size (also with gparted).
Currently away from comp, but swap is 4gb wouldn't mind reducing to 1gb...actual location is /dev/sdb7 from memory. Also, do you mean swapoff? If it is, already did this a little while back. How would I be able to reallocate space (let's say 3gb, so 1gb swap) to /home?
BlackVeils
Level 5
Level 5
Posts: 589
Joined: Wed Nov 06, 2013 9:26 am

Re: How to properly delete swap?

Post by BlackVeils »

yes they meant swap-off. you may not be able to use the extra space for /home or the system partition. we would need to see the disk layout. so either take a screenshot of gparted, to show us, or paste the output from this command run in the terminal program:

Code: Select all

sudo parted -l
thats a lower case L at the end.
renzor
Level 1
Level 1
Posts: 48
Joined: Thu Jul 30, 2015 3:22 pm

Re: How to properly delete swap?

Post by renzor »

BlackVeils wrote:yes they meant swap-off. you may not be able to use the extra space for /home or the system partition. we would need to see the disk layout. so either take a screenshot of gparted, to show us, or paste the output from this command run in the terminal program:

Code: Select all

sudo parted -l
thats a lower case L at the end.
thank you
Last edited by renzor on Sun Sep 20, 2015 4:21 am, edited 1 time in total.
Cosmo.
Level 23
Level 23
Posts: 17817
Joined: Sat Dec 06, 2014 7:34 am

Re: How to properly delete swap?

Post by Cosmo. »

Yes, I wrote "unswap" out of my remembrance and you understood it yourself right; BlackVeils confirmed this already.

The drive layout looks good. If you reduce the size of sdb7, make sure, that you drag in the graphical settings on the left side. This allows you to enhance the size of sdb6 = /home in the next step and have the additional 3 GB there.

Enhancing the size of a partition is in general a rather save operation. But it is an operation, which in worst case also go wrong. So I strongly recommend to make a backup of your home on an external drive.
Post Reply

Return to “Newbie Questions”