[CentOS] Swap Considerations

Tue Feb 27 00:38:28 UTC 2007
Jim Perrin <jperrin at gmail.com>

> My current set up uses a /swap partition which is 2x my memory
> size

> mem = 256 MB
> $ sudo /sbin/fdisk -l
> /dev/hda6           76506       77545      524128+  82  Linux swap


For low memory systems, this logic is okay, but as your memory grows,
you don't need to keep doubling the size for swap.  For example, on a
system with 2Gigs of ram, there's no reason to have 4G of swap space.

> I'm interested in the use of a file for swap, as I hear that there
> is now no speed penalty for that. I use ext3 for my partitions.

Using swap by itself is generally a speed penalty. Using a file for it
can be done, but it's not really something I'd do.

>
> I'm also interested in whether it be reasonable/desirable to
> make /home, /tmp, and /var be on a separate partition. I have heard
> arguments on both sides, some claiming that with ext3 the system
> won't become unbootable because of /tmp filling up.

This depends entirely on the tasks required of the box.
Putting /tmp on a separate partition can allow you to mount it noexec,
which can help with security, and filling up /tmp won't fill the rest
of the disk.

/home on a separate partition can be a good thing for major upgrades
or re-installs, as you can do a completely clean install and format
the system without nuking user data.

/var is the most task dependent because this is where the webroot and
database files live by default. Splitting /var and subdirs out based
on task can be beneficial.




-- 
During times of universal deceit, telling the truth becomes a revolutionary act.
George Orwell