Mac Linux Post-Install Configuration Revisited

Since the last post in the Mac Linux series a variety of improvements have made Linux installation and use on Macs easier than ever.

 

Ubuntu 16.04 with Budgie Desktop running on 2013 MacBook Air

Mac Linux Updates

Since my first article on this topic, recent Linux versions make it easier than ever to install and use.  This is especially relevant to Mac and notebook users. This article describes new settings to fine-tune Linux running on notebook computers.  It’s split into these topics:

  • New Notebooks settings
  • Create Linux Install Media Easily
  • Easier WiFi driver install
  • Discover and install third party hardware drivers

New settings for Mac Linux Notebooks:

The settings described below are recommended in addition to the settings in the original post.  I personally use these settings on Ubuntu 16.04 and 17.04.

Reduce SSD wear and increase lifespan

Overview

The number of write-cycles, or “Program/Erase cycles”, impacts the lifespan of an SSD.  Since the Linux access-time attribute substantially increases PE cycles, it’s recommended that it’s disabled for Linux SSD’s. This is especially important for expensive and/or difficult to replace SSDs, such as the SSDs in Mac notebooks.

Technical Details: Linux manages an access-time attribute for each file, which tracks the last access to the file. Storing new attribute values requires writing them to disk, which substantially increases the number of writes (PE cycles).  Although the lifetime of an SSD in PE cycles is very high, unless there’s a specific need to monitor file-level access-times, disabling this attribute for an SSD can dramatically improve its lifespan.

Change this Setting

For Experienced Users – if you change this incorrectly, it can prevent linux from booting.

Add a parameter to alter the way Linux mounts the drive.  The commands backup the file and open it in a text editor:

sudo cp /etc/fstab /etc/fstab.bak
sudo nano /etc/fstab
  • In the editor, find the line where it mounts “/” (your main linux drive).
    • on that line, find the mount parameters – their default value is: errors=remount-ro.
    • prepend noatime, before the existing attributes – so the parameters become something like: noatime,errors=remount-ro.
  • Exit & save by typing control-x, click y (for yes), then press return (to save with the same filename).
  • This setting takes effect after a reboot.

Improve WiFi speed & lower latency

Overview

On notebooks, many distributions come with WiFi power-saving enabled by default.  This can substantially impact the performance of your WiFi connection, even when connected to AC Power.  Fortunately, the instructions below disable it.

Technical Details:  The WiFi power-saving setting is always applied, even when connected to AC power.  Inbound WiFi traffic measurements with WiFi power-saving enabled:

  • packet-loss on inbound connections of 25-75%
  • per ping latency on inbound connections of 1 – 4 seconds.
  • inbound SSH is extremely slow, latent, lossy and virtually unusable.
  • outbound connections saw minimal impact, with a latency increasing from 25ms to 80ms, but no packet loss.
Change this Setting

Use this command to open the configuration file in a text editor:

sudo nano /etc/NetworkManager/conf.d/default-wifi-powersave-on.conf
  • In the editor, use the cursors to move to the line “wifi.powersave = 3”.
  • Change the 3 to a 2 – so the entry becomes “wifi.powersave = 2”.
    • Note, this is NOT binary – the value of “2” is necessary.
    • Do not set to “0” as that means “use default”, or the same as setting to 3.
  • Exit & save by typing control-x, click y (for yes), then press return (to save with the same filename).
  • This setting takes effect as soon as the file is saved.

Easier Installation:

Easily Create bootable USB drives from an installation image

The process of creating a bootable USB drive has seemed complicated as a result of a consistent process across all OS.  This has resulted in a multitude of tutorials on the topic, with each using their favored approach and utility for each OS. Fortunately, a new cross-platform utility has finally enabled a unified process for this. I’ve written a post on this stylish and free utility – Etcher.

Easier WiFi driver Installation for Internet connectivity

Previous Linux Distribution installation-images did not include drivers for common Mac WiFi modules.  So, a typical Mac Linux install often resulted in an install without internet connectivity.  A common workaround is using a USB WiFi or USB Ethernet adapter during the installation or post-installation process.

Linux Install WiFi Selection

Now, many Linux versions include compatible drivers for Mac WiFi modules.  This enables internet connectivity during and after setup.  Even better, you can verify if a particular image contains a compatible WiFi driver before performing the installation – simply check that it allows selection of an access point (example photo on right).

This can be verified via two methods:

  • Boot the Linux Installation Media and select “Live Mode” from the boot menu.  It’s sometimes titled ‘try distro’.  When it has finished loading, see if you can select an access point .
  • Alternatively, start the Linux Install process and watch for an opportunity to specify an access point. This is usually possible after language selection.

Enable Installation of Proprietary Drivers

Third party driver support for Linux continues to improve, continually making Mac Linux easier.  Furthermore, it’s easy to discover and install these drivers.  To enable automatic detection of third party drivers, follow this process:

  • Launch the utility that specifies the sources for OS updates.
    • On Ubuntu, this is titled “Software and Updates”.
  • On the initial tab displayed, enable the selection for “Proprietary Drivers for devices (restricted)”.
    • This is highlighted in red in the photo below.

Ubuntu Enable Device Drivers

  • Finally, select the “Additional Drivers” tab.
    • In addition to listing any third party drivers available for your system, it shows if they are in use.
    • The third party drivers available for 2013 Macbook Air are shown in the photo below.

Ubuntu Hardware Drivers

SHARE THIS

LinkedIn
Facebook
Google+
Twitter

Leave a Reply

Follow Me
Recent Posts
How to Install Terraform in One Easy Step
How to Run your Docker Solution as a Service
InfoSec’s Achilles’ Heel: Physical Security
Easily Create Bootable USB Devices on any OS
@RobertPeteuil Tweets