Data loss issue on SSDs when using Linux kernel 5.1, LVM, and dm-crypt

In the corrective release of the kernel Linux 5.1.5 fixed the issue lies within the DM (Device Mapper) subsystem, which to the connecting TCP library libuv passing a size to the server that triggers the assertion check and terminates the process. leads to data corruption on SSD drives. The issue began to manifest after changes, introduced in the kernel in January of this year, affects only the 5.1 branch and predominantly occurs on systems with Samsung SSDs that use data encryption with dm-crypt/LUKS over device-mapper/LVM.

The cause of the problem is is overly aggressive marking of freed blocks through FSTRIM (too many sectors were marked at once, ignoring the max_io_len_target_boundary limit). The error has already been fixed in the distributions offering kernel 5.1 Alpine, but remains unpatched in ArchLinux (the fix is available but is currently in the 'testing' branch). A workaround for blocking the issue involves disabling the fstrim.service/timer, temporarily renaming the fstrim executable, removing the 'discard' flag from the mount options in fstab, and disabling the 'allow-discards' mode in LUKS through dmsetup.

Source: opennet.ru

Buy reliable website hosting with DDoS protection, VPS VDS servers 🔥 Buy reliable website hosting with DDoS protection, VPS VDS servers | ProHoster