Well, your "free" says you're using no swap right now. I'll assume from
the email that you have an actual partition dedicated to swap. Here's
what I'd do:
1. run 'fdisk' on the drive you have a swap partition on and get the size
of that swap partition in blocks (while you're in there make sure that
partition's type is "82" ("Linux swap")). Here's what my fdisk looks
like for comparison:
Device Boot Begin Start End Blocks Id System
/dev/hda1 1 1 192 1542208+ 83 Linux native
/dev/hda2 193 193 460 2152710 83 Linux native
/dev/hda3 461 461 1016 4466070 83 Linux native
/dev/hda4 1017 1017 1024 64260 82 Linux swap
So, here you can see my type is set to swap and size in blocks in 64260.
2. Run mkswap on your swap partition. The syntax is:
mkswap [ -c ] device [size-in-blocks]
So for me, I'd run:
mkswap -c /dev/hda4 64260
(The -c just checks for bad blocks, but it's a good idea.)
3. Now that the swap partition is created, just swapon it. The syntax is:
swapon /dev/hda4
At this point, you should see the swap appear in your "free" listing.
4. Now, if you want it to use this swap partition all the time without
having to swapon it each time, you'll need to add a line in your
/etc/fstab, here's what I use:
/dev/hda4 swap swap defaults 0 0
Hope this helps,
Neil Doane
On Thu, 4 Mar 1999, sweeloong mok wrote:
> hi all,
>
> I'm using redhat 5.0, I try to figure out whether my swap partition is
> working fine...I try the swapon -s and swapon -a, it said /proc/swap is
> not a valid directory or file or some sort, pardon me :p cant remember
> the exact err msg, and during installation, I can remember I DID NOT
> specified any mount point for the swap partition, is this correct? And
> under my /etc/fstab there is nothing mounted for swap, how do I find out
> my swap is ok?
> what should i do to configure it properly?
> how to check the swap patition status other then using free?
>
> Good day & thanks!
> p/s: below listing may clearify my language description :p, pardon my
> lang...
>
> [root@breezy /root]# free
>
> total used free shared
> buffers cached
> Mem: 63160 60300 2860 23212
> 10144 27824
> -/+ buffers/cache: 22332 40828
> Swap: 0 0 0
>
> [root@breezy /root]# df
> Filesystem 1024-blocks Used Available Capacity Mounted on
> /dev/hdb5 575634 475932 69968 87% /
> /dev/hda1 2096160 1711552 384608 82% /mnt/dos
> /dev/hda5 2088096 1716608 371488 82% /mnt/dos1
> /dev/hdb1 1445216 1268160 177056 88% /mnt/dos2
> /dev/hdc 653372 653372 0 100% /mnt/cdrom