Make a swap partition

Posted on March 18th, 2008 in Basics, Hardware, Linux+ by admin

Prerequisite: Basics of partitioning with fdisk and formatting with mkfs

So you learned a bit about fdisk and are familiar with mkfs a bit so far. But what about giving up some of your hard-drive for swap space? First let’s start off with what is swap space.

Physical memory is a limited resource on a computer. Only so many processes can fit in physical memory at any one time, though many more may actually be ready to run or execute. Swapping and paging algorithms allow processes or portions of processes to move between physical memory and a hard-drive (or in rare moments, usb drives). This frees up space in physical memory.

Swap space (called a paging file in Windows) is an area on disk that temporarily holds a process memory image. When physical memory demand is sufficiently low, process memory images are brought back into physical memory from the swap area on disk. Having sufficient swap space enables the system to keep some physical memory free at all times.

This type of memory management is often referred to as virtual memory and allows the total number of processes to exceed physical memory. Virtual memory enables the execution of a process within physical memory only as needed. However, swapping does have a downside. Compared to memory, disks are very slow. Memory speeds can be measured in nanoseconds, while disks are measured in milliseconds, so accessing the disk can be tens of thousands times slower than accessing physical memory. The more swapping that occurs, the slower your system will be. Sometimes excessive swapping or thrashing occurs where a page is swapped out and then very soon swapped in and then swapped out again and so on. In such situations the system is struggling to find free memory and keep applications running at the same time. In this case only adding more RAM will help.

Basics of partitioning with fdisk and formatting with mkfs

Posted on March 17th, 2008 in Basics, Commandline Tools, Hardware, Linux+ by admin

Gone are the days are absolutely having to know fdisk and mkfs to get started with Linux as a desktop. Most installers now set up everything for you on the install, in fact, most also setup logical volume management as well. But fdisk and mkfs are still very useful tools when you need to manually partition and format a disk. Throughout this tutorial I’ll walk you through creating and deleting partitions and the basic functions of fdisk and mkfs in linux. A follow-up tutorial will be written specifically for swap partitions and will touch back on this fdisk tutorial as well.

Viewing system information in the Commandline

Posted on March 5th, 2008 in Basics by admin

Source

GNU/Linux is bursting with information about the system on which it runs. The system’s hardware and memory, its Internet link and current processes, the latest activity of each user — all this information and more is available. And, despite such desktop tools as the KDE Control Center or GNOME’s System Monitor, the easiest place to get all the system information available is still the command line.

 

In many cases, you can view system information via specific commands. Some of these commands are written specifically to give information, while other commands that are mainly intended to alter the system in some way just happen to include parameters for viewing the current state of the system.

In other cases, you can view system information through log or configuration files or the /proc virtual filesystem. Many such files are written in plain text, so all that you need to view them are basic commands that output a file’s content to the command line, such as cat, less, or more.