Minggu, 29 September 2019

How to Add swap memory on Linux Debian 8

  Tidak ada komentar
How to Add swap memory on Linux Debian 8
[email protected] ~$ cat /etc/*ease
PRETTY_NAME="Debian GNU/Linux 8 (jessie)"
NAME="Debian GNU/Linux"
VERSION_ID="8"
VERSION="8 (jessie)"
ID=debian
HOME_URL="http://www.debian.org/"
SUPPORT_URL="http://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
[email protected] ~$
[email protected] ~$ swapon -s
Filename                                Type            Size    Used    Priority
/dev/dm-1                               partition       524284  188     -1
[email protected] ~$
[email protected] ~$ free -m
             total       used       free     shared    buffers     cached
Mem:          2010       1841        168         40        151       1180
-/+ buffers/cache:        508       1501
Swap:          511          0        511
[email protected] ~$
[email protected] ~$ df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/dm-0        17G  6.0G  9.9G  38% /
udev             10M     0   10M   0% /dev
tmpfs           403M   41M  362M  11% /run
tmpfs          1006M     0 1006M   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs          1006M     0 1006M   0% /sys/fs/cgroup
/dev/sda1       415M  158M  236M  41% /boot
[email protected] ~$
[email protected] ~$ sudo fallocate -l 2G /swapfile
[sudo] password for ecpa:
[email protected] ~$ ls -lh /swapfile
-rw-r--r-- 1 root root 2.0G Sep 26 14:18 /swapfile
[email protected] ~$
[email protected] ~$ sudo mkswap /swapfile
Setting up swapspace version 1, size = 2097148 KiB
no label, UUID=0282a4d7-26ab-42f9-a3ac-3ca3ad3cdce4
[email protected] ~$
[email protected] ~$ sudo swapon /swapfile
swapon: /swapfile: insecure permissions 0644, 0600 suggested.
[email protected] ~$
[email protected] ~$ sudo chmod 0600 /swapfile
[email protected] ~$
[email protected] ~$ sudo swapon /swapfile
swapon: /swapfile: swapon failed: Device or resource busy
[email protected] ~$
[email protected] ~$ swapon -s
Filename                                Type            Size    Used    Priority
/dev/dm-1                               partition       524284  188     -1
/swapfile                               file            2097148 0       -2
[email protected] ~$
[email protected] ~$ free -m
             total       used       free     shared    buffers     cached
Mem:          2010       1829        180         40        152       1181
-/+ buffers/cache:        495       1514
Swap:         2559          0       2559
[email protected] ~$
[email protected] ~$ sudo vi /etc/fstab
[email protected] ~$
[email protected] ~$ cat /etc/fstab
proc                    /proc   proc    nodev,noexec,nosuid     0       0
/dev/mapper/turnkey-root        /       ext4    errors=remount-ro       0      1
UUID=7b23edb7-a066-4135-b0e7-c7ca87d09d8a       /boot   ext2    defaults       02
/dev/mapper/turnkey-swap_1      none    swap    sw      0       0
/swapfile                                       swap    swap    sw  0   0
[email protected] ~$
[email protected] ~$ cat /proc/sys/vm/swappiness
60
[email protected] ~$

Tidak ada komentar :

Posting Komentar