Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

How To Activate Swap File?


  • Please log in to reply
14 replies to this topic

#1 pcpunk

pcpunk

  • Members
  • 5,739 posts
  • ONLINE
  •  
  • Gender:Male
  • Location:Florida
  • Local time:09:09 PM

Posted 22 October 2015 - 04:45 PM

I noticed about a week ago that my swap was not active, at least I think it is not.  I tried to get it working on my own to no avail.  

 

1. I was thinking I could just do this in gparted but won't try that until I get some advice.

 

Here is the reason I first seen that there was an issue in the bottom right of System Monitor:

 

j0xkXgw.png

 

Here are some outputs I hope will help:

 

cat /proc/meminfo
Outcome only for swap:
SwapTotal:             0 kB
SwapFree:              0 kB
 
cat /proc/swaps
Filename                                Type            Size    Used    Priority
 
Command output of “free”:
             total       used       free     shared    buffers     cached
Mem:       3460864    3062088     398776     299928     112788    1452400
-/+ buffers/cache:    1496900    1963964
Swap:            0          0          0
 
And, just the output of swap here:
# /etc/fstab: static file system information.
# swap was on /dev/sda6 during installation
UUID=fcbff0dc-b350-4cdf-8d63-87d9866bdf17 none            swap    sw              0       0
 
 

sBCcBvM.png

Created by Mike_Walsh

 

KDE, Ruler of all Distro's

eps2.4_m4ster-s1ave.aes_pcpunk_leavemehere

 


BC AdBot (Login to Remove)

 


#2 DeimosChaos

DeimosChaos

  • BC Advisor
  • 1,420 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:United States, Delaware
  • Local time:09:09 PM

Posted 22 October 2015 - 04:54 PM

It just seems like you don't have any HDD space allocated for swap space at all. Did you allocate any on install? As you mentioned, I think you can make swap space via gparted, so you can always give that a go.


Edited by DeimosChaos, 22 October 2015 - 04:54 PM.

OS - Ubuntu 14.04/16.04 & Windows 10
Custom Desktop PC / Lenovo Y580 / Sager NP8258 / Dell XPS 13 (9350)
_____________________________________________________
Bachelor of Science in Computing Security from Drexel University
Security +


#3 mremski

mremski

  • Members
  • 493 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:NH
  • Local time:09:09 PM

Posted 23 October 2015 - 05:56 AM

Of course given the amount of RAM in machines now, one can make an argument that "swap is not needed".  :)  (look at the free column in your Mem line)

One reason to have swap is kernel crash dumps can be configured to use swap for the output  (so I like to configure swap on systems).

If you have free space, a partion that is not used it should be trivial to enable swap (man -k swap or man swapon). 


FreeBSD since 3.3, only time I touch Windows is to fix my wife's computer


#4 Al1000

Al1000

  • Global Moderator
  • 7,595 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Scotland
  • Local time:02:09 AM

Posted 23 October 2015 - 07:12 AM

It just seems like you don't have any HDD space allocated for swap space at all.


Yet strangely, his /etc/fstab file says there is (or at least was) a swap partition.

PC, check the output of
sudo blkid
and see if it says /dev/sda6 is a swap partition, and that its UUID corresponds to the UUID for /dev/sda6 in /etc/fstab. If the UUID is different, edit the UUID in /etc/fstab so that it's the same as the UUID for /dev/sda6 in the output of sudo blkid. Then reboot your computer to see if swap switches on, assuming that /dev/sda6 is still a swap partition.

To switch it on manually, again assuming /dev/sda6 is a swap partition:
sudo swapon /dev/sda6

(look at the free column in your Mem line)


It's showing only approximately 10% of RAM remaining free; 398776 free out of a total of 3460864. The columns being out of line with their headings makes this easy to misread.

#5 mremski

mremski

  • Members
  • 493 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:NH
  • Local time:09:09 PM

Posted 23 October 2015 - 07:15 AM

Missed the alignment.  Thanks.


FreeBSD since 3.3, only time I touch Windows is to fix my wife's computer


#6 DeimosChaos

DeimosChaos

  • BC Advisor
  • 1,420 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:United States, Delaware
  • Local time:09:09 PM

Posted 23 October 2015 - 09:13 AM

 

It just seems like you don't have any HDD space allocated for swap space at all.


Yet strangely, his /etc/fstab file says there is (or at least was) a swap partition.


 

Very strange indeed. Maybe it got created but 0 got allocated to it?


OS - Ubuntu 14.04/16.04 & Windows 10
Custom Desktop PC / Lenovo Y580 / Sager NP8258 / Dell XPS 13 (9350)
_____________________________________________________
Bachelor of Science in Computing Security from Drexel University
Security +


#7 Al1000

Al1000

  • Global Moderator
  • 7,595 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Scotland
  • Local time:02:09 AM

Posted 23 October 2015 - 09:24 AM

Very strange indeed. Maybe it got created but 0 got allocated to it?


That did occur to me, although I couldn't think of a reason why that might have happened.

PC, if blkid shows that there is a swap partition, it might be worth checking its size using
sudo fdisk -l


#8 pcpunk

pcpunk
  • Topic Starter

  • Members
  • 5,739 posts
  • ONLINE
  •  
  • Gender:Male
  • Location:Florida
  • Local time:09:09 PM

Posted 23 October 2015 - 11:52 AM

Will do, in Windows now.   I did create swap, 6GB and was thinking about reducing to 2GB.  Although, I was reading cat1092's thread about VMware Player.  I did not understand nor finish it, but he seemed to be having an Error about not enough swap, is that possible, do VM's want more swap?


sBCcBvM.png

Created by Mike_Walsh

 

KDE, Ruler of all Distro's

eps2.4_m4ster-s1ave.aes_pcpunk_leavemehere

 


#9 pcpunk

pcpunk
  • Topic Starter

  • Members
  • 5,739 posts
  • ONLINE
  •  
  • Gender:Male
  • Location:Florida
  • Local time:09:09 PM

Posted 23 October 2015 - 01:25 PM

chris@chris-HP-Compaq-nx7400-EN352UTR-ABA:~ > sudo blkid
[sudo] password for chris: 
/dev/sda1: UUID="c0812b3e-bed6-4cf9-a6e7-cf2c5f77eed6" TYPE="ext4" 
/dev/sda5: UUID="1746dc84-71f9-4a53-991d-7ef9746c81d4" TYPE="ext4" 
/dev/sda6: UUID="abc99d2a-b790-4a45-a730-aa7a049dca5b" TYPE="swap"                                                                           UUID=fcbff0dc-b350-4cdf-8d63-87d9866bdf17
This above is from the earlier post of mine - the output of swap, so they are different.

Edited by pcpunk, 23 October 2015 - 07:59 PM.

sBCcBvM.png

Created by Mike_Walsh

 

KDE, Ruler of all Distro's

eps2.4_m4ster-s1ave.aes_pcpunk_leavemehere

 


#10 pcpunk

pcpunk
  • Topic Starter

  • Members
  • 5,739 posts
  • ONLINE
  •  
  • Gender:Male
  • Location:Florida
  • Local time:09:09 PM

Posted 23 October 2015 - 01:57 PM

All fixed guys, using Al's suggestion changing UUID.

 

This was interesting to me, is it possible that swap was active therefore was not able to allocate to it: "swap was on"

# swap was on /dev/sda6 during installation
 
chris@chris-HP-Compaq-nx7400-EN352UTR-ABA:~ > sudo fdisk -l
[sudo] password for chris: 
 
Disk /dev/sda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders, total 156301488 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00056942
 
   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048    35999743    17998848   83  Linux
/dev/sda2        36001665   156296384    60147360    5  Extended
/dev/sda5        36017793   143733554    53857881   83  Linux
/dev/sda6       143733618   156296384     6281383+  82  Linux swap / Solaris
Six GB of swap! good to go.

Edited by pcpunk, 23 October 2015 - 08:07 PM.

sBCcBvM.png

Created by Mike_Walsh

 

KDE, Ruler of all Distro's

eps2.4_m4ster-s1ave.aes_pcpunk_leavemehere

 


#11 mremski

mremski

  • Members
  • 493 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:NH
  • Local time:09:09 PM

Posted 23 October 2015 - 05:15 PM

The UUID of /dev/sda6 is different between your original post of fstab and the output of blkid (hard to compared scrolling back and forth)?  It's likely that it changed between the install and "after install was done". 


FreeBSD since 3.3, only time I touch Windows is to fix my wife's computer


#12 pcpunk

pcpunk
  • Topic Starter

  • Members
  • 5,739 posts
  • ONLINE
  •  
  • Gender:Male
  • Location:Florida
  • Local time:09:09 PM

Posted 23 October 2015 - 08:01 PM

Sorry mremski, I posted them one above the other in post #9 but did not highlight it well.  I went back and Bolded it.


sBCcBvM.png

Created by Mike_Walsh

 

KDE, Ruler of all Distro's

eps2.4_m4ster-s1ave.aes_pcpunk_leavemehere

 


#13 pcpunk

pcpunk
  • Topic Starter

  • Members
  • 5,739 posts
  • ONLINE
  •  
  • Gender:Male
  • Location:Florida
  • Local time:09:09 PM

Posted 23 October 2015 - 08:07 PM

I'm having fits with Kate, was wanting to just use one text editor, and learn it.  I was having a terrible time trying to use Kate as sudo, looked everywhere on the net with all kinds of crazy commands etc.  Then I tried opening it from terminal and it worked!  I also learned that if you navigate to a file - it can be opened as root via Right Click but is not that useful.  I like Kate and was using it in Split window yesterday, awesome! one file on top of the other.


sBCcBvM.png

Created by Mike_Walsh

 

KDE, Ruler of all Distro's

eps2.4_m4ster-s1ave.aes_pcpunk_leavemehere

 


#14 mremski

mremski

  • Members
  • 493 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:NH
  • Local time:09:09 PM

Posted 24 October 2015 - 02:00 AM

Thanks for highlighting.  That's one issue with doing things by UUID:  if it changes, things don't work.  But it does give you the flexibility to add devices without worrying about "did I move sda to sdb?".

 

Editors and split windows:  people that write software use this all the time;  makes it easy to refer back to stuff.  See if Kate can split the window vertically:  gives you side by side instead of top & bottom.  This is handy when you are comparing 2 files (human brain does left right easier than up down).


FreeBSD since 3.3, only time I touch Windows is to fix my wife's computer


#15 pcpunk

pcpunk
  • Topic Starter

  • Members
  • 5,739 posts
  • ONLINE
  •  
  • Gender:Male
  • Location:Florida
  • Local time:09:09 PM

Posted 24 October 2015 - 10:39 AM

I actually wanted the over under to utilize the screen better, I realize that there is both thanks!

 

I think I miss spoke with Kate though, I don't think it is easy to run as Superuser.  I did it while working with .conkyrc but that seems to have different permissions?


sBCcBvM.png

Created by Mike_Walsh

 

KDE, Ruler of all Distro's

eps2.4_m4ster-s1ave.aes_pcpunk_leavemehere

 





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users