Sharing of swap partiton between linux systems?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP








up vote
6
down vote

favorite
4












I have a laptop on which I have installed Ubuntu 12.04 and Windows
Now just for learning purposes I am going to install Backtrack OS on it.



My laptop has 4 GB of RAM so according to the recommendation I have allocated 8 GB of swap space on my hard drive.



can I share the swap space between these two OS (Backtrack and Ubuntu)



I really don't want to waste 8 GB of more space for swap (because as I have noticed it is rarely used and as far as I know OS doesn't store any data in swap space, does it?)
So is there a way with which I can share this 8 GB swap partition? If yes how?







share|improve this question


























    up vote
    6
    down vote

    favorite
    4












    I have a laptop on which I have installed Ubuntu 12.04 and Windows
    Now just for learning purposes I am going to install Backtrack OS on it.



    My laptop has 4 GB of RAM so according to the recommendation I have allocated 8 GB of swap space on my hard drive.



    can I share the swap space between these two OS (Backtrack and Ubuntu)



    I really don't want to waste 8 GB of more space for swap (because as I have noticed it is rarely used and as far as I know OS doesn't store any data in swap space, does it?)
    So is there a way with which I can share this 8 GB swap partition? If yes how?







    share|improve this question
























      up vote
      6
      down vote

      favorite
      4









      up vote
      6
      down vote

      favorite
      4






      4





      I have a laptop on which I have installed Ubuntu 12.04 and Windows
      Now just for learning purposes I am going to install Backtrack OS on it.



      My laptop has 4 GB of RAM so according to the recommendation I have allocated 8 GB of swap space on my hard drive.



      can I share the swap space between these two OS (Backtrack and Ubuntu)



      I really don't want to waste 8 GB of more space for swap (because as I have noticed it is rarely used and as far as I know OS doesn't store any data in swap space, does it?)
      So is there a way with which I can share this 8 GB swap partition? If yes how?







      share|improve this question














      I have a laptop on which I have installed Ubuntu 12.04 and Windows
      Now just for learning purposes I am going to install Backtrack OS on it.



      My laptop has 4 GB of RAM so according to the recommendation I have allocated 8 GB of swap space on my hard drive.



      can I share the swap space between these two OS (Backtrack and Ubuntu)



      I really don't want to waste 8 GB of more space for swap (because as I have noticed it is rarely used and as far as I know OS doesn't store any data in swap space, does it?)
      So is there a way with which I can share this 8 GB swap partition? If yes how?









      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 15 '14 at 16:52









      Braiam

      49.8k20130213




      49.8k20130213










      asked Nov 15 '13 at 16:05









      Null pointer

      1,29241427




      1,29241427




















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          9
          down vote



          accepted










          Yes, you can share swap area with two or more operating systems. To share swap area, create the swap area when you install the first operating system and then when you install the second one, do not create a new swap area, instead just use the first OS's swap area as the mount point for swap area of the second OS.



          If you have already installed both OS's, use gparted to create a common swap area and then add it to your /etc/fstab file to automount it at boot-time.



          Just in case you would like to know the drawbacks of using a shared swap area, refer this question on StackExchange:



          • Ill-effects of sharing swap area





          share|improve this answer






















          • Thanks ...and can please explain the process of adding it to fstab...because I have already installed Backtrack OS and btw jobin I am from TYIT..:p
            – Null pointer
            Nov 15 '13 at 16:18











          • Found an answer explaining this verbose: askubuntu.com/questions/232790/…
            – jobin
            Nov 15 '13 at 16:32










          • @Nullpointer: Great! Good to know I have company here! :)
            – jobin
            Nov 15 '13 at 16:38







          • 1




            @Nullpointer If this answered your question, you may mark this answer as accepted, by clicking the green check mark next to it. That will indicate that your problem is solved.
            – Radu Rădeanu
            Nov 15 '13 at 18:18










          • Yeah! My mistake! I usually do that! But I forgot this time! Thanks for reminding me!
            – Null pointer
            Nov 16 '13 at 4:08

















          up vote
          6
          down vote













          Yes, it's possible. The swap is only used while the system is running, so you can do what you want with the swap space when it isn't running, such as use it as swap space for another Linux installation. You can even share swap space between Linux and Windows, but it's a bit more work.



          There is one exception: if you want to hibernate, then the swap space is in use while the system is hibernating.



          If you point the installer at the existing swap space during the installation of the second distribution, it will be able to make use of it.



          With today's disk sizes, there is usually no point in saving a couple of GB with such tricks. But it's possible.



          However, I question the utility in installing two Linux distributions in dual boot. Dual boot sucks — you can't run the two operating systems at the same time. If you want to run programs from two different Ubuntu releases, or more generally from two Linux distributions, I recommend a different approach: pick the one that has the most recent kernel and use it as your main operating system. Install the second one and run programs from it directly from your installed system, using schroot. I've written a guide on doing this which covers the installation of the second system using debootstrap and the schroot setup.






          share|improve this answer






















            Your Answer







            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "89"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            convertImagesToLinks: true,
            noModals: false,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );








             

            draft saved


            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f377516%2fsharing-of-swap-partiton-between-linux-systems%23new-answer', 'question_page');

            );

            Post as a guest






























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            9
            down vote



            accepted










            Yes, you can share swap area with two or more operating systems. To share swap area, create the swap area when you install the first operating system and then when you install the second one, do not create a new swap area, instead just use the first OS's swap area as the mount point for swap area of the second OS.



            If you have already installed both OS's, use gparted to create a common swap area and then add it to your /etc/fstab file to automount it at boot-time.



            Just in case you would like to know the drawbacks of using a shared swap area, refer this question on StackExchange:



            • Ill-effects of sharing swap area





            share|improve this answer






















            • Thanks ...and can please explain the process of adding it to fstab...because I have already installed Backtrack OS and btw jobin I am from TYIT..:p
              – Null pointer
              Nov 15 '13 at 16:18











            • Found an answer explaining this verbose: askubuntu.com/questions/232790/…
              – jobin
              Nov 15 '13 at 16:32










            • @Nullpointer: Great! Good to know I have company here! :)
              – jobin
              Nov 15 '13 at 16:38







            • 1




              @Nullpointer If this answered your question, you may mark this answer as accepted, by clicking the green check mark next to it. That will indicate that your problem is solved.
              – Radu Rădeanu
              Nov 15 '13 at 18:18










            • Yeah! My mistake! I usually do that! But I forgot this time! Thanks for reminding me!
              – Null pointer
              Nov 16 '13 at 4:08














            up vote
            9
            down vote



            accepted










            Yes, you can share swap area with two or more operating systems. To share swap area, create the swap area when you install the first operating system and then when you install the second one, do not create a new swap area, instead just use the first OS's swap area as the mount point for swap area of the second OS.



            If you have already installed both OS's, use gparted to create a common swap area and then add it to your /etc/fstab file to automount it at boot-time.



            Just in case you would like to know the drawbacks of using a shared swap area, refer this question on StackExchange:



            • Ill-effects of sharing swap area





            share|improve this answer






















            • Thanks ...and can please explain the process of adding it to fstab...because I have already installed Backtrack OS and btw jobin I am from TYIT..:p
              – Null pointer
              Nov 15 '13 at 16:18











            • Found an answer explaining this verbose: askubuntu.com/questions/232790/…
              – jobin
              Nov 15 '13 at 16:32










            • @Nullpointer: Great! Good to know I have company here! :)
              – jobin
              Nov 15 '13 at 16:38







            • 1




              @Nullpointer If this answered your question, you may mark this answer as accepted, by clicking the green check mark next to it. That will indicate that your problem is solved.
              – Radu Rădeanu
              Nov 15 '13 at 18:18










            • Yeah! My mistake! I usually do that! But I forgot this time! Thanks for reminding me!
              – Null pointer
              Nov 16 '13 at 4:08












            up vote
            9
            down vote



            accepted







            up vote
            9
            down vote



            accepted






            Yes, you can share swap area with two or more operating systems. To share swap area, create the swap area when you install the first operating system and then when you install the second one, do not create a new swap area, instead just use the first OS's swap area as the mount point for swap area of the second OS.



            If you have already installed both OS's, use gparted to create a common swap area and then add it to your /etc/fstab file to automount it at boot-time.



            Just in case you would like to know the drawbacks of using a shared swap area, refer this question on StackExchange:



            • Ill-effects of sharing swap area





            share|improve this answer














            Yes, you can share swap area with two or more operating systems. To share swap area, create the swap area when you install the first operating system and then when you install the second one, do not create a new swap area, instead just use the first OS's swap area as the mount point for swap area of the second OS.



            If you have already installed both OS's, use gparted to create a common swap area and then add it to your /etc/fstab file to automount it at boot-time.



            Just in case you would like to know the drawbacks of using a shared swap area, refer this question on StackExchange:



            • Ill-effects of sharing swap area






            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Apr 13 '17 at 12:37









            Community♦

            1




            1










            answered Nov 15 '13 at 16:12









            jobin

            18.7k1272106




            18.7k1272106











            • Thanks ...and can please explain the process of adding it to fstab...because I have already installed Backtrack OS and btw jobin I am from TYIT..:p
              – Null pointer
              Nov 15 '13 at 16:18











            • Found an answer explaining this verbose: askubuntu.com/questions/232790/…
              – jobin
              Nov 15 '13 at 16:32










            • @Nullpointer: Great! Good to know I have company here! :)
              – jobin
              Nov 15 '13 at 16:38







            • 1




              @Nullpointer If this answered your question, you may mark this answer as accepted, by clicking the green check mark next to it. That will indicate that your problem is solved.
              – Radu Rădeanu
              Nov 15 '13 at 18:18










            • Yeah! My mistake! I usually do that! But I forgot this time! Thanks for reminding me!
              – Null pointer
              Nov 16 '13 at 4:08
















            • Thanks ...and can please explain the process of adding it to fstab...because I have already installed Backtrack OS and btw jobin I am from TYIT..:p
              – Null pointer
              Nov 15 '13 at 16:18











            • Found an answer explaining this verbose: askubuntu.com/questions/232790/…
              – jobin
              Nov 15 '13 at 16:32










            • @Nullpointer: Great! Good to know I have company here! :)
              – jobin
              Nov 15 '13 at 16:38







            • 1




              @Nullpointer If this answered your question, you may mark this answer as accepted, by clicking the green check mark next to it. That will indicate that your problem is solved.
              – Radu Rădeanu
              Nov 15 '13 at 18:18










            • Yeah! My mistake! I usually do that! But I forgot this time! Thanks for reminding me!
              – Null pointer
              Nov 16 '13 at 4:08















            Thanks ...and can please explain the process of adding it to fstab...because I have already installed Backtrack OS and btw jobin I am from TYIT..:p
            – Null pointer
            Nov 15 '13 at 16:18





            Thanks ...and can please explain the process of adding it to fstab...because I have already installed Backtrack OS and btw jobin I am from TYIT..:p
            – Null pointer
            Nov 15 '13 at 16:18













            Found an answer explaining this verbose: askubuntu.com/questions/232790/…
            – jobin
            Nov 15 '13 at 16:32




            Found an answer explaining this verbose: askubuntu.com/questions/232790/…
            – jobin
            Nov 15 '13 at 16:32












            @Nullpointer: Great! Good to know I have company here! :)
            – jobin
            Nov 15 '13 at 16:38





            @Nullpointer: Great! Good to know I have company here! :)
            – jobin
            Nov 15 '13 at 16:38





            1




            1




            @Nullpointer If this answered your question, you may mark this answer as accepted, by clicking the green check mark next to it. That will indicate that your problem is solved.
            – Radu Rădeanu
            Nov 15 '13 at 18:18




            @Nullpointer If this answered your question, you may mark this answer as accepted, by clicking the green check mark next to it. That will indicate that your problem is solved.
            – Radu Rădeanu
            Nov 15 '13 at 18:18












            Yeah! My mistake! I usually do that! But I forgot this time! Thanks for reminding me!
            – Null pointer
            Nov 16 '13 at 4:08




            Yeah! My mistake! I usually do that! But I forgot this time! Thanks for reminding me!
            – Null pointer
            Nov 16 '13 at 4:08












            up vote
            6
            down vote













            Yes, it's possible. The swap is only used while the system is running, so you can do what you want with the swap space when it isn't running, such as use it as swap space for another Linux installation. You can even share swap space between Linux and Windows, but it's a bit more work.



            There is one exception: if you want to hibernate, then the swap space is in use while the system is hibernating.



            If you point the installer at the existing swap space during the installation of the second distribution, it will be able to make use of it.



            With today's disk sizes, there is usually no point in saving a couple of GB with such tricks. But it's possible.



            However, I question the utility in installing two Linux distributions in dual boot. Dual boot sucks — you can't run the two operating systems at the same time. If you want to run programs from two different Ubuntu releases, or more generally from two Linux distributions, I recommend a different approach: pick the one that has the most recent kernel and use it as your main operating system. Install the second one and run programs from it directly from your installed system, using schroot. I've written a guide on doing this which covers the installation of the second system using debootstrap and the schroot setup.






            share|improve this answer


























              up vote
              6
              down vote













              Yes, it's possible. The swap is only used while the system is running, so you can do what you want with the swap space when it isn't running, such as use it as swap space for another Linux installation. You can even share swap space between Linux and Windows, but it's a bit more work.



              There is one exception: if you want to hibernate, then the swap space is in use while the system is hibernating.



              If you point the installer at the existing swap space during the installation of the second distribution, it will be able to make use of it.



              With today's disk sizes, there is usually no point in saving a couple of GB with such tricks. But it's possible.



              However, I question the utility in installing two Linux distributions in dual boot. Dual boot sucks — you can't run the two operating systems at the same time. If you want to run programs from two different Ubuntu releases, or more generally from two Linux distributions, I recommend a different approach: pick the one that has the most recent kernel and use it as your main operating system. Install the second one and run programs from it directly from your installed system, using schroot. I've written a guide on doing this which covers the installation of the second system using debootstrap and the schroot setup.






              share|improve this answer
























                up vote
                6
                down vote










                up vote
                6
                down vote









                Yes, it's possible. The swap is only used while the system is running, so you can do what you want with the swap space when it isn't running, such as use it as swap space for another Linux installation. You can even share swap space between Linux and Windows, but it's a bit more work.



                There is one exception: if you want to hibernate, then the swap space is in use while the system is hibernating.



                If you point the installer at the existing swap space during the installation of the second distribution, it will be able to make use of it.



                With today's disk sizes, there is usually no point in saving a couple of GB with such tricks. But it's possible.



                However, I question the utility in installing two Linux distributions in dual boot. Dual boot sucks — you can't run the two operating systems at the same time. If you want to run programs from two different Ubuntu releases, or more generally from two Linux distributions, I recommend a different approach: pick the one that has the most recent kernel and use it as your main operating system. Install the second one and run programs from it directly from your installed system, using schroot. I've written a guide on doing this which covers the installation of the second system using debootstrap and the schroot setup.






                share|improve this answer














                Yes, it's possible. The swap is only used while the system is running, so you can do what you want with the swap space when it isn't running, such as use it as swap space for another Linux installation. You can even share swap space between Linux and Windows, but it's a bit more work.



                There is one exception: if you want to hibernate, then the swap space is in use while the system is hibernating.



                If you point the installer at the existing swap space during the installation of the second distribution, it will be able to make use of it.



                With today's disk sizes, there is usually no point in saving a couple of GB with such tricks. But it's possible.



                However, I question the utility in installing two Linux distributions in dual boot. Dual boot sucks — you can't run the two operating systems at the same time. If you want to run programs from two different Ubuntu releases, or more generally from two Linux distributions, I recommend a different approach: pick the one that has the most recent kernel and use it as your main operating system. Install the second one and run programs from it directly from your installed system, using schroot. I've written a guide on doing this which covers the installation of the second system using debootstrap and the schroot setup.







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Apr 13 '17 at 12:37









                Community♦

                1




                1










                answered Mar 15 '14 at 13:22









                Gilles

                43.3k1398137




                43.3k1398137






















                     

                    draft saved


                    draft discarded


























                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f377516%2fsharing-of-swap-partiton-between-linux-systems%23new-answer', 'question_page');

                    );

                    Post as a guest













































































                    Popular posts from this blog

                    pylint3 and pip3 broken

                    Missing snmpget and snmpwalk

                    How to enroll fingerprints to Ubuntu 17.10 with VFS491