Removing the swap partition from a LUKS encrypted SSDD

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











up vote
1
down vote

favorite












I installed Linux Mint 18.2, as LVM with LUKS encryption, onto a 128GB SSDD. I would like to remove the swap drive b/c I have 16GB of RAM on my machine and I want to try to preserve the drive as long as I can. When I started the disk and started Gparted to remove the swap partition I noticed that Gparted lists the drive as only two partitions /dev/sdb1 ~.5GB boot-sector (I think) and /dev/sdb2 the crypt-luks container. When I checked /ect/fstab I noticed that this was the last line;



/dev/mapper/cryptswap1 none swap sw 0 0


Does anyone know a safe way to remove this kind of swap partition?







share|improve this question
























    up vote
    1
    down vote

    favorite












    I installed Linux Mint 18.2, as LVM with LUKS encryption, onto a 128GB SSDD. I would like to remove the swap drive b/c I have 16GB of RAM on my machine and I want to try to preserve the drive as long as I can. When I started the disk and started Gparted to remove the swap partition I noticed that Gparted lists the drive as only two partitions /dev/sdb1 ~.5GB boot-sector (I think) and /dev/sdb2 the crypt-luks container. When I checked /ect/fstab I noticed that this was the last line;



    /dev/mapper/cryptswap1 none swap sw 0 0


    Does anyone know a safe way to remove this kind of swap partition?







    share|improve this question






















      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      I installed Linux Mint 18.2, as LVM with LUKS encryption, onto a 128GB SSDD. I would like to remove the swap drive b/c I have 16GB of RAM on my machine and I want to try to preserve the drive as long as I can. When I started the disk and started Gparted to remove the swap partition I noticed that Gparted lists the drive as only two partitions /dev/sdb1 ~.5GB boot-sector (I think) and /dev/sdb2 the crypt-luks container. When I checked /ect/fstab I noticed that this was the last line;



      /dev/mapper/cryptswap1 none swap sw 0 0


      Does anyone know a safe way to remove this kind of swap partition?







      share|improve this question












      I installed Linux Mint 18.2, as LVM with LUKS encryption, onto a 128GB SSDD. I would like to remove the swap drive b/c I have 16GB of RAM on my machine and I want to try to preserve the drive as long as I can. When I started the disk and started Gparted to remove the swap partition I noticed that Gparted lists the drive as only two partitions /dev/sdb1 ~.5GB boot-sector (I think) and /dev/sdb2 the crypt-luks container. When I checked /ect/fstab I noticed that this was the last line;



      /dev/mapper/cryptswap1 none swap sw 0 0


      Does anyone know a safe way to remove this kind of swap partition?









      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 10 '17 at 21:20









      James Draper

      1538




      1538




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          4
          down vote



          accepted










          There shouldn't be any problem disabling a swap partition of any sort. Once booted, you can disable the swap partition with:



          sudo swapoff -a


          And then place a swap partition on some other disk and enable that with:



          sudo swapon -U uuid-of-new-swap-partition.


          Once you verify that the new swap is working, you can remove the LVM swap partition on your LUKS drive... and reuse the space. LVM is awesome!



          To make the changes permanent, replace the swap partition listed in /etc/fstab with the new one using the same options as the prior swap... none swap sw 0 0



          LUKS specific instructions



          Apparently... There is a specific option with cryptmount for enabling and disabling swap.



          cryptmount --swapoff 


          and



          cryptmount --swapon


          It seems that cryptmount will perform the close operation in addition to disabling the swap partition.



          If you've disabled the swap with the regular system swapoff, you may need to disable the current swap partition (safe to do) to close the LUKS swap partition before you can remove it...



          cryptsetup -v luksClose /dev/mapper/cryptswap1





          share|improve this answer






















          • What should be done to make the changes permanent?
            – user001
            Nov 10 '17 at 21:42







          • 1




            @user001: added permanent change.
            – RubberStamp
            Nov 10 '17 at 21:48










          • So will the space from the swap drive automatically be reallocated to the main partition? Also do I need put the swap partition somewhere else I thought the it wasn't needed if I have enough RAM?
            – James Draper
            Nov 11 '17 at 3:37










          • @JamesDraper: Swap is not automatic. It needs to be setup with its own partition. You can place the swap partition on any available drive. Running without swap is not the best idea, but will probably work just fine for most systems. I have SSDs on some of my systems, and my drives have been working fine for years... However, if you'd rather wear out a USB stick instead, you could place the swap there
            – RubberStamp
            Nov 11 '17 at 3:50










          • Yeah well then I'll probably just leave the swap drive where it is then it's good know about this option though.
            – James Draper
            Nov 11 '17 at 3:54










          Your Answer







          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "106"
          ;
          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: false,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          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%2funix.stackexchange.com%2fquestions%2f403826%2fremoving-the-swap-partition-from-a-luks-encrypted-ssdd%23new-answer', 'question_page');

          );

          Post as a guest






























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          4
          down vote



          accepted










          There shouldn't be any problem disabling a swap partition of any sort. Once booted, you can disable the swap partition with:



          sudo swapoff -a


          And then place a swap partition on some other disk and enable that with:



          sudo swapon -U uuid-of-new-swap-partition.


          Once you verify that the new swap is working, you can remove the LVM swap partition on your LUKS drive... and reuse the space. LVM is awesome!



          To make the changes permanent, replace the swap partition listed in /etc/fstab with the new one using the same options as the prior swap... none swap sw 0 0



          LUKS specific instructions



          Apparently... There is a specific option with cryptmount for enabling and disabling swap.



          cryptmount --swapoff 


          and



          cryptmount --swapon


          It seems that cryptmount will perform the close operation in addition to disabling the swap partition.



          If you've disabled the swap with the regular system swapoff, you may need to disable the current swap partition (safe to do) to close the LUKS swap partition before you can remove it...



          cryptsetup -v luksClose /dev/mapper/cryptswap1





          share|improve this answer






















          • What should be done to make the changes permanent?
            – user001
            Nov 10 '17 at 21:42







          • 1




            @user001: added permanent change.
            – RubberStamp
            Nov 10 '17 at 21:48










          • So will the space from the swap drive automatically be reallocated to the main partition? Also do I need put the swap partition somewhere else I thought the it wasn't needed if I have enough RAM?
            – James Draper
            Nov 11 '17 at 3:37










          • @JamesDraper: Swap is not automatic. It needs to be setup with its own partition. You can place the swap partition on any available drive. Running without swap is not the best idea, but will probably work just fine for most systems. I have SSDs on some of my systems, and my drives have been working fine for years... However, if you'd rather wear out a USB stick instead, you could place the swap there
            – RubberStamp
            Nov 11 '17 at 3:50










          • Yeah well then I'll probably just leave the swap drive where it is then it's good know about this option though.
            – James Draper
            Nov 11 '17 at 3:54














          up vote
          4
          down vote



          accepted










          There shouldn't be any problem disabling a swap partition of any sort. Once booted, you can disable the swap partition with:



          sudo swapoff -a


          And then place a swap partition on some other disk and enable that with:



          sudo swapon -U uuid-of-new-swap-partition.


          Once you verify that the new swap is working, you can remove the LVM swap partition on your LUKS drive... and reuse the space. LVM is awesome!



          To make the changes permanent, replace the swap partition listed in /etc/fstab with the new one using the same options as the prior swap... none swap sw 0 0



          LUKS specific instructions



          Apparently... There is a specific option with cryptmount for enabling and disabling swap.



          cryptmount --swapoff 


          and



          cryptmount --swapon


          It seems that cryptmount will perform the close operation in addition to disabling the swap partition.



          If you've disabled the swap with the regular system swapoff, you may need to disable the current swap partition (safe to do) to close the LUKS swap partition before you can remove it...



          cryptsetup -v luksClose /dev/mapper/cryptswap1





          share|improve this answer






















          • What should be done to make the changes permanent?
            – user001
            Nov 10 '17 at 21:42







          • 1




            @user001: added permanent change.
            – RubberStamp
            Nov 10 '17 at 21:48










          • So will the space from the swap drive automatically be reallocated to the main partition? Also do I need put the swap partition somewhere else I thought the it wasn't needed if I have enough RAM?
            – James Draper
            Nov 11 '17 at 3:37










          • @JamesDraper: Swap is not automatic. It needs to be setup with its own partition. You can place the swap partition on any available drive. Running without swap is not the best idea, but will probably work just fine for most systems. I have SSDs on some of my systems, and my drives have been working fine for years... However, if you'd rather wear out a USB stick instead, you could place the swap there
            – RubberStamp
            Nov 11 '17 at 3:50










          • Yeah well then I'll probably just leave the swap drive where it is then it's good know about this option though.
            – James Draper
            Nov 11 '17 at 3:54












          up vote
          4
          down vote



          accepted







          up vote
          4
          down vote



          accepted






          There shouldn't be any problem disabling a swap partition of any sort. Once booted, you can disable the swap partition with:



          sudo swapoff -a


          And then place a swap partition on some other disk and enable that with:



          sudo swapon -U uuid-of-new-swap-partition.


          Once you verify that the new swap is working, you can remove the LVM swap partition on your LUKS drive... and reuse the space. LVM is awesome!



          To make the changes permanent, replace the swap partition listed in /etc/fstab with the new one using the same options as the prior swap... none swap sw 0 0



          LUKS specific instructions



          Apparently... There is a specific option with cryptmount for enabling and disabling swap.



          cryptmount --swapoff 


          and



          cryptmount --swapon


          It seems that cryptmount will perform the close operation in addition to disabling the swap partition.



          If you've disabled the swap with the regular system swapoff, you may need to disable the current swap partition (safe to do) to close the LUKS swap partition before you can remove it...



          cryptsetup -v luksClose /dev/mapper/cryptswap1





          share|improve this answer














          There shouldn't be any problem disabling a swap partition of any sort. Once booted, you can disable the swap partition with:



          sudo swapoff -a


          And then place a swap partition on some other disk and enable that with:



          sudo swapon -U uuid-of-new-swap-partition.


          Once you verify that the new swap is working, you can remove the LVM swap partition on your LUKS drive... and reuse the space. LVM is awesome!



          To make the changes permanent, replace the swap partition listed in /etc/fstab with the new one using the same options as the prior swap... none swap sw 0 0



          LUKS specific instructions



          Apparently... There is a specific option with cryptmount for enabling and disabling swap.



          cryptmount --swapoff 


          and



          cryptmount --swapon


          It seems that cryptmount will perform the close operation in addition to disabling the swap partition.



          If you've disabled the swap with the regular system swapoff, you may need to disable the current swap partition (safe to do) to close the LUKS swap partition before you can remove it...



          cryptsetup -v luksClose /dev/mapper/cryptswap1






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Nov 10 '17 at 22:55

























          answered Nov 10 '17 at 21:39









          RubberStamp

          1,4551216




          1,4551216











          • What should be done to make the changes permanent?
            – user001
            Nov 10 '17 at 21:42







          • 1




            @user001: added permanent change.
            – RubberStamp
            Nov 10 '17 at 21:48










          • So will the space from the swap drive automatically be reallocated to the main partition? Also do I need put the swap partition somewhere else I thought the it wasn't needed if I have enough RAM?
            – James Draper
            Nov 11 '17 at 3:37










          • @JamesDraper: Swap is not automatic. It needs to be setup with its own partition. You can place the swap partition on any available drive. Running without swap is not the best idea, but will probably work just fine for most systems. I have SSDs on some of my systems, and my drives have been working fine for years... However, if you'd rather wear out a USB stick instead, you could place the swap there
            – RubberStamp
            Nov 11 '17 at 3:50










          • Yeah well then I'll probably just leave the swap drive where it is then it's good know about this option though.
            – James Draper
            Nov 11 '17 at 3:54
















          • What should be done to make the changes permanent?
            – user001
            Nov 10 '17 at 21:42







          • 1




            @user001: added permanent change.
            – RubberStamp
            Nov 10 '17 at 21:48










          • So will the space from the swap drive automatically be reallocated to the main partition? Also do I need put the swap partition somewhere else I thought the it wasn't needed if I have enough RAM?
            – James Draper
            Nov 11 '17 at 3:37










          • @JamesDraper: Swap is not automatic. It needs to be setup with its own partition. You can place the swap partition on any available drive. Running without swap is not the best idea, but will probably work just fine for most systems. I have SSDs on some of my systems, and my drives have been working fine for years... However, if you'd rather wear out a USB stick instead, you could place the swap there
            – RubberStamp
            Nov 11 '17 at 3:50










          • Yeah well then I'll probably just leave the swap drive where it is then it's good know about this option though.
            – James Draper
            Nov 11 '17 at 3:54















          What should be done to make the changes permanent?
          – user001
          Nov 10 '17 at 21:42





          What should be done to make the changes permanent?
          – user001
          Nov 10 '17 at 21:42





          1




          1




          @user001: added permanent change.
          – RubberStamp
          Nov 10 '17 at 21:48




          @user001: added permanent change.
          – RubberStamp
          Nov 10 '17 at 21:48












          So will the space from the swap drive automatically be reallocated to the main partition? Also do I need put the swap partition somewhere else I thought the it wasn't needed if I have enough RAM?
          – James Draper
          Nov 11 '17 at 3:37




          So will the space from the swap drive automatically be reallocated to the main partition? Also do I need put the swap partition somewhere else I thought the it wasn't needed if I have enough RAM?
          – James Draper
          Nov 11 '17 at 3:37












          @JamesDraper: Swap is not automatic. It needs to be setup with its own partition. You can place the swap partition on any available drive. Running without swap is not the best idea, but will probably work just fine for most systems. I have SSDs on some of my systems, and my drives have been working fine for years... However, if you'd rather wear out a USB stick instead, you could place the swap there
          – RubberStamp
          Nov 11 '17 at 3:50




          @JamesDraper: Swap is not automatic. It needs to be setup with its own partition. You can place the swap partition on any available drive. Running without swap is not the best idea, but will probably work just fine for most systems. I have SSDs on some of my systems, and my drives have been working fine for years... However, if you'd rather wear out a USB stick instead, you could place the swap there
          – RubberStamp
          Nov 11 '17 at 3:50












          Yeah well then I'll probably just leave the swap drive where it is then it's good know about this option though.
          – James Draper
          Nov 11 '17 at 3:54




          Yeah well then I'll probably just leave the swap drive where it is then it's good know about this option though.
          – James Draper
          Nov 11 '17 at 3:54

















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f403826%2fremoving-the-swap-partition-from-a-luks-encrypted-ssdd%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

          How to check contact read email or not when send email to Individual?

          Bahrain

          Postfix configuration issue with fips on centos 7; mailgun relay