I'm running Debian 9 that I've installed on a single 256gb SSD. It was setup with LVM and encryption - 30gb /root, 157gb /home and 68gb/sawp.
I have a fair amount of ram (64gb) and never seen the swap partition even get used, would it be safe to reduce the swap partition to 2gb?
Normally I just use gparted live if i need to change something on any partition but I never used LVM or encryption before can i still use it or there is a better method?
If I would add another SSD is it possible with LVM extending my /home partition to it?
Thanks
Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230
Running low on storage
Re: Running low on storage
Your swap is definately too large for any purpose. You'd absolutely do well with less.
There are different opinions on optimal swap size. Here are some considerations to help you determine the best amount for your case. Generally, I've used same amount of space than my RAM, up to 4Gb. I don't have experience of that much RAM in one system so someone else could probably give you better recommendation than me. I still find even 32GB (50-50 rule) way too much, though it would be good to know an example of two about your use case.
EDIT: Misread your RAM amount.
There are different opinions on optimal swap size. Here are some considerations to help you determine the best amount for your case. Generally, I've used same amount of space than my RAM, up to 4Gb. I don't have experience of that much RAM in one system so someone else could probably give you better recommendation than me. I still find even 32GB (50-50 rule) way too much, though it would be good to know an example of two about your use case.
EDIT: Misread your RAM amount.
Debian 10.2 Stable with i3
Secure your stuff: Securing Debian Manual
Don't break your stuff: Source List Management DontBreakDebian
Secure your stuff: Securing Debian Manual
Don't break your stuff: Source List Management DontBreakDebian
Re: Running low on storage
Thanks, I've successfully managed to add another ssd to my LVM volume with the help of Logical Volume Management gui, unfortunately it doesn't allow me to reduce my swap space and i forgot to encrypt the second ssd before adding it to the volume But at least I got a nice "big" /home partition.
-
- Global Moderator
- Posts: 3049
- Joined: 2017-09-17 07:12
- Has thanked: 5 times
- Been thanked: 132 times
Re: Running low on storage
Except for hibernation (suspend to disk). It is recommended to have at least as much swap space as RAM.kopper wrote:Your swap is definately too large for any purpose.
If you do not use hibernation, you can just remove the swap. Linux works fine without any swap.
I do not think that gparted handles LVM nor encryption. You'll have to use the command line. The good news is that LVM allows to do most resizing online, so no need for a live system.marco26 wrote:Normally I just use gparted live if i need to change something on any partition but I never used LVM or encryption before can i still use it or there is a better method?
You'll find real logical volume names and UUIDs in /etc/fstab.
Disable all swaps
Code: Select all
swapoff -a
Code: Select all
lvremove /dev/mapper/vgname-swaplvname
Or if you prefer to reduce it to 2 GiB and reformat it
Code: Select all
lvresize -L 2G /dev/mapper/vgname-swaplvname
mkswap -U swap_uuid /dev/mapper/vgname-swaplvname
Extend the home logical volume by 30 GiB and its filesystem (assuming it is ext4)
Code: Select all
lvextend -L +30G /dev/mapper/vgname-homelvname
resize2fs /dev/mapper/vgname-homelvname
Yes. But if one drive fails, you lose all data in /home.marco26 wrote:If I would add another SSD is it possible with LVM extending my /home partition to it?
Create a partition using you favourite partition tool.
Then create an encrypted volume on top of it (adapt with the real partition name and add any desired options)
Code: Select all
cryptsetup luksCreate /dev/sdb2 lvm2_crypt
Rebuild the initramfs
Code: Select all
update-initramfs -u
Format the encrypted volume as a LVM physical volume
Code: Select all
pvcreate /dev/mapper/lvm2_crypt
Code: Select all
vgextend vgname /dev/sdb1
Edit (wrote all the above before seeing your last post)
You must disable the swap first (see above).marco26 wrote:it doesn't allow me to reduce my swap space
You realize that some of the data in /home will not be encrypted, so the encryption is useless ?marco26 wrote:i forgot to encrypt the second ssd before adding it to the volume
- stevepusser
- Posts: 12930
- Joined: 2009-10-06 05:53
- Has thanked: 41 times
- Been thanked: 71 times
Re: Running low on storage
Swap space for hibernation does not have to be any bigger than the memory being used at the time of hibernation, and in fact can be considerably less if the hiber-file is compressed, which I believe is the default. I've always used a swap partition smaller than RAM. On a couple occasions where it was still too big to fit, the process went through it a second time and must have trimmed off some excess cache or something, because it then succeeded.
MX Linux packager and developer
Re: Running low on storage
Hibernation File Compression requires additional functionality ('user space software suspend').stevepusser wrote:..... if the hiber-file is compressed, which I believe is the default.
The package uswsusp is available in the Stretch repositories.
@OP: While 64GB of memory surely are entertaining to look at when monitoring system performance, I very much doubt your machine will ever use more than 8GB, if that.
Even heavy-duty video rendering doesn't require more than 32GB of memory.
So you will be perfectly fine with 16GB of swap (probably 8GB would do as well).
The rule of thumb of having swap space equalling your system memory is a remnant of times when personal machines were equipped with memory sizes of 256MB or 512MB.
Modern laptops and PCs don't make use of swap at all, except in very rare circumstances ... and for hibernation, of course.
On another note:
Have you considered using a swap file? You can install that on /home (or any other partition), and it is considerably easier to resize, should you need to extend or wish to shrink your available swap.
Have a look at this contribution in the Debian Wiki.
Cheers,
Gaius
If you can’t explain it simply, you don’t understand it well enough.
Albert Einstein
Albert Einstein
Re: Running low on storage
Okay, you've convinced me you really need those 64GB of RAM.marco26 wrote:Sorry man, but you're really far off the mark with those assumptions.
... in addition, four populated memory slots look way cooler in the Window-Kit case, especially in combination with multiple RGB fans and strips, right?
If you can’t explain it simply, you don’t understand it well enough.
Albert Einstein
Albert Einstein