New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
fstrim second SSD on Ubuntu?
I am on Ubuntu 18.04, installed to SSD1. I then plugged in a LUKS encrypted SSD (SSD2).
fstrim -v / works and trims SSD1, but I cannot fstrim SSD2, regardless of where I mount it (either /media/username/ssd2/, or manually with "cryptsetup open /dev/sda1 ssd2" and "mount /dev/mapper/ssd2 /mnt").
fstrim: /media/username/ssd2/: the discard operation is not supported
What am I doing wrong? Thank you.
edit: I previously used SSD2 as main SSD mounted at / and had no issues with fstrim.
Comments
Because your SSD is encrypted you need to do special steps, likely, to get fstrim to work.
Here is something I found via a simple google search: https://blog.christophersmart.com/2016/05/12/trim-on-lvm-on-luks-on-ssd-revisited/
Though, I am not sure if it is relevant to your setup.
Me neither. I wonder if it applies in my case where the SSD is mounted like an external hard drive? (although connected via SATA) Is there a way to "integrate" it a little more into the system so that it mounts at boot maybe?
I mounted my SSD at boot like this https://blog.tinned-software.net/automount-a-luks-encrypted-volume-on-system-start/ with discard enabled. Now it works.
Thanks for your help
Just as an FYI - if you manually mount it via
cryptsetup luksOpen ...
just remember to use theallow-discards
option which will allow fstrim to work on the mount.