dphys-swapfile - set up, mount/unmount, and delete an swap file
dphys-swapfile setup|install|swapon|swapoff|uninstall
dphys-swapfile computes the size for an optimal swap file (and resizes an existing swap file if necessary), mounts an swap file, unmounts it, and deletes it it is not wanted any more.
There is only one parameter, an command, which can be either of these: setup and install Both tell dphys-swapfile to compute the optimal swap file size and (re-)generate an fitting swap file. Default it 2 times RAM size. This can be called at boot time, so the file allways stays the right size for current RAM, or run by hand whenever RAM size has changed. swapon and swapoff These run the swapon and swapoff commands on the swapfile. Note that direct swapon/off from /etc/fstab is not possible, as that is (at least on Debian) done in the same script that mounts /var (which is where the swap file most likely resides). And we need to do our setup between those actions. So we pass up on /etc/fstab, and do our own swapon/off here. uninstall Gets rid of an unwanted swap file, reclaiming its disk space.
The config file /etc/dphys-swapfile allows the user to set up the working environment for dphys-swapfile. This config file is a sh script fragment full of assignments, which is sourced. Standard sh syntax rules apply. Assignments are: CONF_SWAPFILE Set where the swap file should be placed. Defaults to /var/swap. It is unlikely that you will need to change this, unless you have very strange partitioning, and then you will most likely be using an swap partition anyway. CONF_SWAPSIZE Set size to this absolute value, in MBytes. Leaving this empty (which is the Default) uses an computed value as size instead. This is unlikely to ever be needed, unless in some strange diskspace situations. Note, that swap enabled and size smaller than RAM may causes kernal-internal VM troubles on some kernels/systems. CONF_SWAPFACTOR Set size to computed value. Uses this value times RAM size. It so dynamically adapts to RAM size, guarantees enough swap on large RAM, without going into excess diskspace on small RAM (and disk?) systems. Defaults to 2, which gives swap size = 2 * RAM size. CONF_MAXSWAP Set size restriction of maximal computed and absolute(!) values, in MBytes. Defaults to 2048 which was a former 32bit kernel limit for the swapfile size and is now a limit to prevent unusually and senselessly big swap files on systems with a lot of RAM.
/etc/dphys-swapfile user config $CONF_SWAPFILE the swap file, target of the whole action (defaults to /var/swap)
dphys-swapfile is usually run at system startup and shutdown from an /etc/init.d (or /etc/rc.d) script, such as this (minimal) one: #!/bin/sh # /etc/init.d/dphys-swapfile - automatically set up an swapfile # author franklin, last modification 2004.06.04 # This script is copyright ETH Zuerich Physics Departement, # use under either modified/non-advertising BSD or GPL license case "$1" in start) /sbin/dphys-swapfile setup /sbin/dphys-swapfile swapon ;; stop) /sbin/dphys-swapfile swapoff ;; esac exit 0 If an sysadmin wants to have the swapfile in another place, say /var/run/swap, he can use: In /etc/dphys-swapfile: CONF_SWAPFILE=/var/run/swap
neil@franklin.ch, http://neil.franklin.ch/
Personal Opportunity - Free software gives you access to billions of dollars of software at no cost. Use this software for your business, personal use or to develop a profitable skill. Access to source code provides access to a level of capabilities/information that companies protect though copyrights. Open source is a core component of the Internet and it is available to you. Leverage the billions of dollars in resources and capabilities to build a career, establish a business or change the world. The potential is endless for those who understand the opportunity.
Business Opportunity - Goldman Sachs, IBM and countless large corporations are leveraging open source to reduce costs, develop products and increase their bottom lines. Learn what these companies know about open source and how open source can give you the advantage.
Free Software provides computer programs and capabilities at no cost but more importantly, it provides the freedom to run, edit, contribute to, and share the software. The importance of free software is a matter of access, not price. Software at no cost is a benefit but ownership rights to the software and source code is far more significant.
Free Office Software - The Libre Office suite provides top desktop productivity tools for free. This includes, a word processor, spreadsheet, presentation engine, drawing and flowcharting, database and math applications. Libre Office is available for Linux or Windows.
The Free Books Library is a collection of thousands of the most popular public domain books in an online readable format. The collection includes great classical literature and more recent works where the U.S. copyright has expired. These books are yours to read and use without restrictions.
Source Code - Want to change a program or know how it works? Open Source provides the source code for its programs so that anyone can use, modify or learn how to write those programs themselves. Visit the GNU source code repositories to download the source.
Study at Harvard, Stanford or MIT - Open edX provides free online courses from Harvard, MIT, Columbia, UC Berkeley and other top Universities. Hundreds of courses for almost all major subjects and course levels. Open edx also offers some paid courses and selected certifications.
Linux Manual Pages - A man or manual page is a form of software documentation found on Linux/Unix operating systems. Topics covered include computer programs (including library and system calls), formal standards and conventions, and even abstract concepts.