Ron Johnson wrote:
> On Tue, 2006-04-04 at 18:07 -0400, Chris Roddy wrote:
> > Ron Johnson wrote:
> > > If you are using a 2.6 kernel, then you can also use a swap
*file*.
> > > "man mkswap" tells you how to set it up.
> > 
> > 
> > Oh! I'd forgotten about that. But I didn't know that was new with
2.6. I
> > could swear I've used a swap file on 2.4. Maybe I'm imagining it,
though.
> 
> It's "always" been there, but before 2.6, there was a speed penalty
> for using swap files, which was supposed to be eliminated in 2.6.
> 

I'm using 2.4;

$ uname -a
Linux localhost 2.4.27-2-386 #1 Wed Aug 17 09:33:35 UTC 2005 i686
GNU/Linux

I just went through a messy way of setting up a swapfile - but I
certainly learned ;-) -- What can I say, but I'm new.
Read all about it here;
http://tinyurl.com/m39wa
link to c.o.l.misc
(jump to the "SOLVED" altered title for quick answer)

Basically to setup a swapFILE - I did this;
# First - to create the actual file - say of 128MB;
# Note; I used 1024 as a (1K) block size, but you can choose much 
# larger, such as 32KB perhaps, if you like. Count=KBYTES
# just do the math and adjust the count= to compensate.
~$ dd if=/dev/zero of=swap bs=1024 count=131072

# Where I chose to place the file. Options explained in 'man mkswap'
~$ mkswap -c -v1 /var/tmp/swap

# Now, turn the swapfile on (notify the kernel);
~$ swapon /var/tmp/swap

# Finish up by editing (create and entry in) /etc/fstab
# so it is kept, found and used upon bootup (I used 'nano'
# as the editor).
# pri= is unnecessary and only used if multiple swaps are present..
# otherwise 'defaults'(?) might be correct/ok there, under options

~$ nano /etc/fstab
# I added this line
/var/tmp/swap   swap     swap    pri=32500       0       0

Can check for usuage;
~$ cat /proc/swaps
Filename                        Type            Size    Used   
Priority
/var/tmp/swap                   file            131064  0       32500

Also use 'free'
$ free
             total       used       free     shared    buffers     
[snipped]....

Swap:       131064          0     131064


I *think* I outlined all the steps correctly ,but since I'm very new -
please take that into consideration.

Note also - there are some mitigating reasons why I didn't just create
a swap *partition* (no more partitions are available on this HDD - just
for now)-- though creating a swap partition is even easier and is
discussed in detail in my thread I linked to in c.o.l.misc

Regards




__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to