adheybgz post at 2015-11-7 20:25:23

Swap file ubuntu vivid #solved

Edited by adheybgz at 2015-11-8 10:04

hey guys ,. how to add / create a swap file..? im always getting out of memory .facebook and youtube and some downloads it consume 90% of ram   im using ubuntu vivid from loboris.

adheybgz post at 2015-11-8 09:32:35

Edited by adheybgz at 2015-11-8 09:45

ok , it solved now :D

i use this vodoo command

$ dd if=/dev/zero of=/path/to/swapfile bs=1M count=1024 # For 1GB swap file
$ mkswap /path/to/swapfile
$ swapon /path/to/swapfile


Voila it works
thanks guys



palloy post at 2016-1-11 17:39:06

I think that needs some improvements.The swap file should really be owned by root, and located in the root directory "/".

To create the file with zero size in / :
$ sudo touch /swapfile
Then :
$ sudo dd if=/dev/zero of=/swapfile bs=1M count=512
512+0 records in
512+0 records out
536870912 bytes (537 MB) copied, 64.1348 s, 8.4 MB/s
$ sudo mkswap /swapfile
Setting up swapspace version 1, size = 524284 KiB
no label, UUID=312d835c-759d-4d5c-8c60-2ac4e6bf7117
$ sudo swapon /swapfile
$

After rebooting you will have to make the file the swapfile again :
$ sudo swapon /swapfile
$

To check it is the swapfile :
$ sudo swapon --summary
Filename                Type      Size    Used    Priority
/swapfile                     file      524284    0    -1
$

feredy2011 post at 2016-12-17 16:04:42

palloy replied at 2016-1-11 17:39
I think that needs some improvements.The swap file should really be owned by root, and located in...

hi dear friend .
i want compile a source files on orange pi one. but i have error "cc internal compiler error"
i think this is related to RAM . can you help me ? i am beginner . can i increase ram ? please help me

page: [1]
View full version: Swap file ubuntu vivid #solved