Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: Xubuntu, Mythbuntu, Lubuntu, Picuntu, Mint 18.1, Debian Jessie
Posts: 1,207
Rep:
swap file
I'm about to install Slackware 10 on my laptop pc. I've already installed it beside 2 other Linux distros on my desktop and like Slack. My question is can I install everything on 1 drive and 1 partition (no swap partition) and then make a swap file. I don't have much memory on my laptop pc (96 megs), so a 200 meg swap partition seems like wasted space that I may need on this small 4 GB drive.
Yes, you can make a swap file. Use dd to create an empty file (copy from /dev/zero to the appropriate destination) and mkswap to make a swap area on it. List the file in /etc/fstab as if it were a swap partition, and activate it with:
Due to the fact that swap usage involves physical I/O to your hard drive, which is several orders of magnitude slower than access within RAM, you want to keep swap usage as low as possible, and the more time it's at zero usage, the better your system will perform. If you've got 96Mg of RAM then I'd suggest just creating a 128Mg swap partition. Even on a 4G drive, that gives approx 95% of the usable space to Linux and data storage. -- J.W.
Swap files are no more reliable than swap partitions. They are, however, slower than partitions, particularly if the swap file becomes fragmented on the disk (as the disk head has to seek in the middle of reads and writes to what would otherwise be contiguous space).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.