Linux - DesktopThis forum is for the discussion of all Linux Software used in a desktop context.
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: CentOS, RHEL, Solaris 10, AIX, HP-UX
Posts: 731
Rep:
Hi,
some little more information will be very helpfull.
Is there any free diskspace to create a new swap partition?
Would you like to setup a swap file which will be usefull for temporary use?
How much swap is available and how much physical memory?
Did you have read the ma page for "mkswap" and "swapon"?
some little more information will be very helpfull.
Is there any free diskspace to create a new swap partition?
Would you like to setup a swap file which will be usefull for temporary use?
How much swap is available and how much physical memory?
Did you have read the ma page for "mkswap" and "swapon"?
well,thank you .
you are right,some little more information is very helpful.
I have enough diskspace for me to create a new swap partition.
I just want to make my swap much more bigger,and my physical memory is 2048M. but I thought that at least 512M bigś swap is ok with me,and now I have only about 210M.
and could you tell me how to make it much more bigger?
thank you .
Distribution: CentOS, RHEL, Solaris 10, AIX, HP-UX
Posts: 731
Rep:
Hi,
create a partition on the free part of your disk using fdisk, let's assume your partition is called hda7, than change partition type to '82' using the command 't' inside fdisk.
This marks the partition for swap.
Next edit your /etc/fstab and add the new swap partition. The entry looks like this:
/dev/hda7 swap swap defaults 0 0
Than create the swap layout on the partition using 'mkswap /dev/hda7'.
After that you can reboot the system or use 'swapon /dev/hda7', both will activate the new swap partition.
After that you can savely remove the entry for your old swap partition from /etc/fstab.
create a partition on the free part of your disk using fdisk, let's assume your partition is called hda7, than change partition type to '82' using the command 't' inside fdisk.
This marks the partition for swap.
Next edit your /etc/fstab and add the new swap partition. The entry looks like this:
/dev/hda7 swap swap defaults 0 0
Than create the swap layout on the partition using 'mkswap /dev/hda7'.
After that you can reboot the system or use 'swapon /dev/hda7', both will activate the new swap partition.
After that you can savely remove the entry for your old swap partition from /etc/fstab.
Hope this is useful for you.
thank you so much,this is really helpful and useful for me.
create a partition on the free part of your disk using fdisk, let's assume your partition is called hda7, than change partition type to '82' using the command 't' inside fdisk.
This marks the partition for swap.
That's not strictly necessary for linux, though it's better to be a tidy guy. So I advice to do it as well.
The rest is well explained. I will just add a few notes:
You can add as many swap partition as you wish, no problem with having two or more if you need it for some reason.
You can as well change the size of the existing swap partition, or create a new one and erase the other one. Make sure you change fstab accordingly whatever your decision is.
It's not the current case, but if some day you need some extra swap space and there's no disk space available for partitioning, you can always use a loop file. In linux, you can format files with any filesystem, and they can also contain swap storage without any problem. This can be handy if you need a lot of swap for something and you don't have spare space on disk, or you just don't feel like playing with partitions, which is always risky and is not worth if it's for something that is only needed to do a punctual thing.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.