Join the community today
Become a Member

Install CentOS7 swap with centminmod .08

Discussion in 'Install & Upgrades or Pre-Install Questions' started by Epic Internet Marketing, Aug 21, 2015.

Tags:
  1. Epic Internet Marketing

    Epic Internet Marketing Member

    40
    7
    8
    Aug 3, 2014
    New York, NY
    Ratings:
    +18
    Local Time:
    12:40 AM
    1.12.x | PHP 7.1.x
    10.1
    Does swap come pre-configured when setting up a centminmod .08 for the first time or does it need to be setup manually? My /dev/loop0 is 3.7gb so I assumed that it would be it but google says its loopback for drivers.

     
  2. eva2000

    eva2000 Administrator Staff Member

    54,907
    12,240
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,811
    Local Time:
    12:40 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    for Centmin Mod initial setup, /tmp setup yes, swap no

    you check via commands

    check /tmp
    Code:
    df -hT
    check swap
    Code:
    free -m
    Code:
    swapon -s
    Code:
    swapon -h
    
    Usage:
    swapon -a [-e] [-v] [-f]             enable all swaps from /etc/fstab
    swapon [-p priority] [-v] [-f] <special>  enable given swap
    swapon -s                            display swap usage summary
    swapon -h                            display help
    swapon -V                            display version
    
    The <special> parameter:
    {-L label | LABEL=label}             LABEL of device to be used
    {-U uuid  | UUID=uuid}               UUID of device to be used
    <device>                             name of device to be used
    <file>                               name of file to be used
    Code:
    free -m
                 total       used       free     shared    buffers     cached
    Mem:           996        707        288         47         97        312
    -/+ buffers/cache:        297        698
    Swap:         1839          0       1839 
    Code:
    swapon -s
    Filename                                Type            Size    Used    Priority
    /dev/dm-1                               partition       1884156 0       -1
    example on my KVM Linode with CentOS 7
    Code:
    df -hT
    Filesystem     Type      Size  Used Avail Use% Mounted on
    /dev/root      ext4       20G  9.5G  9.5G  50% /
    devtmpfs       devtmpfs  495M     0  495M   0% /dev
    tmpfs          tmpfs     496M     0  496M   0% /dev/shm
    tmpfs          tmpfs     496M   52M  445M  11% /run
    tmpfs          tmpfs     496M     0  496M   0% /sys/fs/cgroup
    /dev/loop0     ext4      3.7G   16M  3.5G   1% /tmp
    Linode configured swap within VPS console
    Code:
    free -m
                  total        used        free      shared  buff/cache   available
    Mem:            991         170         104          53         716         523
    Swap:          2047         495        1552
     
  3. Epic Internet Marketing

    Epic Internet Marketing Member

    40
    7
    8
    Aug 3, 2014
    New York, NY
    Ratings:
    +18
    Local Time:
    12:40 AM
    1.12.x | PHP 7.1.x
    10.1
    So if I have /dev/loop0 mounted on /tmp do I also need to create Swap?
     
  4. eva2000

    eva2000 Administrator Staff Member

    54,907
    12,240
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,811
    Local Time:
    12:40 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Generally it is advisable to create swap if you don't have one setup. Some providers like Linode setup swap at VPS/disk partition creation time.
     
  5. Epic Internet Marketing

    Epic Internet Marketing Member

    40
    7
    8
    Aug 3, 2014
    New York, NY
    Ratings:
    +18
    Local Time:
    12:40 AM
    1.12.x | PHP 7.1.x
    10.1
    Thanks for clearing that up, since I'm using vultr (quite happily) I got swap added.

    I'll have to give linode a shot sometime.
     
  6. eva2000

    eva2000 Administrator Staff Member

    54,907
    12,240
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,811
    Local Time:
    12:40 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Yeah was thinking about auto setup for swap but so many VPS and dedicated configs out there and root / is not always the largest and best partition in terms of disk free space to place the swap file. My attempts at kvm swap file ยท GitHub a few months ago.. haven't tested it much yet