More Specific Fedora Configuration and My Notes

Some tips and hardware specific problems are mentioned here.

August 15, 2018
August 16, 2018

Generic Tweaks

This section applies to any PC.

Enable SSD Over-Provisioning

Note: Even though this note specifically mentions Samsung SSDs, the information here may apply to most other SSDs on the market.

What is SSD over-provisioning? I was provided with a simple explanation of what over-provisioning is from Samsung tech support e-mail: Simply make 10% of the drive space unallocated using a partition tool. This is only made to insure that the user does not accidentally fill up the drive by mistake.

For more specific information, read on.

In Samsung Magician software on Windows, there's an option to assign some space for over-provisioning. Over-provisioning is said to enhance drive's performance and longevity.

Windows version of Samsung Magician shrinks the last partition, leaving some unpartitioned space. It then displays the unpartitioned space as space reserved for over-provisioning. In fact, Samsung recommends to manually shrink the (last?) partition on the drive and leave some free unallocated space to enable over-provisioning if Samsung Magician fails (Samsung FAQ).

So if it's a good idea to keep some free unallocated space when formatting SSD under Windows, should I do the same on Fedora? The simple answer is: No. Leaving free unpartitioned space on the SSD may have little to no effect on over-provisioning or drive performance, based on the particular SSD.

Because of how current SSDs work, their controller needs to have some empty space available. Manufacturers usually leave at least 7% of the drive's capacity inaccessible to the computer. This unused capacity is called over-provisioning. Why seven percent? It's the difference between real memory size, which is in GiB, and advertised drive size, which is in GB. Sometimes there is more memory dedicated for over-provisioning. For example, 240GB drive may in fact be 256GB large, resulting in 16GB extra memory for over-provisioning.

This manufacturer-assigned over-provisioning space is sufficient in most cases. However, under heavy workloads, this still may not be enough. So here comes the dynamic over-provisioning. Dynamic over-provisioning means that the controller uses free (unused) space on user-accessible portions of the memory in a similar way that it uses the factory-set hidden over-provisioned space.

For more info, visit great explanation on Seagate website.

In conclusion, the more free space the SSD controller has available, the better. There are multiple ways of making sure that not all of the user accessible memory gets filled with data. What Samsung Magician on Windows does, is shrinking data partition and leaving some space unallocated (unused). Samsung Magician DC for Linux increases reserved area on EXT4 partitions instead of enlarging unpartitioned space (at least to my knowledge, Magician DC does not work with consumer drives anymore; I've just verified that current Magician DC User Guide on page 26 tells the same thing and recommends 10% over-provisioning, max 50%).

However, there's a catch. The SSD controller must know that the assigned unused space is free and unused. How does the controller know what memory pages are free and which pages contain data? Modern SSDs run garbage collection algorithms and "guess" which parts of memory are being used for data and what is free for controller's needs. However, there's a simpler and more effective approach. It's the ATA TRIM command. By using TRIM, the operating system basically tells the SSD controller which part of file system doesn't contain any data, and the drive controller then knows which particular memory pages are not being used by the file system.

Leaving free unpartitioned space on Windows might make sense beacuse Windows seems to TRIM that empty space. Linux, however, doesn't trim unallocated space automatically. On Linux, you must explicitly trim the reserved free space, otherwise the controller just assumes that it may contain user data and doesn't use the space for its internal operations. You would just be wasting your storage space with no gain (well, the drive's controller may still be able to guess that the data is not being used). The easiest way to TRIM free space on Linux is running fstrim command. This, however, trims only mounted formatted partitions and not unallocated non-partition space. Thus it might make more sense to enlarge file system's reserved area (as Magician DC does) with tune2fs -m 5 /dev/DRIVE (this sets 5%, which is usually the default value) and running fstrim on that file system.

Laptop-Specific Tweaks

These notes usually mention laptop-specific issues. Some configuration may also be used on non-laptop PCs.

Intel HD3000 Optimus Laptop

If you happen to have a 2011 laptop with Intel HD graphics, you may see multiple mouse cursors and strange graphics. To solve this, disable secondary bogus (non-existent) monitor. It can be done either in GNOME or globally with video=VGA-2:d GRUB parameter.

Note: On fully updated Fedora 28 running on Wayland this doesn't seem to be a problem anymore. Disabling nouveau may also solve the problem.

Disable Built-in Display on Samsung RF511 Laptop

To run only on external monitor, disable the laptop's display before booting into Fedora. Pass video=LVDS-1:d as a linuxefi line Grub parameter.

Disable nouveau Module Before Booting

When I installed Fedora 28 on my laptop, graphics was freezing frequently. Completely disabling nouveau solved the problem.

To disable a kernel module in Grub, use MODULE.blacklist=yes or modprobe.blacklist=MODULE on Linux line in Grub. In my case, running modprobe.blacklist=nouveau Solved the problem.

Note: The nouveau problem dissapeared after few weeks, maybe it was fixed.

Disable Fedora 28 AHCI Power Control for SATA Devices

Pass this parameter to the kernel boot command line in Grub: ahci.mobile_lpm_policy=0

Disable suspend on lid close

To stop your laptop go into sleep mode every time you close the lid, you can add HandleLidSwitch=ignore in /etc/systemd/logind.conf and reboot. You may need to change gnome-tweak-tool's option too.