How to increase swap size when there is already a partition existing [duplicate]












0















This question already has an answer here:




  • How to increase swap space?

    5 answers




~$ sudo swapon --show gives me this



NAME      TYPE      SIZE USED PRIO
/dev/sda5 partition 976M 0B -2


I want to increase my swap size. Is there a way to increase this or do I have to create a new partition or a file? I have gparted installed and I see that there are only 2 partitions as lsblk shows below -



NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sr0 11:0 1 1024M 0 rom
sda 8:0 0 238.5G 0 disk
├─sda5 8:5 0 976M 0 part [SWAP]
└─sda1 8:1 0 237.5G 0 part /


How do I go about increasing the size?










share|improve this question







New contributor




o4385630 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











marked as duplicate by user68186, pomsky, Sergiy Kolodyazhnyy, Fabby, guiverc Dec 18 at 23:54


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.















  • Just an observation, not a answer, but if you're actually using that much swap space then your performance is going to be terrible. I'd strongly suggest increasing the amount of physical memory in the system.
    – Doug O'Neal
    Dec 18 at 23:21
















0















This question already has an answer here:




  • How to increase swap space?

    5 answers




~$ sudo swapon --show gives me this



NAME      TYPE      SIZE USED PRIO
/dev/sda5 partition 976M 0B -2


I want to increase my swap size. Is there a way to increase this or do I have to create a new partition or a file? I have gparted installed and I see that there are only 2 partitions as lsblk shows below -



NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sr0 11:0 1 1024M 0 rom
sda 8:0 0 238.5G 0 disk
├─sda5 8:5 0 976M 0 part [SWAP]
└─sda1 8:1 0 237.5G 0 part /


How do I go about increasing the size?










share|improve this question







New contributor




o4385630 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











marked as duplicate by user68186, pomsky, Sergiy Kolodyazhnyy, Fabby, guiverc Dec 18 at 23:54


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.















  • Just an observation, not a answer, but if you're actually using that much swap space then your performance is going to be terrible. I'd strongly suggest increasing the amount of physical memory in the system.
    – Doug O'Neal
    Dec 18 at 23:21














0












0








0








This question already has an answer here:




  • How to increase swap space?

    5 answers




~$ sudo swapon --show gives me this



NAME      TYPE      SIZE USED PRIO
/dev/sda5 partition 976M 0B -2


I want to increase my swap size. Is there a way to increase this or do I have to create a new partition or a file? I have gparted installed and I see that there are only 2 partitions as lsblk shows below -



NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sr0 11:0 1 1024M 0 rom
sda 8:0 0 238.5G 0 disk
├─sda5 8:5 0 976M 0 part [SWAP]
└─sda1 8:1 0 237.5G 0 part /


How do I go about increasing the size?










share|improve this question







New contributor




o4385630 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












This question already has an answer here:




  • How to increase swap space?

    5 answers




~$ sudo swapon --show gives me this



NAME      TYPE      SIZE USED PRIO
/dev/sda5 partition 976M 0B -2


I want to increase my swap size. Is there a way to increase this or do I have to create a new partition or a file? I have gparted installed and I see that there are only 2 partitions as lsblk shows below -



NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sr0 11:0 1 1024M 0 rom
sda 8:0 0 238.5G 0 disk
├─sda5 8:5 0 976M 0 part [SWAP]
└─sda1 8:1 0 237.5G 0 part /


How do I go about increasing the size?





This question already has an answer here:




  • How to increase swap space?

    5 answers








16.04 partitioning gparted swap






share|improve this question







New contributor




o4385630 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question







New contributor




o4385630 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question






New contributor




o4385630 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked Dec 18 at 22:10









o4385630

11




11




New contributor




o4385630 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





o4385630 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






o4385630 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




marked as duplicate by user68186, pomsky, Sergiy Kolodyazhnyy, Fabby, guiverc Dec 18 at 23:54


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.






marked as duplicate by user68186, pomsky, Sergiy Kolodyazhnyy, Fabby, guiverc Dec 18 at 23:54


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.














  • Just an observation, not a answer, but if you're actually using that much swap space then your performance is going to be terrible. I'd strongly suggest increasing the amount of physical memory in the system.
    – Doug O'Neal
    Dec 18 at 23:21


















  • Just an observation, not a answer, but if you're actually using that much swap space then your performance is going to be terrible. I'd strongly suggest increasing the amount of physical memory in the system.
    – Doug O'Neal
    Dec 18 at 23:21
















Just an observation, not a answer, but if you're actually using that much swap space then your performance is going to be terrible. I'd strongly suggest increasing the amount of physical memory in the system.
– Doug O'Neal
Dec 18 at 23:21




Just an observation, not a answer, but if you're actually using that much swap space then your performance is going to be terrible. I'd strongly suggest increasing the amount of physical memory in the system.
– Doug O'Neal
Dec 18 at 23:21










1 Answer
1






active

oldest

votes


















0














If you don't want to re-partition you can use a swap file. It works like it does on Windows. Instead of specifying a partition name in your fstab, you specify a file, say, in your root partition.



You will need to initialise the file simply by creating a file containing zeros of your desired size, and make it readable only by root. Also (I can't remember if this is necessary) format it with:



sudo mkswap /myswapfile



Here are some full instructions:



https://support.rackspace.com/how-to/create-a-linux-swap-file/



(It's strange they chose to put it in /mnt, that's not what /mnt is)



You can use the swap file in addition to your existing swap partition, and there should not be a performance hit. You can even specify a priority in your fstab for what order they should be used, which is for when some of your swap is on a faster device, but that's not really relevant here.






share|improve this answer






























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    If you don't want to re-partition you can use a swap file. It works like it does on Windows. Instead of specifying a partition name in your fstab, you specify a file, say, in your root partition.



    You will need to initialise the file simply by creating a file containing zeros of your desired size, and make it readable only by root. Also (I can't remember if this is necessary) format it with:



    sudo mkswap /myswapfile



    Here are some full instructions:



    https://support.rackspace.com/how-to/create-a-linux-swap-file/



    (It's strange they chose to put it in /mnt, that's not what /mnt is)



    You can use the swap file in addition to your existing swap partition, and there should not be a performance hit. You can even specify a priority in your fstab for what order they should be used, which is for when some of your swap is on a faster device, but that's not really relevant here.






    share|improve this answer




























      0














      If you don't want to re-partition you can use a swap file. It works like it does on Windows. Instead of specifying a partition name in your fstab, you specify a file, say, in your root partition.



      You will need to initialise the file simply by creating a file containing zeros of your desired size, and make it readable only by root. Also (I can't remember if this is necessary) format it with:



      sudo mkswap /myswapfile



      Here are some full instructions:



      https://support.rackspace.com/how-to/create-a-linux-swap-file/



      (It's strange they chose to put it in /mnt, that's not what /mnt is)



      You can use the swap file in addition to your existing swap partition, and there should not be a performance hit. You can even specify a priority in your fstab for what order they should be used, which is for when some of your swap is on a faster device, but that's not really relevant here.






      share|improve this answer


























        0












        0








        0






        If you don't want to re-partition you can use a swap file. It works like it does on Windows. Instead of specifying a partition name in your fstab, you specify a file, say, in your root partition.



        You will need to initialise the file simply by creating a file containing zeros of your desired size, and make it readable only by root. Also (I can't remember if this is necessary) format it with:



        sudo mkswap /myswapfile



        Here are some full instructions:



        https://support.rackspace.com/how-to/create-a-linux-swap-file/



        (It's strange they chose to put it in /mnt, that's not what /mnt is)



        You can use the swap file in addition to your existing swap partition, and there should not be a performance hit. You can even specify a priority in your fstab for what order they should be used, which is for when some of your swap is on a faster device, but that's not really relevant here.






        share|improve this answer














        If you don't want to re-partition you can use a swap file. It works like it does on Windows. Instead of specifying a partition name in your fstab, you specify a file, say, in your root partition.



        You will need to initialise the file simply by creating a file containing zeros of your desired size, and make it readable only by root. Also (I can't remember if this is necessary) format it with:



        sudo mkswap /myswapfile



        Here are some full instructions:



        https://support.rackspace.com/how-to/create-a-linux-swap-file/



        (It's strange they chose to put it in /mnt, that's not what /mnt is)



        You can use the swap file in addition to your existing swap partition, and there should not be a performance hit. You can even specify a priority in your fstab for what order they should be used, which is for when some of your swap is on a faster device, but that's not really relevant here.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Dec 18 at 22:35

























        answered Dec 18 at 22:13









        thomasrutter

        26.4k46389




        26.4k46389















            Popular posts from this blog

            Category:香港粉麵

            List *all* the tuples!

            Channel [V]