Tweaking Your Fedora Installation For Maximum Productivity & Features

Written by Eric Griffith in Operating Systems on 16 June 2015 at 09:40 AM EDT. Page 3 of 3. 29 Comments.

Thermal Daemon (Thermald)
Another important point for mobile users is thermal control and ensuring that their laptop does not overheat or otherwise get too hot for the hardware to reliably handle. Intel has another project out of 01.org for handling just that: Thermald, or Thermal Daemon. Thermald is unfortunately not available by default in Fedora or RPMFusion, though this author is trying to get it into the main repositories. Since it is not available its necessary to compile the code ourselves from the project's GitHub page ( https://github.com/01org/thermal_daemon )

Begin with ensuring you have all of the necessary tools on your system for compiling software:

sudo dnf groupinstall "Development Tools" "C Development Tools and Libraries"

After that, Thermald has a few explicit dependencies you need to install:

sudo dnf install automake gcc gcc-c++ glib-devel dbus-glib-devel libxml2-devel

Next we need to get the sources for Thermald, this is achieved by creating a folder to hold the sources and downloading them through git.

This author prefers to hold all third-party source code in a folder called "Sources" in his home directory. If you don't have a different preferred location simply follow my listed commands, if you do have a different preferred location then adapt my listed commands as necessary.

mkdir ~/Sources
cd ~/Sources
git clone https://github.com/01org/thermal_daemon.git
cd thermal_daemon
./autogen.sh
./configure prefix=/usr
make
sudo make install

With thermald installed the only thing you have left to do is enable it by default on boot:

sudo systemctl enable thermald
sudo systemctl start thermald

No configuration is necessary, thermald runs by default in zero configuration mode.

Zswap
Depending on your amount of available memory this next step may or may not be necessary. For quite a few Kernel releases now the Linux Kernel has offered the "Zswap" kernel module. From its Wikipedia page: "Zswap is a Linux kernel feature providing a compressed write-back cache for swapped pages. Instead of moving memory pages to a swap device when they are to be swapped out, zswap performs their compression and then stores them into a memory pool dynamically allocated inside system's RAM."

Basically, instead of pushing the pages to disk-- which is slow-- it merely compresses them and stores them back in RAM. While this does use more CPU it may be a power usage net benefit since compression typically takes less power than spinning up and writing to a disk.

To enable Zswap you need to edit your GRUB configuration. Editing the GRUB configuration is done through /etc/default/grub. Unfortunately the easiest way to edit these files is through the command line interface. To edit /etc/default/grub we are going to use nano, as such you need to run the command:

sudo nano /etc/default/grub

Use the arrow keys to travel down to the line that begins "GRUB_CMDLINE_LINUX=, move inside of the quotes and at the very beginning of the line add the text "zswap.enabled=1". For example, before editing the line mine said:

GRUB_CMDLINE_LINUX="rd.luks.uuid=luks-3f5380e2-72bf-483c-989b-4ae38bd88820 rd.luks.uuid=luks-cd446ddb-6d85-4b5a-b108-ef8ea83ff8e5 rhgb quiet"

and afterwards it changed to

GRUB_CMDLINE_LINUX="zswap.enabled=1 rd.luks.uuid=luks-3f5380e2-72bf-483c-989b-4ae38bd88820 rd.luks.uuid=luks-cd446ddb-6d85-4b5a-b108-ef8ea83ff8e5 rhgb quiet"

Exit nano with ctrl+x, when it asks you about saving hit "y".

Just editing the file is not enough however, you also need to recreate the grub boot description, now that you've changed the config. For BIOS systems the command is:

sudo grub2-mkconfig -o /boot/grub2/grub.cfg

for UEFI systems the command is

sudo grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg

No matter whether you are on a legacy BIOS system or an UEFI system you then need to reboot for the change to take affect.

TRIM Support
TRIM support allows for increased performance, and wear-leveling of their SSD's, and is generally recommended to be enabled. Due to possible performance problems during TRIM operations, and certain SSD's not liking to be mounted with the 'discard' flag, the general rule is you want to enable TRIM to be run periodically. While you can do this by creating a cron-job yourself that runs 'fstrim -a' every day / week / month, it's easier to use the timer and service job that Fedora supplies on its own. To enable this timer you need to activate it via

sudo systemctl enable fstrim.timer
sudo systemctl start fstrim.timer

After enabling it, fstrim will run TRIM on every connected device that supports it once a week.

If you are a user who runs with an encrypted partition setup, and you should be for mobile systems, then there is an additional two steps you have to go through. Warning: Enabling TRIM support could theoretically reduce the security of your encryption. Part of encryption is security through obscurity and having an accurate TRIM read-out would tell physical attackers which parts of the drive contain legitimate data and which parts do not. If you are actively concerned about the safety of your data from government agencies and other well funded, well-informed attackers you should not enable TRIM support on encrypted systems.

The first step you need to do is tell cryttab to allow TRIM commands to be passed down to the disk through LUKS, this is not allowed by default due to the above warning. To edit crypttab you need to run the command:

sudo nano /etc/crypttab

Use the arrow keys to navigate to the end of each line. Insert a single space after "none" and add the word "discard". You need to "discard" to the end of each and every line.

Exit nano with ctrl+x, when it asks you about saving hit "y".

The second step is to update your initramfs to include the newly modified crypttab. Updating your initramfs is a one line command:

sudo dracut -f

After that you should reboot. You can test to see whether TRIM is working by calling the command-line

sudo fstrim -v /

If it works it will give you an amount of blocks that were trimmed. If it doesn't it will probably say "the discard operation is not supported", in which case you likely did something wrong or did not reboot.

Hopefully you found these Fedora post-installation tips helpful for maximizing the usability of your Fedora desktop. If you have any other tips or recommendations feel free to share them with us and the community by commenting on this article in the Phoronix Forums. Thanks!

If you enjoyed this article consider joining Phoronix Premium to view this site ad-free, multi-page articles on a single page, and other benefits. PayPal or Stripe tips are also graciously accepted. Thanks for your support.


Related Articles