Originally Posted by zhjim
You need a free partition on your disk. Check with fdisk -l
Well, that isn't really correct. If you were going to use a partition for swap, you would need a partition, but the OP asks about a swap file, and you don't need a separate partition for that. Now
- The use of a separate partition is more traditional in Linux and used to have significant performance advantages, but, some time ago, Andrew Morton claimed that the perf advantages no longer apply to any great extent. So, you might choose a swap file...but I don't know anyone who does, so I can't personally comment on any perf difference, or no. Just, there were some once, and the only people who use swap files are either Windows refugees who don't know better, or people who messed up partitioning and want a quick 'save' for the error....
- It isn't really clear why the OP is asking about a swap file rather than a partition; is it a case of following some tut that talks of a swap file, or is it 'hadn't thought about it'?
and it requires 2gig or ram
I am reading that as '2 Gigs of RAM', although that could be wrong.
Note that, if it really uses 2 Gigs on a continuous basis, and you think that adding a little swap will just make the issues go away, that is probably wrong.
- Actively using swap would slow things down; maybe that's tolerable, maybe it isn't. Really nothing about what has been said so far would answer that question
- Adding swap to barely reach the minimum requirement may be problematic if anything else on this machine also takes a chunk of memory
Of course, you could get away with this if either
- the requirement for RAM is an installation requirement, that isn't met in day-to-day use (but maybe the day-to-day requirement is larger, depending on what you are doing, and if you are running a large database, or databases, it probably will be)
- this is something like a trial install or dev machine, which won't see much traffic and for which a little slowness isn't too high a price to pay