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.
I hv newly setup the RH linux , it use auto partition method to install , I didn't define the swap partition size , if I want to install its size , is it possible ? if yes , how to do it ? thx.
the seran's answer is correct only if there left some free space (i don't think it is!). If your harddisk is fully partitioned you need to find some way to resize(or simply delete) some partition. More easier way is to create swap file:
if you don't wish to tell "swapon /swapfile" every time you boot modify your /etc/fstab file and add record similar to created by your setup program (in case of automatic partitioning it usually exists)
Creating a swapfile instead of using a partition on the disk, is a good idea.
I tried creating a swapfile on my machine. I had a swap partition on /dev/hda2. I deleted this partition and added the swapfile entry inside /etc/fstab. I rebooted the machine and I saw this error message on the terminal.
Enabling swap partitions: could not create swap partition /swapfile [ERROR]
In the shell prompt I gave
mkswap /swapfile
swapon /swapfile
and then rebooted again. Then I got
Enabling swap paritions: [OK]
This worked fine for me.
So, I can use my /dev/hda2 partition for other purposes. This will be helpful if there is not enough space to create a swap partition on the disk. Today I am happy, I learned a new thing.
Creating a swapfile instead of using a partition on the disk, is a good idea.
It depends. Keeping the swap on a file is slower than on a partition. You will note the difference if you start using it often.
If you almost never use the swap, otherwise, you may choose to lose some speed (and response time) on those rare occasions and get a simpler partition scheme.
so..... i dont get it. you had a swap partition, on /dev/hda2 made by redhat, and you switched to a swapfile which is slower cause it uses the filesystem of the partition it is on, i think,,, and so now what with your swap partition. that makes no sense.!?!? did i miss something. that is like putting your root partition on a cd so you can just have an unused root partition on the harddrive.
Originally posted by edong23 so now what with your swap partition. that makes no sense.!?!? did i miss something.
1) it still can be used as swap-space
2) it can be formatted and used as a place for other files (not neccessary swap)
3) if you have 256Mb or more RAM Linux as a rule uses swap very rarely, so there is almost no speedup when using partition instead of file
as a rule huh. you must not use your linux box for what it is intended for. looong uptime, free software to do extensive audio and video encoding and ripping, multitasking ( like me downloading movies, while ripping mp3s, while encoding another movie, while instant messaging, while checking the forums, while playing the linux version of doom3, while downloading the linux version of quake, while also using another peer2peer to download the crack to the windows version of quake so that i may use the linux version, and all the while compiling the new 2.6.11.12 kernel. this is what i am doing right this minute, and yes i am accessing my swap space... i have 768MB Rambus mem@800mhz and i always make sure that my linux systems have at least a gig of swap. you dont want to sell yourself short incase you actually want to do something memory intensive. but anyway i jsut didnt understand y you wanted to have a swap file in place of a swap space.
btw. my uptime is 72 days 17 hours 46 minutes can you imagine? my mother is bound to kick the bucket real soon with all i put it through.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.