0

I use ubuntu 16.04 LTS and have 2 GB RAM and 320 GB hard disk space in which the allocated space for OS usage is 100 GB and swap space and other for partitions. recently after updates while doing multitasking my screen freezes and I have to manually reboot my system from the start. any suggestions?

terminal output:

$ free -h
               total        used       free      shared  buff/cache   available
Mem:           1.8G        977M        157M        201M        746M        467M
Swap:            0B          0B          0B

swapon

$ swapon

df:

$ df
Filesystem     1K-blocks     Used Available Use% Mounted on
udev              942524        0    942524   0% /dev
tmpfs             192584     6120    186464   4% /run
/dev/sda6      103936232 10980932  87652568  12% /
tmpfs             962904    18980    943924   2% /dev/shm
tmpfs               5120        4      5116   1% /run/lock
tmpfs             962904        0    962904   0% /sys/fs/cgroup
cgmfs                100        0       100   0% /run/cgmanager/fs
tmpfs             192584       56    192528   1% /run/user/1000

Screenshot of gparted

blkid:

:~$ sudo blkid
/dev/sda1: UUID="7C7E5116262411BD" TYPE="ntfs" PARTUUID="01468a4c-01"
/dev/sda5: UUID="eed0dfa4-6e24-47fe-84bc-c598b144b116" TYPE="swap" 
PARTUUID="01468a4c-05"
/dev/sda6: UUID="14a87b2f-9da8-487c-a6f5-03ddcea8bb25" TYPE="ext4" 
PARTUUID="01468a4c-06"

cat /etc/fstab:

~$ cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name 
devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sda6 during installation
UUID=14a87b2f-9da8-487c-a6f5-03ddcea8bb25 /               ext4    
errors=remount-ro 0       1
# swap was on /dev/sda5 during installation
UUID=4acee253-61f3-4f36-857e-9cb045346e7b none            swap    sw              
0       0

after doing the mentioned step 2

step 2:

$ swapon -a
$ swapon
NAME      TYPE      SIZE  USED PRIO
/dev/sda5 partition   2G 67.6M   -1
~$ free -h
     total        used        free      shared  buff/cache   available
Mem: 1.8G        1.1G        297M        159M        468M      367M
Swap:1.9G         67M        1.9G
PAM
  • 15
  • Edit (copy/paste) your question to include the terminal output of free -h and swapon and df and I'll take a look. Start comments directed to me with @heynnema or I may miss them. – heynnema Jun 20 '17 at 18:30
  • @heynnema I have edited the question with the outputs u asked me to include, for swapon there is no output. – PAM Jun 21 '17 at 11:21
  • You have very little RAM, and no swap. Please show me a screenshot of gparted, and from the terminal show me sudo blkid and cat /etc/fstab, and I can figure out what to do for you. I've started a partial answer for this problem. – heynnema Jun 21 '17 at 13:34

1 Answers1

1

The problem is that you have very little RAM, and no swap available. So when you load up more than one application at a time, you run out of RAM.

We're going to have to make a swapfile or swap partition to solve the problem.

Step #1: (review the configuration)

  • lets review a screenshot of gparted, sudo blkid, cat /etc/fstab

Step #2: (quick fix)

  • open the terminal from the Unity dashboard
  • type gksudo gedit /etc/fstab

change this line:

UUID=4acee253-61f3-4f36-857e-9cb045346e7b  none  swap  sw   0   0

to this:

UUID=eed0dfa4-6e24-47fe-84bc-c598b144b116  none  swap  sw   0   0
  • save the file and quit gedit
  • type swapon -a
  • type swapon

Observe this:

NAME      TYPE      SIZE USED PRIO
/dev/sda5 partition 1.9G   0K   -1
  • type free -h

Observe this:

               total        used       free      shared  buff/cache   available
Mem:           1.8G        977M        157M        201M        746M        467M
Swap:          1.9G          0B        1.9G
  • quit the terminal application

Step #3: (don't do this now, it's only a brief flowchart for the future)

  • boot to a Ubuntu Live DVD/USB
  • in gparted
    • swapoff on /dev/sda5
    • resize (shrink) the right side of /dev/sda6 by 2G
    • resize (extend) the left side of /dev/sda5 for 4G total
    • result is 4G swap (RAM x 2)
  • in terminal
    • swapoff
    • sudo mkswap /dev/sda5 # note new UUID
    • gksudo gedit /etc/fstab #edit new UUID into /etc/fstab
    • swapon -a
    • reboot
heynnema
  • 70,711
  • I have posted the screenshot of gparted and also pasted the output of sudo blkid and cat /etc/fstab in my question itself. – PAM Jun 21 '17 at 18:22
  • @PrasannaAditya I've finished my answer. Go ahead and do it. Let me know if you have any questions/problems, or if any of the results are different. – heynnema Jun 21 '17 at 20:14
  • I have done the step 2 just now and I will post the details in the question itself about what has happened exactly – PAM Jun 24 '17 at 15:55
  • Is it necessary to do step 3? – PAM Jun 24 '17 at 16:02
  • No, but you may need to in the future, if your current swap gets used too much (it's kind of small right now). Please remember to vote on my answer by clicking the up arrow just to the left of my answer. Thanks! – heynnema Jun 24 '17 at 16:04