Removing the swap partition from a LUKS encrypted SSDD
Clash 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?
linux-mint partition swap luks gparted
add a comment |Â
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?
linux-mint partition swap luks gparted
add a comment |Â
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?
linux-mint partition swap luks gparted
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?
linux-mint partition swap luks gparted
asked Nov 10 '17 at 21:20
James Draper
1538
1538
add a comment |Â
add a comment |Â
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
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
add a comment |Â
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
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
add a comment |Â
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
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
add a comment |Â
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
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
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
add a comment |Â
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
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password