Home
Username:
Password:
CompTIA Linux+ Certification 2009 Tutorials

Basic Operations / The Swap Volume




Visitors to VTC.com will be able to view all introductory videos for each training course.
Free Trial Members will gain access to first three chapters for each training course.
Full Access Members have full access to VTC.com’s entire library of video tutorials.


Learn More

Subtitles of the Movie

The Swap Volume. Swap space provides an extension to RAM. It's a dedicated area on the hard drive where pages of memory can be temporarily stored as RAM is required by new processes and applications. If you paid attention during the Linux installation process you'll note in most cases major distributions don't use Microsoft-style swap files, but swap volumes. In many cases that swap volume is the dedicated partition. Sometimes it's part of a volume group configured in a logical volume. Most Linux installations configure a volume of approximately twice the detected RAM on the local system but if you have a lot of RAM, perhaps not that much RAM with the latest systems, a smaller swap partition or volume may work just fine. For example, I have 4 gigabytes of RAM on my laptop and a 2 gigabyte swap partition works fine for me. In fact, rarely does my system use more than a few hundred megabytes a swap space. A similar system is my server system with 2 gigabytes of RAM. I've set up a default 4 gigabyte swap partition but as you can see here even with a bunch of virtual machines running I have only a little bit of swap space that's actually in use. But if necessary you can set up an additional swap volume. The simplest way is from a partition from a new drive but if you've created a new logical volume device the basic remaining steps are the same. Let's take a look at this particular virtual machine and set up dev sdb2 as a swap volume so let's go into dev sdb with the fdsk command and change the type of partition 2, in other words, sdb2, to type 82 which is the Linux swap partition type. I press p to confirm the result, I write the changes and now I can format the swap volume with the mkswap command, dev sdb2. That swap partition is now formatted and suitable for swap space and now I can activate that swap partition with the swapon command. I can confirm the result in the proc swaps file. Ah, there it is. I have two swap partitions active, one of less than 500 megabytes and another of about 100 megabytes. I confirm with the top command. That looks like the right amount of space. How about that? I've now added more swap space to my system. Thank you and on to the next video.

Tutorial Information

Course: CompTIA Linux+ Certification 2009
Author: Michael Jang
SKU: 34070
ISBN: 1-935320-91-2
Release Date: 2009-12-22
Duration: 6.5 hrs / 82 lessons
Captions: Available on CD and Online University
Compatibility: Vista/XP/2000, OS X, Linux
QuickTime 7, Flash 8

VTC Sign up & Benefits

  • Unlimited Access
  • 98,729 Video Tutorials (23,265 free)
  • Video Available as Flash or QuickTime
  • Over 1026 Courses
  • $30 for One Month Access
  • Multi-User Discounts Available