On Fri, Feb 15, 2002 at 05:49:49PM -0800, Hidong Kim wrote:
> Hi,
> 
> I have a machine with an 800 MB swap partition.  To run a particular
> application, I need 1,000 MB swap.  It appears that I can't create a
> swap file bigger than 4,880 kB.  Is this correct?  How would I get more
> swap space without having to re-partition?  Thanks,

Do you mean 4,880 MB?  (Since 4,880 Kb == 4.88 Mb, you've already got
more than that in your 800Mb swap partition.)  I'm not sure what the
size limit on a swap file is--probably either 2 Gb or 4 Gb, but that's
just a guess.  The limit used to be 127Mb, but that was changed a
while ago.  I've successfully created a 200M swapfile.

Regardless of that, you can create several swap files.  For example,
to create two 1Gig swap files:

# dd if=/dev/zero of=/swapfile1 bs=1M count=1k
# dd if=/dev/zero of=/swapfile2 bs=1M count=1k

# mkswap /swapfile1
# mkswap /swapfile2

# swapon /swapfile1
# swapon /swapfile2

The "swapon" commands will allow you to start using the swap
immediately instead of having to reboot.  The extra swap space should
show up in the output of the "free" command.

Add a couple of lines to /etc/fstab so that the swap will be utilized
automatically next time you reboot, and you should be fine.

If you still can't create 1G swapfiles for some reason, just try
dropping the size.  For example, you could create four 500M swapfiles
to get the same 2G of swap.  Just use bs=1M and count=500 in the dd
commands.

Two things to note: it's really important to use /dev/zero as the
input file so that there are no "holes" in the swapfile; and be very
careful with the "mkswap" command--if you give it the wrong
device/filename, you could wipe stuff out. :)

Hope this helps,
Ben

-- 
Ben Logan: ben at wblogan dot net
OpenPGP Key KeyID: A1ADD1F0

You are number 6!  Who is number one?



_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to