≡ Menu

Linux laptop

Linux and other Unix-like operating systems use the term "swap" to describe both the act of moving memory pages between RAM and disk, and the region of a disk the pages are stored on. It is common to use a whole partition of a hard disk for swapping. However, with the 2.6 Linux kernel, swap files are just as fast as swap partitions. Now, many admins (both Windows and Linux/UNIX) follow an old rule of thumb that your swap partition should be twice the size of your main system RAM. Let us say I've 32GB RAM, should I set swap space to 64 GB? Is 64 GB of swap space really required? How big should your Linux / UNIX swap space be?

Old dumb memory managers

I think the '2x swap space' rule came from Old Solaris and Windows admins. Also, earlier memory mangers were very badly designed. There were not very smart. Today, we have very smart and intelligent memory manager for both Linux and UNIX.

Nonsense rule: Twice the size of your main system RAM for Servers

According to OpenBSD FAQ:

Many people follow an old rule of thumb that your swap partition should be twice the size of your main system RAM. This rule is nonsense. On a modern system, that's a LOT of swap, most people prefer that their systems never swap. You don't want your system to ever run out of RAM+swap, but you usually would rather have enough RAM in the system so it doesn't need to swap.

Select right size for your setup

Here is my rule for normal server (Web / Mail etc):

  1. Swap space == Equal RAM size (if RAM < 2GB)
  2. Swap space == 2GB size (if RAM > 2GB)

My friend who is a true Oracle GURU recommends something as follows for heavy duty Oracle server with fast storage such as RAID 10:

  1. Swap space == Equal RAM size (if RAM < 8GB)
  2. Swap space == 0.50 times the size of RAM (if RAM > 8GB)

Red Hat Recommendation

Red hat recommends setting as follows for RHEL 5:

The reality is the amount of swap space a system needs is not really a function of the amount of RAM it has but rather the memory workload that is running on that system. A Red Hat Enterprise Linux 5 system will run just fine with no swap space at all as long as the sum of anonymous memory and system V shared memory is less than about 3/4 the amount of RAM. In this case the system will simply lock the anonymous and system V shared memory into RAM and use the remaining RAM for caching file system data so when memory is exhausted the kernel only reclaims pagecache memory.

Considering that 1) At installation time when configuring the swap space there is no easy way to predetermine the memory a workload will require, and 2) The more RAM a system has the less swap space it typically needs, a better swap space

  1. Systems with 4GB of ram or less require a minimum of 2GB of swap space
  2. Systems with 4GB to 16GB of ram require a minimum of 4GB of swap space
  3. Systems with 16GB to 64GB of ram require a minimum of 8GB of swap space
  4. Systems with 64GB to 256GB of ram require a minimum of 16GB of swap space

Swap will just keep running servers...

Swap space will just keep operation running for a while on heavy duty servers by swapping process. You can always find out swap space utilization using any one of the following command:
cat /proc/swaps
swapon -s
free -m

See how to find out disk I/O and related information under Linux. In the end, you need to add more RAM, adjust software (like controlling Apache workers or using lighttpd web server to save RAM) or use some sort of load balancing.

Also, refer Linux kernel documentation for /proc/sys/vm/swappiness. With this you can fine tune swap space.

A note about Desktop and Laptop

If you are going to suspend to disk, then you need swap space more than actual RAM. For example, my laptop has 1GB RAM and swap is setup to 2GB. This only applies to Laptop or desktop but not to servers.

Kernel hackers need more swap space

If you are a kernel hacker (debugging and fixing kernel issues) and generating core dumps, you need twice the RAM swap space.


If Linux kernel is going to use more than 2GiB swap space at a time, all users will feel the heat. Either, you get more RAM (recommend) and move to faster storage to improve disk I/O. There are no rules, each setup and configuration is unique. Adjust values as per your requirements. Select amount of swap that is right for you.

What do you think? Please add your thoughts about 'swap space' in the comments below.

With the growing ubiquity of, and user reliance on, mobile computing devices (laptops, PDAs, smart phones, etc.), loss or theft of a device is increasingly likely, disruptive, and costly.

Adeona is the first Open Source system for tracking the location of your lost or stolen laptop that does not rely on a proprietary, central service. This means that you can install Adeona on your laptop and go -- there's no need to rely on a single third party. What's more, Adeona addresses a critical privacy goal different from existing commercial offerings. It is privacy-preserving. This means that no one besides the owner (or an agent of the owner's choosing) can use Adeona to track a laptop. Unlike other systems, users of Adeona can rest assured that no one can abuse the system in order to track where they use their laptop.

This looks good solution but if thief wipe the hard drive at first boot then this software will not help you. If your laptop carries sensitive data encrypt it with software.

Download Adeona

Click here to download open source Adeona software for Mac OS X, Linux and Windows operating systems (via Linux.com)

TrueCrypt version 6.0 has been released and available for download. It is free open-source disk encryption software for Windows Vista/XP, Mac OS X, and Linux system. A perfect software for laptop or desktop system which allows data be to be protected even when the OS is not active, for example, if data is read directly from the hardware.

Version 6.0x offers parallelized encryption/decryption on multi-core processors (multi-processor systems). Increase in encryption/decryption speed is directly proportional to the number of cores and/or processors. Ability to create and run an encrypted hidden operating system whose existence is impossible to prove. Ability to create hidden volumes under Mac OS X and Linux.

(Fig. 01: TrueCrypt in action [image credit TrueCrypt project])

Download TrueCrypt Open Source Edition

Asus dominates the market for super small, super cheap Linux / XP based mini-notebook pc. It is believed that they may have sold over 5 million Eee PCs. Now you can grab this PC for free. Royal Bank of Canada (RBC) is running spring 2008 promotion and giving out a free Asus EEE PC for every new account opened with them. Similarly you can signup to T-Mobile's 'Web n Walk' max mobile boradband package for £35 per month ona 24 month contract and get a free USB modem and a free Asus EEE PC ultra mobile PC.

It turns out that people just wanted a regular laptop, but much smaller and cheaper. When Asus came out with its mostly solid state, plain vanilla PC running Linux (and now XP), the masses flocked. And now, Acer, Dell, HP and possibly Sony, as well as a smattering of smaller companies, are rushing their own cheap-and-tiny offerings.

=> Here Comes the Asus 'Freee PC'? (via Slashdot)

Ubuntu Linux Remix For Intel Atom Processor

Intel Atom processor used by ultra-mobile PCs, smart phone, other portable and low-power applications. Ubuntu announced Ubuntu Linux Remix, the new operating system will be targeted to OEM vendors that are building their own netbooks for sale to end users. From the press release:

Canonical, the commercial sponsor of Ubuntu, today announced that it will be demonstrating a reworked desktop image of Ubuntu built specifically for a new category of portable Internet-centric devices – netbooks. These affordable, power-efficient, small screen devices, based on the ground breaking low-power micro-architecture of the Intel Atom processor, and Ubuntu allow consumers to enjoy email, instant messaging, Internet surfing and on-line access to photos, videos or music with an affordable, reliable device.

=> Canonical Showcases Ubuntu Netbook Remix at Computex

XO Laptop: Hello Windows ~ Goodbye Linux :(

The One Laptop Per Child Project and Microsoft plan to make both Windows and Linux available on a version of the project's XO Laptop. It means the little green laptop would now run Windows XP as well as Linux. According to Nicholas Negroponte:

OLPC is not in the open-source advocacy business ... we're in the education business.

This will not just kill enthusiasm for the project but the project itself. Windows XP will not run smoothly on low end hardware. It will be now dual-boot system with Sugar and Microsoft's Student Innovation Suite, a US$3 software (Windows XP, Microsoft Office Home and Student 2007, Microsoft Math 3.0, Learning Essentials 2.0 for Microsoft Office and Windows Live Mail software).

More information available here.

OLPC did not specify the price of the dual-boot system.

To help schools offer affordable computing to every student, HP today introduced a full-function, mini-notebook Linux powered PC priced starting under $500. HP will join a fledgling market already populated with products from Intel Corp., the world's largest semiconductor company, and Asustek Computers Inc., the world's largest maker of computer motherboards.

The only way to keep cost is use Linux and create network only computer for everybody. Windows vista cannot be installed because of price tag and higher hardware requirements.

Notebook features

  • Simple, refined design and anodized aluminum shell that is sleek and sturdy yet lightweight;
    HP DuraKeys, featuring a clear coating applied over the notebook keyboard that protects the finish and printed letters and characters;
  • An HP 3D DriveGuard, which sends a signal to shut down the hard drive upon sudden movement or shock by using a three-axis digital accelerometer chip
  • Scratch-resistant display and magnesium hinge bracket
  • A large 8.9-inch diagonal WXGA display, user-friendly full keyboard (QWERTY) and touchpad;
  • Ability to view video, still-image capture, web conferencing or video-enhanced instant messaging with no additional hardware to buy or carry. An optional integrated VGA webcam enables video and still-image capture to allow the addition of photos and video clips to presentations, documents and email;
  • Two battery solutions – three-cell for lightest-weight configurations or optional six-cell for longer battery life;
  • Wireless technologies such as integrated Wi-Fi Certified WLAN(3) and optional Bluetooth™, allowing students to access the Internet as well as communicate via email, IM, chat, VOIP and blogging. The wireless technologies also enable connections at hotspots as well as with Bluetooth devices such as printers, mice and headsets; and
  • The processors HP is using are made by Via Technologies Inc., the distant third-ranked player in the microprocessor space, and come in clock speeds up to 1.6 gigahertz.

=> More information available here and here.