Search

Thursday, February 27, 2020

OpenVMS System Disk Full?

DUA0 full? Audit log grows without limit, Operator logs keep eating away space as well.

Do this:

$ SET AUDIT/SERVER=NEW_LOG
$ REPLY/ENABLE/TEMP
$ REPLY/LOG
$ PURGE DUA0:[000000...]*.*

That's it. End of this post.

Monday, February 17, 2020

Install and Dual-Boot Linux on 17 inch MacBook Pro - Ubuntu MATE 18.04.3 LTS (Bionic) with Trackpad gestures, APFS File System support, MacBook Fan Speed Control and more


Supratim Sanyal's Blog: Ubuntu MATE Linux on 17" Apple MacBook Pro A1297 Late 2011 Intel Core i7 2.4 GHz 16 GB RAM 1 TB SSD
Ubuntu MATE on 17" Apple MacBook Pro A1297


In this post:
  • Recommended Additional Hardware Items
  • Booting Ubuntu MATE Linux on MacBook Pro from USB
  • Configuring Trackpad Gestures
    • White Screen on Rebooting after installing Linux
  • MacBook Pro Linux Fan Speed Control
  • Mount Mac OS X APFS File System on Linux for MacBook Pro
  • Notes on taking image backup and restoring dual-boot Mac OS X and Ubuntu storage:
    • Zeroing out free space for better disk image compression (smaller backup size)
      • Zero Out Free Space on MacOS X APFS and Unused Disk Partitions
      • Zero Out Free Space on Linux ext4 Disk Partitions
    • Taking Clonezilla Live Disk Image Backup
    • Restoring from Clonezilla Live Disk Image Backup
    • What to do if the EFI boot table is corrupted resulting in unbootable system

My old faithful MacBook Pro 17" model 8,3 (A1297) with Intel Core i7 4-core 2.4 GHz processor and recently-upgraded 16 GB RAM and 1 TB SSD storage continues to perform spectacularly with OS X High Sierra.

Supratim Sanyal's Late 2011 17" MacBook Pro - Late 2011 17" - MD311LL/A - MacBookPro8,3 - A1297 - 2564


However, long curious about Linux on MacBook Pro, I re-partitioned the SSD and installed Ubuntu MATE 18.04.4 LTS (Bionic Beaver) in a dual-boot configuration with rEFInd as boot-manager. The basic steps of installing Linux alongside Mac OS X are discussed with great detail in numerous posts in the world-wide web. Instead of repeating all of that, this post attempts to consolidate some notes and actual terminal sessions I captured during getting the Trackpad, backlit keyboard lights and fan speed control to work, and backup and restoration of the dual-boot disk image.

No information in this post is new or original; I followed the path laid by others who have lent significant time and effort to get all this working. My goal is to simply consolidate all the information I found useful in one place so that I do not have to go searching again if I have to ever re-do these.

While at it, I grabbed an OS X Catalina wallpaper for the Ubuntu MATE desktop, as you can see in the first screenshot at the top.

Recommended Additional Hardware Items


I used the following two items of hardware for the installation. Most people who want to install Linux everywhere are likely to already have these lying around.

1) You will need to connect to the internet when installing Linux on your MacBook Pro to fetch proprietary drivers and updates. The built-in MacBook Pro wifi adapter will not work without the proprietary drive that is available online. To get out of this catch-22 situation, either plug in a physical Ethernet network cable (yes, the A1297 has a gigabit RJ-45 Ethernet port and three USB 2.0 ports among its many ports and connectors, and a Superdrive dual-layer DVD writer too for that matter), or do what I did - get a cheap USB wifi adapter with Realtek chipset that Linux is very comfortable with. These are easily found for under $10 at Amazon.

2) You will need a USB mouse till you get trackpad gestures to work (instructions below). I used a cheap USB wireless / cordless mouse that was lying around.

All three USB ports taken: wifi adapter with Realtek chipset, USB dongle of chordless mouse and Linux boot USB stick
All three USB ports taken: mini USB wifi adapter with Realtek chipset, cordless USB mouse dongle and Linux boot USB stick


Booting Ubuntu MATE Linux on 17" MacBook Pro from USB


I partitioned the 1 TB SSD into three partitions:
  1. 250 GB for MacOS X APFS
  2. 250 GB for Linux ext4 (Ubuntu Mate 18.04)
  3. 500 GB Unused space formatted as exFAT file system

Here is what my SSD partitions look like.


Dual Boot MacBook Pro Disk Partitions - MacOS X and Linux


After you have partitioned the storage and installed rEFInd, boot from your newly etched Ubuntu MATE bootable USB stick and choose "Install Ubuntu MATE".  After a brief but sinister-looking period of white screen (be patient), the usual Linux bootup text will start scrolling by.

Then it will get stuck.

Power-cycle and start again, but this time use grub to edit the kernel parameters in the boot command line to add the three parameters:

noapic noacpi nomodeset



Press F10 to boot with the above Kernel boot parameters, and you will boot successfully right into the Ubuntu MATE installer. Happy installing!


Supratim Sanyal's Blog: Installing Ubuntu MATE Linux on 2011 17" MacBook Pro 1297 Late 2011 17" - MD311LL/A - MacBookPro8,3 - A1297 - 2564



Configuring Trackpad Gestures


Thanks to Thanh Tran's "Making the best of MacBook Air touchpad on Ubuntu: A guide to mtrack driver and make use of the multi-touch touchpad on Linux", I am able to use trackpad gestures to operate the MATE user interface. Tap-to-select, two-finger right-click and scroll, three-finger move/resize and all the basic gestures work with the mtrack software. Advanced gestures also work with additional xbindkeys and xdotool configurations, and the dispad tool helps with accidental taps on the trackpad while typing on the keyboard. Here is the full list of supported MacBook Pro trackpad gestures on Ubuntu Linux from Tran's post:
  • Left mouse click with one finger tap; right mouse with two fingers tap; middle mouse with three fingers tap
  • Scroll with two fingers (both horizontal & vertical)
  • Drag with three fingers
  • Swipe left and right with 4 fingers will simulate mouse button number 9 & 8. This means I can navigate back and forth in browsers and many applications
  • 4 finger swipe up: switch to next workspace
  • 4 finger swipe down: switch to previous workspace
  • While holding ctrl, 4 finger swipe up: Move active window to next workspace
  • While holding ctrl, 4 finger swipe down: Move active window to previous workspace
  • Pinch scaling down (move 2 fingers closer): trigger ctrl and - combination, which is zoom out in browsers and reduce font size in some apps
  • Pinch scaling up (move 2 fingers away): trigger ctrl and = combination, which is zoom in in browsers and enlarge font size in some apps

White Screen on Rebooting after installing Linux


You may get stuck at a white screen when you reboot the first time time after installing Linux. The reason seems to be Linux installation somehow confusing rEFInd boot loader.

The solution is to power the MacBook Pro off and back on again holding down the Option key as soon as the audible chime starts playing. This will allow you to boot from "Macintosh HD" into Mac OS X. You can then reinstall rEFInd. When you restart again, you should see the rEFInd boot devices screen. From this point onwards, every time you reboot you should be able to boot into Linux or Mac OS X using the rEFInd boot loader.

Mac OS X and Linux on MacBook Pro rEFInd boot loader operating system selection screen
Mac OS X and Linux on MacBook Pro rEFInd boot loader operating system selection screen


Here is the terminal session from installing mtrack, dispad, xbindkeys and xdotool.


###
# Terminal session log:
# Configuring Trackpad Gestures for Linux Ubuntu Mate on Apple MacBook Pro 17"
# See https://supratim-sanyal.blogspot.com/2020/02/install-and-dual-boot-linux-on-17-inch_17.html
###
localuser@macbookpro17inch:~$ sudo apt update && sudo apt upgrade
[sudo] password for localuser:
...
...
localuser@macbookpro17inch:~$ sudo lshw
...
macbookpro17inch
description: Notebook
product: MacBookPro8,3 (System SKU#)
vendor: Apple Inc.
version: 1.0
serial: C02GW4HFDV11
width: 64 bits
capabilities: smbios-2.4 dmi-2.4 smp vsyscall32
configuration: boot=normal chassis=notebook family=MacBook Pro sku=System SKU# uuid=9DEBA8BD-B3AD-7650-810B-5DF111A94EF9
*-core
description: Motherboard
product: Mac-942459F5819B171B
vendor: Apple Inc.
physical id: 0
version: MacBookPro8,3
serial: C0215060087DYL5AD
slot: Part Component
*-cpu:0
description: CPU
product: Intel(R) Core(TM) i7-2760QM CPU @ 2.40GHz
vendor: Intel Corp.
physical id: 0
bus info: cpu@0
version: Intel(R) Core(TM) i7-2760QM CPU @ 2.40GHz
slot: U2E1
size: 959MHz
capacity: 3500MHz
width: 64 bits
capabilities: fpu fpu_exception wp vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ht tm pbe syscall nx rdtscp x86-64 constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx lahf_lm pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid xsaveopt dtherm ida arat pln pts md_clear flush_l1d cpufreq
*-cache:0
description: L1 cache
physical id: 2
slot: Unknown
size: 32KiB
capacity: 32KiB
capabilities: asynchronous internal write-back
configuration: level=1
*-cache:1
description: L2 cache
physical id: 3
slot: Unknown
size: 256KiB
capacity: 256KiB
capabilities: asynchronous internal write-back instruction
configuration: level=2
*-cache:2
description: L3 cache
physical id: 4
slot: Unknown
size: 6KiB
capacity: 6KiB
capabilities: asynchronous internal write-back instruction
configuration: level=3
*-cache:0
description: L1 cache
physical id: 1
slot: Unknown
size: 32KiB
capacity: 32KiB
capabilities: asynchronous internal write-back
configuration: level=1
*-cpu:1
description: CPU
vendor: Intel(R) Corporation
physical id: 5
bus info: cpu@1
version: Intel(R) Core(TM) i7-2760QM CPU @ 2.40GHz
slot: U2E1
size: 847MHz
capacity: 3500MHz
capabilities: cpufreq
*-cache:0
description: L1 cache
physical id: 7
slot: Unknown
size: 32KiB
capacity: 32KiB
capabilities: asynchronous internal write-back
configuration: level=1
*-cache:1
description: L2 cache
physical id: 8
slot: Unknown
size: 256KiB
capacity: 256KiB
capabilities: asynchronous internal write-back instruction
configuration: level=2
*-cache:2
description: L3 cache
physical id: 9
slot: Unknown
size: 6KiB
capacity: 6KiB
capabilities: asynchronous internal write-back instruction
configuration: level=3
*-cache:1
description: L1 cache
physical id: 6
slot: Unknown
size: 32KiB
capacity: 32KiB
capabilities: asynchronous internal write-back
configuration: level=1
*-cpu:2
description: CPU
vendor: Intel(R) Corporation
physical id: a
bus info: cpu@2
version: Intel(R) Core(TM) i7-2760QM CPU @ 2.40GHz
slot: U2E1
size: 798MHz
capacity: 3500MHz
capabilities: cpufreq
*-cache:0
description: L1 cache
physical id: c
slot: Unknown
size: 32KiB
capacity: 32KiB
capabilities: asynchronous internal write-back
configuration: level=1
*-cache:1
description: L2 cache
physical id: d
slot: Unknown
size: 256KiB
capacity: 256KiB
capabilities: asynchronous internal write-back instruction
configuration: level=2
*-cache:2
description: L3 cache
physical id: e
slot: Unknown
size: 6KiB
capacity: 6KiB
capabilities: asynchronous internal write-back instruction
configuration: level=3
*-cache:2
description: L1 cache
physical id: b
slot: Unknown
size: 32KiB
capacity: 32KiB
capabilities: asynchronous internal write-back
configuration: level=1
*-cpu:3
description: CPU
vendor: Intel(R) Corporation
physical id: f
bus info: cpu@3
version: Intel(R) Core(TM) i7-2760QM CPU @ 2.40GHz
slot: U2E1
size: 798MHz
capacity: 3500MHz
capabilities: cpufreq
*-cache:0
description: L1 cache
physical id: 11
slot: Unknown
size: 32KiB
capacity: 32KiB
capabilities: asynchronous internal write-back
configuration: level=1
*-cache:1
description: L2 cache
physical id: 12
slot: Unknown
size: 256KiB
capacity: 256KiB
capabilities: asynchronous internal write-back instruction
configuration: level=2
*-cache:2
description: L3 cache
physical id: 13
slot: Unknown
size: 6KiB
capacity: 6KiB
capabilities: asynchronous internal write-back instruction
configuration: level=3
*-cache:3
description: L1 cache
physical id: 10
slot: Unknown
size: 32KiB
capacity: 32KiB
capabilities: asynchronous internal write-back
configuration: level=1
*-cpu:4
description: CPU
vendor: Intel(R) Corporation
physical id: 14
bus info: cpu@4
version: Intel(R) Core(TM) i7-2760QM CPU @ 2.40GHz
slot: U2E1
size: 798MHz
capacity: 3500MHz
capabilities: cpufreq
*-cache:0
description: L1 cache
physical id: 16
slot: Unknown
size: 32KiB
capacity: 32KiB
capabilities: asynchronous internal write-back
configuration: level=1
*-cache:1
description: L2 cache
physical id: 17
slot: Unknown
size: 256KiB
capacity: 256KiB
capabilities: asynchronous internal write-back instruction
configuration: level=2
*-cache:2
description: L3 cache
physical id: 18
slot: Unknown
size: 6KiB
capacity: 6KiB
capabilities: asynchronous internal write-back instruction
configuration: level=3
*-cache:4
description: L1 cache
physical id: 15
slot: Unknown
size: 32KiB
capacity: 32KiB
capabilities: asynchronous internal write-back
configuration: level=1
*-cpu:5
description: CPU
vendor: Intel(R) Corporation
physical id: 19
bus info: cpu@5
version: Intel(R) Core(TM) i7-2760QM CPU @ 2.40GHz
slot: U2E1
size: 798MHz
capacity: 3500MHz
capabilities: cpufreq
*-cache:0
description: L1 cache
physical id: 1b
slot: Unknown
size: 32KiB
capacity: 32KiB
capabilities: asynchronous internal write-back
configuration: level=1
*-cache:1
description: L2 cache
physical id: 1c
slot: Unknown
size: 256KiB
capacity: 256KiB
capabilities: asynchronous internal write-back instruction
configuration: level=2
*-cache:2
description: L3 cache
physical id: 1d
slot: Unknown
size: 6KiB
capacity: 6KiB
capabilities: asynchronous internal write-back instruction
configuration: level=3
*-cache:5
description: L1 cache
physical id: 1a
slot: Unknown
size: 32KiB
capacity: 32KiB
capabilities: asynchronous internal write-back
configuration: level=1
*-cpu:6
description: CPU
vendor: Intel(R) Corporation
physical id: 1e
bus info: cpu@6
version: Intel(R) Core(TM) i7-2760QM CPU @ 2.40GHz
slot: U2E1
size: 798MHz
capacity: 3500MHz
capabilities: cpufreq
*-cache:0
description: L1 cache
physical id: 20
slot: Unknown
size: 32KiB
capacity: 32KiB
capabilities: asynchronous internal write-back
configuration: level=1
*-cache:1
description: L2 cache
physical id: 21
slot: Unknown
size: 256KiB
capacity: 256KiB
capabilities: asynchronous internal write-back instruction
configuration: level=2
*-cache:2
description: L3 cache
physical id: 22
slot: Unknown
size: 6KiB
capacity: 6KiB
capabilities: asynchronous internal write-back instruction
configuration: level=3
*-cache:6
description: L1 cache
physical id: 1f
slot: Unknown
size: 32KiB
capacity: 32KiB
capabilities: asynchronous internal write-back
configuration: level=1
*-cpu:7
description: CPU
vendor: Intel(R) Corporation
physical id: 23
bus info: cpu@7
version: Intel(R) Core(TM) i7-2760QM CPU @ 2.40GHz
slot: U2E1
size: 798MHz
capacity: 3500MHz
capabilities: cpufreq
*-cache:0
description: L1 cache
physical id: 25
slot: Unknown
size: 32KiB
capacity: 32KiB
capabilities: asynchronous internal write-back
configuration: level=1
*-cache:1
description: L2 cache
physical id: 26
slot: Unknown
size: 256KiB
capacity: 256KiB
capabilities: asynchronous internal write-back instruction
configuration: level=2
*-cache:2
description: L3 cache
physical id: 27
slot: Unknown
size: 6KiB
capacity: 6KiB
capabilities: asynchronous internal write-back instruction
configuration: level=3
*-cache:7
description: L1 cache
physical id: 24
slot: Unknown
size: 32KiB
capacity: 32KiB
capabilities: asynchronous internal write-back
configuration: level=1
*-memory
description: System Memory
physical id: 28
slot: System board or motherboard
size: 16GiB
*-bank:0
description: SODIMM DDR3 Synchronous 1600 MHz (0.6 ns)
product: HMT41GS6AFR8A-PB
vendor: Hynix Semiconductor (Hyundai Electronics)
physical id: 0
serial: 0x067BE827
slot: DIMM0
size: 8GiB
clock: 1600MHz (0.6ns)
*-bank:1
description: SODIMM DDR3 Synchronous 1600 MHz (0.6 ns)
product: HMT41GS6AFR8A-PB
vendor: Hynix Semiconductor (Hyundai Electronics)
physical id: 1
serial: 0x062BE7CF
slot: DIMM0
size: 8GiB
clock: 1600MHz (0.6ns)
*-firmware
description: BIOS
vendor: Apple Inc.
physical id: 2e
version: 87.0.0.0.0
date: 06/13/2019
size: 1MiB
capacity: 8128KiB
capabilities: pci upgrade shadowing cdboot bootselect acpi ieee1394boot smartbattery netboot
*-pci
description: Host bridge
product: 2nd Generation Core Processor Family DRAM Controller
vendor: Intel Corporation
physical id: 100
bus info: pci@0000:00:00.0
version: 09
width: 32 bits
clock: 33MHz
*-pci:0
description: PCI bridge
product: Xeon E3-1200/2nd Generation Core Processor Family PCI Express Root Port
vendor: Intel Corporation
physical id: 1
bus info: pci@0000:00:01.0
version: 09
width: 32 bits
clock: 33MHz
capabilities: pci pm msi pciexpress normal_decode bus_master cap_list
configuration: driver=pcieport
resources: irq:24 ioport:2000(size=4096) memory:b0800000-b08fffff ioport:90000000(size=268435456)
*-display
description: VGA compatible controller
product: Whistler [Radeon HD 6730M/6770M/7690M XT]
vendor: Advanced Micro Devices, Inc. [AMD/ATI]
physical id: 0
bus info: pci@0000:01:00.0
version: 00
width: 64 bits
clock: 33MHz
capabilities: pm pciexpress msi vga_controller bus_master cap_list rom
configuration: driver=radeon latency=0
resources: irq:50 memory:90000000-9fffffff memory:b0800000-b081ffff ioport:2000(size=256) memory:b0820000-b083ffff
*-multimedia
description: Audio device
product: Turks HDMI Audio [Radeon HD 6500/6600 / 6700M Series]
vendor: Advanced Micro Devices, Inc. [AMD/ATI]
physical id: 0.1
bus info: pci@0000:01:00.1
version: 00
width: 64 bits
clock: 33MHz
capabilities: pm pciexpress msi bus_master cap_list
configuration: driver=snd_hda_intel latency=0
resources: irq:53 memory:b0840000-b0843fff
*-pci:1
description: PCI bridge
product: Xeon E3-1200/2nd Generation Core Processor Family PCI Express Root Port
vendor: Intel Corporation
physical id: 1.1
bus info: pci@0000:00:01.1
version: 09
width: 32 bits
clock: 33MHz
capabilities: pci pm msi pciexpress normal_decode bus_master cap_list
configuration: driver=pcieport
resources: irq:25 ioport:4000(size=4096) memory:b0a00000-b4efffff ioport:b8f00000(size=67108864)
*-pci
description: PCI bridge
product: CV82524 Thunderbolt Controller [Light Ridge 4C 2010]
vendor: Intel Corporation
physical id: 0
bus info: pci@0000:05:00.0
version: 00
width: 32 bits
clock: 33MHz
capabilities: pci pm msi pciexpress normal_decode bus_master cap_list
configuration: driver=pcieport
resources: irq:30 memory:b0a00000-b0efffff ioport:b8f00000(size=12582912)
*-pci:0
description: PCI bridge
product: CV82524 Thunderbolt Controller [Light Ridge 4C 2010]
vendor: Intel Corporation
physical id: 0
bus info: pci@0000:06:00.0
version: 00
width: 32 bits
clock: 33MHz
capabilities: pci pm msi pciexpress normal_decode bus_master cap_list
configuration: driver=pcieport
resources: irq:31 memory:b0c00000-b0cfffff
*-generic
description: System peripheral
product: CV82524 Thunderbolt Controller [Light Ridge 4C 2010]
vendor: Intel Corporation
physical id: 0
bus info: pci@0000:07:00.0
version: 00
width: 32 bits
clock: 33MHz
capabilities: pm msi pciexpress msix bus_master cap_list
configuration: driver=thunderbolt latency=0
resources: irq:17 memory:b0c00000-b0c3ffff memory:b0c40000-b0c40fff
*-pci:1
description: PCI bridge
product: CV82524 Thunderbolt Controller [Light Ridge 4C 2010]
vendor: Intel Corporation
physical id: 3
bus info: pci@0000:06:03.0
version: 00
width: 32 bits
clock: 33MHz
capabilities: pci pm msi pciexpress normal_decode bus_master cap_list
configuration: driver=pcieport
resources: irq:16 memory:b0b00000-b0bfffff ioport:b8f00000(size=2097152)
*-pci:2
description: PCI bridge
product: CV82524 Thunderbolt Controller [Light Ridge 4C 2010]
vendor: Intel Corporation
physical id: 4
bus info: pci@0000:06:04.0
version: 00
width: 32 bits
clock: 33MHz
capabilities: pci pm msi pciexpress normal_decode bus_master cap_list
configuration: driver=pcieport
resources: irq:17 memory:b0d00000-b0dfffff ioport:b9100000(size=2097152)
*-pci:3
description: PCI bridge
product: CV82524 Thunderbolt Controller [Light Ridge 4C 2010]
vendor: Intel Corporation
physical id: 5
bus info: pci@0000:06:05.0
version: 00
width: 32 bits
clock: 33MHz
capabilities: pci pm msi pciexpress normal_decode bus_master cap_list
configuration: driver=pcieport
resources: irq:18 memory:b0e00000-b0efffff ioport:b9300000(size=2097152)
*-pci:4
description: PCI bridge
product: CV82524 Thunderbolt Controller [Light Ridge 4C 2010]
vendor: Intel Corporation
physical id: 6
bus info: pci@0000:06:06.0
version: 00
width: 32 bits
clock: 33MHz
capabilities: pci pm msi pciexpress normal_decode bus_master cap_list
configuration: driver=pcieport
resources: irq:19 memory:b0a00000-b0afffff ioport:b9500000(size=2097152)
*-display
description: VGA compatible controller
product: 2nd Generation Core Processor Family Integrated Graphics Controller
vendor: Intel Corporation
physical id: 2
bus info: pci@0000:00:02.0
version: 09
width: 64 bits
clock: 33MHz
capabilities: msi pm vga_controller bus_master cap_list
configuration: driver=i915 latency=0
resources: irq:51 memory:b0000000-b03fffff memory:a0000000-afffffff ioport:3000(size=64)
*-communication
description: Communication controller
product: 6 Series/C200 Series Chipset Family MEI Controller #1
vendor: Intel Corporation
physical id: 16
bus info: pci@0000:00:16.0
version: 04
width: 64 bits
clock: 33MHz
capabilities: pm msi bus_master cap_list
configuration: driver=mei_me latency=0
resources: irq:52 memory:b0907100-b090710f
*-usb:0
description: USB controller
product: 6 Series/C200 Series Chipset Family USB Universal Host Controller #5
vendor: Intel Corporation
physical id: 1a
bus info: pci@0000:00:1a.0
version: 05
width: 32 bits
clock: 33MHz
capabilities: uhci bus_master cap_list
configuration: driver=uhci_hcd latency=0
resources: irq:21 ioport:3120(size=32)
*-usbhost
product: UHCI Host Controller
vendor: Linux 5.3.0-28-generic uhci_hcd
physical id: 1
bus info: usb@3
logical name: usb3
version: 5.03
capabilities: usb-1.10
configuration: driver=hub slots=2 speed=12Mbit/s
*-usb:1
description: USB controller
product: 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #2
vendor: Intel Corporation
physical id: 1a.7
bus info: pci@0000:00:1a.7
version: 05
width: 32 bits
clock: 33MHz
capabilities: pm debug ehci bus_master cap_list
configuration: driver=ehci-pci latency=0
resources: irq:23 memory:b0906c00-b0906fff
*-usbhost
product: EHCI Host Controller
vendor: Linux 5.3.0-28-generic ehci_hcd
physical id: 1
bus info: usb@1
logical name: usb1
version: 5.03
capabilities: usb-2.00
configuration: driver=hub slots=6 speed=480Mbit/s
*-usb:0
description: USB hub
product: USB 2.0 Hub
vendor: Standard Microsystems Corp.
physical id: 1
bus info: usb@1:1
version: b.b3
capabilities: usb-2.00
configuration: driver=hub maxpower=2mA slots=4 speed=480Mbit/s
*-usb:0
description: USB hub
product: BRCM2070 Hub
vendor: Apple Inc.
physical id: 1
bus info: usb@1:1.1
version: 1.00
capabilities: usb-2.00
configuration: driver=hub maxpower=94mA slots=3 speed=12Mbit/s
*-usb
description: Bluetooth wireless interface
product: Bluetooth USB Host Controller
vendor: Apple Inc.
physical id: 3
bus info: usb@1:1.1.3
version: 0.42
capabilities: usb-2.00 bluetooth
configuration: driver=btusb speed=12Mbit/s
*-usb:1
description: Keyboard
product: Apple Internal Keyboard / Trackpad
vendor: Apple Inc.
physical id: 2
bus info: usb@1:1.2
version: 1.18
capabilities: usb-2.00
configuration: driver=bcm5974 maxpower=40mA speed=12Mbit/s
*-usb:1
description: Video
product: FaceTime HD Camera (Built-in)
vendor: Apple Inc.
physical id: 2
bus info: usb@1:2
version: 5.16
serial: CC2B2F00P1DGFLL0
capabilities: usb-2.00
configuration: driver=uvcvideo maxpower=500mA speed=480Mbit/s
*-multimedia
description: Audio device
product: 6 Series/C200 Series Chipset Family High Definition Audio Controller
vendor: Intel Corporation
physical id: 1b
bus info: pci@0000:00:1b.0
version: 05
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress bus_master cap_list
configuration: driver=snd_hda_intel latency=0
resources: irq:54 memory:b0900000-b0903fff
*-pci:2
description: PCI bridge
product: 6 Series/C200 Series Chipset Family PCI Express Root Port 1
vendor: Intel Corporation
physical id: 1c
bus info: pci@0000:00:1c.0
version: b5
width: 32 bits
clock: 33MHz
capabilities: pci pciexpress msi pm normal_decode bus_master cap_list
configuration: driver=pcieport
resources: irq:26 memory:b0700000-b07fffff ioport:b0400000(size=1048576)
*-network
description: Ethernet interface
product: NetXtreme BCM57765 Gigabit Ethernet PCIe
vendor: Broadcom Inc. and subsidiaries
physical id: 0
bus info: pci@0000:02:00.0
logical name: enp2s0
version: 10
serial: 3c:07:54:2b:42:66
capacity: 1Gbit/s
width: 64 bits
clock: 33MHz
capabilities: pm msi msix pciexpress bus_master cap_list ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation
configuration: autonegotiation=on broadcast=yes driver=tg3 driverversion=3.137 firmware=57765-v1.37 latency=0 link=no multicast=yes port=twisted pair
resources: irq:16 memory:b0400000-b040ffff memory:b0410000-b041ffff
*-pci:3
description: PCI bridge
product: 6 Series/C200 Series Chipset Family PCI Express Root Port 2
vendor: Intel Corporation
physical id: 1c.1
bus info: pci@0000:00:1c.1
version: b5
width: 32 bits
clock: 33MHz
capabilities: pci pciexpress msi pm normal_decode bus_master cap_list
configuration: driver=pcieport
resources: irq:27 memory:b0600000-b06fffff
*-network
description: Wireless interface
product: BCM4331 802.11a/b/g/n
vendor: Broadcom Inc. and subsidiaries
physical id: 0
bus info: pci@0000:03:00.0
logical name: wlp3s0
version: 02
serial: 68:a8:6d:39:ad:64
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress bus_master cap_list ethernet physical wireless
configuration: broadcast=yes driver=wl0 driverversion=6.30.223.271 (r587334) latency=0 multicast=yes wireless=IEEE 802.11
resources: irq:17 memory:b0600000-b0603fff
*-pci:4
description: PCI bridge
product: 6 Series/C200 Series Chipset Family PCI Express Root Port 3
vendor: Intel Corporation
physical id: 1c.2
bus info: pci@0000:00:1c.2
version: b5
width: 32 bits
clock: 33MHz
capabilities: pci pciexpress msi pm normal_decode bus_master cap_list
configuration: driver=pcieport
resources: irq:28 memory:b0500000-b05fffff
*-firewire
description: FireWire (IEEE 1394)
product: FW643 [TrueFire] PCIe 1394b Controller
vendor: LSI Corporation
physical id: 0
bus info: pci@0000:04:00.0
version: 08
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress ohci bus_master cap_list
configuration: driver=firewire_ohci latency=0
resources: irq:49 memory:b0500000-b0500fff
*-pci:5
description: PCI bridge
product: 6 Series/C200 Series Chipset Family PCI Express Root Port 4
vendor: Intel Corporation
physical id: 1c.3
bus info: pci@0000:00:1c.3
version: b5
width: 32 bits
clock: 33MHz
capabilities: pci pciexpress msi pm normal_decode bus_master cap_list
configuration: driver=pcieport
resources: irq:29 ioport:5000(size=4096) memory:b4f00000-b8efffff ioport:bcf00000(size=67108864)
*-usb:2
description: USB controller
product: 6 Series/C200 Series Chipset Family USB Universal Host Controller #1
vendor: Intel Corporation
physical id: 1d
bus info: pci@0000:00:1d.0
version: 05
width: 32 bits
clock: 33MHz
capabilities: uhci bus_master cap_list
configuration: driver=uhci_hcd latency=0
resources: irq:19 ioport:30c0(size=32)
*-usbhost
product: UHCI Host Controller
vendor: Linux 5.3.0-28-generic uhci_hcd
physical id: 1
bus info: usb@4
logical name: usb4
version: 5.03
capabilities: usb-1.10
configuration: driver=hub slots=2 speed=12Mbit/s
*-usb:3
description: USB controller
product: 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #1
vendor: Intel Corporation
physical id: 1d.7
bus info: pci@0000:00:1d.7
version: 05
width: 32 bits
clock: 33MHz
capabilities: pm debug ehci bus_master cap_list
configuration: driver=ehci-pci latency=0
resources: irq:22 memory:b0906800-b0906bff
*-usbhost
product: EHCI Host Controller
vendor: Linux 5.3.0-28-generic ehci_hcd
physical id: 1
bus info: usb@2
logical name: usb2
version: 5.03
capabilities: usb-2.00
configuration: driver=hub slots=8 speed=480Mbit/s
*-usb
description: USB hub
product: USB 2.0 Hub
vendor: Standard Microsystems Corp.
physical id: 1
bus info: usb@2:1
version: b.b3
capabilities: usb-2.00
configuration: driver=hub maxpower=2mA slots=3 speed=480Mbit/s
*-usb:0
description: Human interface device
product: IR Receiver
vendor: Apple Computer, Inc.
physical id: 1
bus info: usb@2:1.1
version: 0.16
capabilities: usb-2.00
configuration: driver=usbhid maxpower=100mA speed=2Mbit/s
*-usb:1
description: Mouse
product: 2.4G Mouse
physical id: 2
bus info: usb@2:1.2
version: 2.00
capabilities: usb-1.10
configuration: driver=usbhid maxpower=100mA speed=12Mbit/s
*-usb:2
description: Generic USB device
product: 802.11n WLAN Adapter
vendor: Realtek
physical id: 3
bus info: usb@2:1.3
version: 2.00
serial: 00e04c000001
capabilities: usb-2.00
configuration: driver=rtl8192cu maxpower=500mA speed=480Mbit/s
*-isa
description: ISA bridge
product: HM65 Express Chipset LPC Controller
vendor: Intel Corporation
physical id: 1f
bus info: pci@0000:00:1f.0
version: 05
width: 32 bits
clock: 33MHz
capabilities: isa bus_master cap_list
configuration: driver=lpc_ich latency=0
resources: irq:0
*-storage
description: SATA controller
product: 6 Series/C200 Series Chipset Family 6 port Mobile SATA AHCI Controller
vendor: Intel Corporation
physical id: 1f.2
bus info: pci@0000:00:1f.2
version: 05
width: 32 bits
clock: 66MHz
capabilities: storage msi pm ahci_1.0 bus_master cap_list
configuration: driver=ahci latency=0
resources: irq:48 ioport:3148(size=8) ioport:315c(size=4) ioport:3140(size=8) ioport:3158(size=4) ioport:3060(size=32) memory:b0906000-b09067ff
*-serial UNCLAIMED
description: SMBus
product: 6 Series/C200 Series Chipset Family SMBus Controller
vendor: Intel Corporation
physical id: 1f.3
bus info: pci@0000:00:1f.3
version: 05
width: 64 bits
clock: 33MHz
configuration: latency=0
resources: memory:b0907000-b09070ff ioport:efa0(size=32)
*-scsi:0
physical id: 2
logical name: scsi0
capabilities: emulated
*-disk
description: ATA Disk
product: Samsung SSD 840
physical id: 0.0.0
bus info: scsi@0:0.0.0
logical name: /dev/sda
version: BB6Q
serial: S1D9NSAF522121T
size: 931GiB (1TB)
capabilities: partitioned partitioned:dos
configuration: ansiversion=5 logicalsectorsize=512 sectorsize=512
*-volume:0 UNCLAIMED
description: EFI GPT partition
physical id: 1
bus info: scsi@0:0.0.0,1
capacity: 200MiB
capabilities: primary nofs
*-volume:1
description: Non-FS data partition
physical id: 2
bus info: scsi@0:0.0.0,2
logical name: /dev/sda2
capacity: 232GiB
capabilities: primary bootable nofs
*-volume:2
description: EXT4 volume
vendor: Linux
physical id: 3
bus info: scsi@0:0.0.0,3
logical name: /dev/sda3
logical name: /
version: 1.0
serial: c86537d8-3cdb-46bd-b1c7-6dac65801a08
size: 232GiB
capacity: 232GiB
capabilities: primary journaled extended_attributes large_files huge_files dir_nlink recover 64bit extents ext4 ext2 initialized
configuration: created=2020-02-13 10:10:47 filesystem=ext4 lastmountpoint=/ modified=2020-02-13 12:42:25 mount.fstype=ext4 mount.options=rw,relatime,errors=remount-ro mounted=2020-02-13 12:42:26 state=mounted
*-volume:3
description: Non-FS data partition
physical id: 4
bus info: scsi@0:0.0.0,4
logical name: /dev/sda4
capacity: 465GiB
capabilities: primary nofs
*-scsi:1
physical id: 3
logical name: scsi1
capabilities: emulated
*-cdrom
description: DVD writer
product: DVDRW GS31N
vendor: HL-DT-ST
physical id: 0.0.0
bus info: scsi@1:0.0.0
logical name: /dev/cdrom
logical name: /dev/cdrw
logical name: /dev/dvd
logical name: /dev/dvdrw
logical name: /dev/sr0
version: TA17
capabilities: removable audio cd-r cd-rw dvd dvd-r
configuration: ansiversion=5 status=open
*-battery
product: Unknown
vendor: Unknown
physical id: 1
version: Unknown
serial: Unknown
slot: Unknown
*-network
description: Wireless interface
physical id: 2
bus info: usb@2:1.3
logical name: wlx000f00bf03d7
serial: 00:0f:00:bf:03:d7
capabilities: ethernet physical wireless
configuration: broadcast=yes driver=rtl8192cu driverversion=5.3.0-28-generic firmware=N/A ip=172.20.42.198 link=yes multicast=yes wireless=IEEE 802.11
localuser@macbookpro17inch:~$ sudo apt install build-essential git pkg-config libmtd dev-dev mtdev-tools xserver-xorg-dev xutils-dev
...
localuser@macbookpro17inch:~$ ########## Compile and install mtrack driver ##########
localuser@macbookpro17inch:~$ mkdir mtrack.build
localuser@macbookpro17inch:~$ cd mtrack.build
localuser@macbookpro17inch:~/mtrack.build$ pwd
/home/localuser/mtrack.build
localuser@macbookpro17inch:~/mtrack.build$ https://github.com/p2rkw/xf86-input-mtrack
Cloning into 'xf86-input-mtrack'...
remote: Enumerating objects: 1944, done.
...
Resolving deltas: 100% (1266/1266)
Resolving deltas: 100% (1266/1266), done.
localuser@macbookpro17inch:~/mtrack.build$ cd xf86-input-mtrack
localuser@macbookpro17inch:~/mtrack.build/xf86-input-mtrack$ ./configure --with-xorg
g-module-dir=/usr/lib/xorg/modules
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
...
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing libtool commands
localuser@macbookpro17inch:~/mtrack.build/xf86-input-mtrack$ sudo make
make all-am
make[1]: Entering directory '/home/localuser/mtrack.build/xf86-input-mtrack'
CC src/capabilities.lo
CC src/gestures.lo
CC src/hwstate.lo
CC src/mconfig.lo
CC src/mtouch.lo
CC src/mtstate.lo
CC src/trig.lo
CC driver/mtrack.lo
CC driver/mprops.lo
CCLD mtrack_drv.la
CC src/mtrack_test-capabilities.o
CC src/mtrack_test-gestures.o
CC src/mtrack_test-hwstate.o
CC src/mtrack_test-mconfig.o
CC src/mtrack_test-mtouch.o
CC src/mtrack_test-mtstate.o
CC src/mtrack_test-trig.o
CC tools/mtrack_test-mtrack-test.o
CCLD mtrack-test
make[1]: Leaving directory '/home/localuser/mtrack.build/xf86-input-mtrack'
localuser@macbookpro17inch:~/mtrack.build/xf86-input-mtrack$ sudo make install
make[1]: Entering directory '/home/localuser/mtrack.build/xf86-input-mtrack'
make[1]: Nothing to be done for 'install-exec-am'.
/bin/mkdir -p '/usr/lib/xorg/modules/input'
/bin/bash ./libtool --mode=install /usr/bin/install -c mtrack_drv.la '/usr/lib/xorg/modules/input'
libtool: install: /usr/bin/install -c .libs/mtrack_drv.so /usr/lib/xorg/modules/input/mtrack_drv.so
libtool: install: /usr/bin/install -c .libs/mtrack_drv.lai /usr/lib/xorg/modules/input/mtrack_drv.la
libtool: finish: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:/sbin" ldconfig -n /usr/lib/xorg/modules/input
----------------------------------------------------------------------
Libraries have been installed in:
/usr/lib/xorg/modules/input
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the `LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the `LD_RUN_PATH' environment variable
during linking
- use the `-Wl,-rpath -Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to `/etc/ld.so.conf'
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
make[1]: Leaving directory '/home/localuser/mtrack.build/xf86-input-mtrack'
localuser@macbookpro17inch:~/mtrack.build/xf86-input-mtrack$ sudo vi /etc/ld.so.conf.d/mtrack.conf
...
localuser@macbookpro17inch:~/mtrack.build/xf86-input-mtrack$ ls /etc/ld.so.conf.d/mtrack.conf
/etc/ld.so.conf.d/mtrack.conf
localuser@macbookpro17inch:~/mtrack.build/xf86-input-mtrack$ cat /etc/ld.so.conf.d/mtrack.conf
/usr/lib/xorg/modules/input
localuser@macbookpro17inch:~/mtrack.build/xf86-input-mtrack$ ########## Configure the new touchpad driver #######
localuser@macbookpro17inch:~/mtrack.build/xf86-input-mtrack$ sudo vi /usr/share/X11/xorg.conf.d/50-mtrack.conf
...
localuser@macbookpro17inch:~/mtrack.build/xf86-input-mtrack$ cat /usr/share/X11/xorg.conf.d/50-mtrack.conf
# Install mtrack driver 0.5.0++
# Save this file to /usr/share/X11/xorg.conf.d/50-mtrack.conf
# This config is specialized for MacBook Air 2012 (5,2)
Section "InputClass"
MatchIsTouchpad "on"
Identifier "Touchpads"
MatchDevicePath "/dev/input/event*"
Driver "mtrack"
# The faster you move, the more distance pointer will travel, using "polynomial" profile
Option "AccelerationProfile" "2"
# Tweak cursor movement speed with this
Option "Sensitivity" "0.10"
# Pressure at which a finger is detected as a touch
Option "FingerHigh" "5"
# Pressure at which a finger is detected as a release
Option "FingerLow" "5"
# I often use thumb to press down the physical button, so let's not ignore it
Option "IgnoreThumb" "false"
Option "ThumbRatio" "70"
Option "ThumbSize" "25"
# Ignore palm, with palm takes up to 30% of your touch pad
Option "IgnorePalm" "true"
Option "PalmSize" "30"
# Trigger mouse button when tap: 1 finger - left click, 2 finger - right click, 3 - middle click
Option "TapButton1" "1"
Option "TapButton2" "3"
Option "TapButton3" "2"
Option "TapButton4" "0"
Option "ClickTime" "25"
# Disable tap-to-drag, we're using three finger drag instead
Option "TapDragEnable" "false"
# While touching the touch pad with # fingers, press the touchpad physical click button
Option "ClickFinger1" "1"
Option "ClickFinger2" "3"
Option "ClickFinger3" "2"
Option "ButtonMoveEmulate" "false"
Option "ButtonIntegrated" "true"
# The momentum after scroll fingers released
Option "ScrollCoastDuration" "300"
Option "ScrollCoastEnableSpeed" ".1"
# Natural scrolling with two fingers
Option "ScrollSmooth" "true"
Option "ScrollUpButton" "5"
Option "ScrollDownButton" "4"
Option "ScrollLeftButton" "7"
Option "ScrollRightButton" "6"
# Tweak scroll sensitivity with ScrollDistance, don't touch ScrollSensitivity
Option "ScrollDistance" "250"
Option "ScrollClickTime" "10"
# Three finger drag
Option "SwipeDistance" "1"
Option "SwipeLeftButton" "1"
Option "SwipeRightButton" "1"
Option "SwipeUpButton" "1"
Option "SwipeDownButton" "1"
Option "SwipeClickTime" "0"
Option "SwipeSensitivity" "1500"
# Four finger swipe, 8 & 9 are for browsers navigating back and forth respectively
Option "Swipe4LeftButton" "9"
Option "Swipe4RightButton" "8"
# Mouse button >= 10 are not used by Xorg, so we'll map them with xbindkeys and xdotool later
Option "Swipe4UpButton" "11"
Option "Swipe4DownButton" "10"
# Mouse buttons triggered by 2-finger pinching gesture
Option "ScaleDistance" "300"
Option "ScaleUpButton" "12"
Option "ScaleDownButton" "13"
# Mouse buttons trigger by 2-finger rotating gesture, disabled to enhance the pinch gesture
Option "RotateLeftButton" "0"
Option "RotateRightButton" "0"
EndSection
localuser@macbookpro17inch:~/mtrack.build/xf86-input-mtrack$ sudo adduser "`whoami` input
Adding user `localuser' to group `input' ...
Adding user localuser to group input
Done.
localuser@macbookpro17inch:~/mtrack.build/xf86-input-mtrack$ ########## Disable touchpad while typing with dispad ##########
localuser@macbookpro17inch:~$ sudo apt install libconfuse-dev libxi-dev
Reading package lists... 0%
Reading package lists... 100%
Reading package lists... Done
Building dependency tree... 0%
Building dependency tree... 0%
Building dependency tree... 50%
Building dependency tree... 50%
Building dependency tree
Reading state information... 0%
Reading state information... 0%
Reading state information... Done
The following packages were automatically installed and are no longer required:
libegl1-mesa libxatracker2 libxvmc1 x11-apps x11-session-utils xfonts-base
xfonts-encodings xfonts-scalable xfonts-utils xinit xinput xserver-common
xserver-xorg-core-hwe-18.04 xserver-xorg-input-all-hwe-18.04
xserver-xorg-input-libinput-hwe-18.04 xserver-xorg-input-wacom-hwe-18.04
xserver-xorg-legacy-hwe-18.04 xserver-xorg-video-all-hwe-18.04
xserver-xorg-video-amdgpu-hwe-18.04 xserver-xorg-video-ati-hwe-18.04
xserver-xorg-video-fbdev-hwe-18.04 xserver-xorg-video-intel-hwe-18.04
xserver-xorg-video-nouveau-hwe-18.04 xserver-xorg-video-qxl-hwe-18.04
xserver-xorg-video-radeon-hwe-18.04 xserver-xorg-video-vesa-hwe-18.04
xserver-xorg-video-vmware-hwe-18.04
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
libconfuse-doc libxext-dev libxfixes-dev x11proto-fixes-dev
Suggested packages:
libxext-doc
The following NEW packages will be installed:
libconfuse-dev libconfuse-doc libxext-dev libxfixes-dev libxi-dev
x11proto-fixes-dev
0 upgraded, 6 newly installed, 0 to remove and 0 not upgraded.
Need to get 459 kB of archives.
After this operation, 2,237 kB of additional disk space will be used.
Do you want to continue? [Y/n]
...
localuser@macbookpro17inch:~$ pwd
/home/localuser
localuser@macbookpro17inch:~$ mkdir dispad.build
localuser@macbookpro17inch:~$ cd dispad.build/
localuser@macbookpro17inch:~/dispad.build$ git clone https://github.com/BlueDragonX/dispad.git
Cloning into 'dispad'...
remote: Enumerating objects: 244, done.
Receiving objects: 0% (1/244)
Receiving objects: 1% (3/244)
...
Receiving objects: 100% (244/244), 135.94 KiB | 1.89 MiB/s, done.
Resolving deltas: 0% (0/143)
...
Resolving deltas: 100% (143/143), done.
localuser@macbookpro17inch:~/dispad.build$ cd dispad
localuser@macbookpro17inch:~/dispad.build/dispad$ ########## compile the daemon ##########
localuser@macbookpro17inch:~/dispad.build/dispad$ ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
...
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: executing depfiles commands
localuser@macbookpro17inch: ~/dispad.build/dispad
localuser@macbookpro17inch:~/dispad.build/dispad$ make
Making all in src
make[1]: Entering directory '/home/localuser/dispad.build/dispad/src'
gcc -DPACKAGE_NAME=\"dispad\" -DPACKAGE_TARNAME=\"dispad\" -DPACKAGE_VERSION=\"0.1\" -DPACKAGE_STRING=\"dispad\ 0.1\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"dispad\" -DVERSION=\"0.1\" -DHAVE_LIBXI=1 -DHAVE_LIBX11=1 -DHAVE_LIBCONFUSE=1 -I. -I../include/ -g -O2 -MT conf.o -MD -MP -MF .deps/conf.Tpo -c -o conf.o conf.c
...
make[2]: Leaving directory '/home/localuser/dispad.build/dispad'
make[1]: Leaving directory '/home/localuser/dispad.build/dispad'
localuser@macbookpro17inch:~/dispad.build/dispad$ dispad
[I] using config file: /home/localuser/.dispad
localuser@macbookpro17inch:~/dispad.build/dispad$ vi ~/.dispad
...
"~/.dispad" 24 lines, 576 characters written
localuser@macbookpro17inch:~/dispad.build/dispad$ cat ~/.dispad
# default dispad config file
# name of the property used to enable/disable the trackpad
property = "Trackpad Disable Input"
# the value used to enable the trackpad
enable = 0
# the value used to disable the trackpad
disable = 1
# whether or not modifier keys disable the trackpad
modifiers = false
# how long (in ms) to sleep between keyboard polls
#poll = 100
poll = 48
# how long (in ms) to disable the trackpad after a keystroke
#delay = 1000
delay = 500
# create a pid file at the given location; not created if left commented
#pidfile = "/home/localuser/.dispad.pid"
localuser@macbookpro17inch:~/dispad.build/dispad$ ########
localuser@macbookpro17inch:~/dispad.build/dispad$ ## DO THIS NOW - this log does not show the following GUI activity
localuser@macbookpro17inch:~/dispad.build/dispad$ ########
localuser@macbookpro17inch:~/dispad.build/dispad$ ## To Start dispad automatically every time we log in
localuser@macbookpro17inch:~/dispad.build/dispad$ ## go to Activities, search and open Startup Applications
localuser@macbookpro17inch:~/dispad.build/dispad$ ## Add new entry, with name as dispad, command as /usr/local/bin/d
dispad and with an optional comment to remind you what it does.
localuser@macbookpro17inch:~/dispad.build/dispad$ ########
localuser@macbookpro17inch:~/dispad.build/dispad$ # Add more gestures with xbindkeys & xdotool
localuser@macbookpro17inch:~/dispad.build/dispad$ sudo apt install xbindkeys xdotool
[sudo] password for localuser:
Reading package lists... 0%
...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Processing triggers for menu (2.1.47ubuntu2.1) ...
Processing triggers for libc-bin (2.27-3ubuntu1) ...
localuser@macbookpro17inch:~/dispad.build/dispad$ ##### xbind has been automatically added to Startup Applications, no need to add manually!
localuser@macbookpro17inch:~/dispad.build/dispad$ vi ~/.xbindkeysrc
...
"~/.xbindkeysrc" [New File] 24 lines, 407 characters written
localuser@macbookpro17inch:~/dispad.build/dispad$ cat ~/.xbindkeysrc
# Next Workspace
"xdotool key super+Page_Down"
b:11
# Move Next Workspace
"xdotool key --clearmodifiers super+shift+Page_Down"
Control + b:11 + release
# Previous Workspace
"xdotool key super+Page_Up"
b:10
# Move Previous Workspace
"xdotool key --clearmodifiers super+shift+Page_Up"
Control + b:10 + release
# Zoom in
"xdotool key ctrl+21"
b:12
# Zoom out
"xdotool key ctrl+20"
b:13
localuser@macbookpro17inch:~/dispad.build/dispad$ cd
localuser@macbookpro17inch:~$ # Reboot
localuser@macbookpro17inch:~$ sync;sync;sync
localuser@macbookpro17inch:~$ sudo reboot


MacBook Pro Linux Fan Speed Control


The Fanny notification center widget and menu bar application for Mac OS X tells me the fans of my MacBook Pro run mostly around the minimum speed of 2,000 RPM with the CPU and GPU temperatures hovering in the 50 - 60 degrees Celsius range after a couple of hours of use.

Fanny on Mac OS X reports Fan with and CPU and GPU temperatures at real-time

When booted into Ubuntu MATE Linux, it appears the fans run at their maximum speed all the time even when not really needed. A dynamic fan speed control based on thermal sensors like that built into OS X is needed.

The solution is to simply install the daemon called "macfanctld" using the package of the same name from the usual Ubuntu MATE 18.04 Bionic Beaver repositories. No further configuration is necessary after the installation.

$ sudo apt-get install macfanctld
$ systemctl status macfanctld

You can examine the log file at /var/log/macfanctl.log. If you wish you can of course tweak the default configuration file /etc/macfanctl.conf. Here is my (default) configuration file.

$ cat /etc/macfanctl.conf
# Config file for macfanctl daemon
#
# Note: 0 < temp_X_floor < temp_X_ceiling
#       0 < fan_min < 6200

fan_min: 2000

temp_avg_floor: 45
temp_avg_ceiling: 55

temp_TC0P_floor: 50
temp_TC0P_ceiling: 58

temp_TG0P_floor: 50
temp_TG0P_ceiling: 58

# Add sensors to be excluded here, separated by space, i.e.
# exclude: 1 7
# will disable reading of sensors temp1_input and temp7_input.

exclude:

# log_level values:
#   0: Startup / Exit logging only
#   1: Basic temp / fan logging
#   2: Log all sensors

log_level: 0


Here is what my /var/log/macfanctl.log:

$ cat /var/log/macfanctl.log
Using parameters:
        temp_avg_floor: 45
        temp_avg_ceiling: 55
        temp_TC0P_floor: 50
        temp_TC0P_ceiling: 58
        temp_TG0P_floor: 50
        temp_TG0P_ceiling: 58
        fan_min: 2000
        log_level: 0
Found applesmc at /sys/devices/platform/applesmc.768
Found 2 fans.
Found 29 sensors:
         1: TB0T - Battery TS_MAX Temp
         2: TB1T - Battery TS1 Temp
         3: TB2T - Battery TS2 Temp
         4: TC0C - ?
         5: TC0D - CPU 0 Die Temp
         6: TC0E - ?
         7: TC0F - ?
         8: TC0J - ?
         9: TC0P - CPU 0 Proximity Temp
        10: TC1C - ?
        11: TC2C - ?
        12: TC3C - ?
        13: TC4C - ?
        14: TCGC - ?
        15: TCSA - ?
        16: TCTD - ?
        17: TG0D - GPU Die - Digital
        18: TG0P - GPU 0 Proximity Temp
        19: THSP - ?
        20: TM0S - ?
        21: TMBS - ?
        22: TP0P - ?
        23: TPCD - ?
        24: TW0P - ?
        25: Th1H - ?
        26: Th2H - Right Fin Stack Proximity Temp
        27: Tm0P - Battery Charger Proximity Temp
        28: Ts0P - Palm Rest Temp
        29: Ts0S - ?

As you can see, Apple's designers put in an impressive number of temperature sensors for great thermal management. I particularly like the Palm Rest temperature sensor. assuming Palm Rest is empty aluminum surface on the two sides of the trackpad.


Mount MacOS X APFS File System Partition on Linux for MacBook Pro


Apple introduced their Apple File System (APFS) with macOS High Sierra, replacing the aging HPS+ file system. To access the APFS file system from Ubuntu Mate Linux, I followed Alistair Ross' instructions at How to mount macOS APFS disk volumes in Linux with minor modifications (e.g. bilding from source in a directory under my home directory instead of /tmp and using a mount-point right under root instead of /mnt since I keep /mnt free for other mounts.

Once it's done, I can see my OS X files under a "Users" directory under "root":

$ ls -l /macos-partition/
total 0
drw-r--r-- 1 root root  0 Feb 12 19:04 private-dir
drwxr-xr-x 1 root root 28 Feb  2 00:42 root


Here is the installation log.


###
# Terminal session log:
# Mounting MacOS X APFS partition on Linux Ubuntu Mate on Apple MacBook Pro 17"
# See https://supratim-sanyal.blogspot.com/2020/02/install-and-dual-boot-linux-on-17-inch_17.html
###
localuser@macbookpro17inch:~$ # MOUNT THE MAC OS X APFS PARTITION ON UBUNTU ON MACBOOK PRO
localuser@macbookpro17inch:~$ sudo apt-get update
...
localuser@macbookpro17inch:~$ sudo apt-get upgrade
...
localuser@macbookpro17inch:~$ mkdir apfs-fuse.build
localuser@macbookpro17inch:~$ cd apfs-fuse.build/
/home/localuser/apfs-fuse.build
localuser@macbookpro17inch:~/apfs-fuse.build$ git clone https://github.com/sgan81/apfs-fuse.git
Cloning into 'apfs-fuse'...
remote: Enumerating objects: 803, done.
Receiving objects: 0% (1/803)
Receiving objects: 1% (9/803)
...
Resolving deltas: 100% (533/533), done.
localuser@macbookpro17inch:~/apfs-fuse.build$ cd apfs-fuse
localuser@macbookpro17inch:~/apfs-fuse.build/apfs-fuse$ git submodule init
Submodule '3rdparty/lzfse' (https://github.com/lzfse/lzfse.git) registered for path '3rdparty/lzfse'
localuser@macbookpro17inch:~/apfs-fuse.build/apfs-fuse$ git submodule update
Cloning into '/home/localuser/apfs-fuse.build/apfs-fuse/3rdparty/lzfse'...
Submodule path '3rdparty/lzfse': checked out 'e634ca58b4821d9f3d560cdc6df5dec02ffc93fd'
localuser@macbookpro17inch:~/apfs-fuse.build/apfs-fuse$ mkdir build
localuser@macbookpro17inch:~/apfs-fuse.build/apfs-fuse$ cd build
localuser@macbookpro17inch:~/apfs-fuse.build/apfs-fuse/build$ cmake ..
Command 'cmake' not found, but can be installed with:
sudo apt install cmake
localuser@macbookpro17inch:~/apfs-fuse.build/apfs-fuse/build$ sudo apt install cmake
Reading package lists... 0%
...
After this operation, 25.5 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Processing triggers for libc-bin (2.27-3ubuntu1) ...
localuser@macbookpro17inch:~/apfs-fuse.build/apfs-fuse/build$ cmake ..
-- The C compiler identification is GNU 7.4.0
-- The CXX compiler identification is GNU 7.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /home/localuser/apfs-fuse.build/apfs-fuse/build
localuser@macbookpro17inch:~/apfs-fuse.build/apfs-fuse/build$ make
Scanning dependencies of target lzfse
[ 2%]
Building C object CMakeFiles/lzfse.dir/3rdparty/lzfse/src/lzfse_decode.c.o
...
Building CXX object CMakeFiles/apfs.dir/ApfsLib/Util.cpp.o
/home/localuser/apfs-fuse.build/apfs-fuse/ApfsLib/Util.cpp:37:10:
fatal error:
bzlib.h: No such file or directory
#include <bzlib.h>
compilation terminated.
CMakeFiles/apfs.dir/build.make:734: recipe for target 'CMakeFiles/apfs.dir/ApfsLib/Util.cpp.o' failed
make[2]: *** [CMakeFiles/apfs.dir/ApfsLib/Util.cpp.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/apfs.dir/all' failed
make[1]: *** [CMakeFiles/apfs.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2
localuser@macbookpro17inch:~/apfs-fuse.build/apfs-fuse/build$ sudo apt-get install libbz2-1.0 libbz2-dev libbz2-ocaml libbz2-ocaml-dev
Reading package lists... 0%
...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
W: http://us.archive.ubuntu.com/ubuntu/pool/main/n/ncurses/libtinfo-dev_6.1-1ubuntu1.18.04_amd64.deb: Automatically disabled Acquire::http::Pipeline-Depth due to incorrect response from server/proxy. (man 5 apt.conf)
localuser@macbookpro17inch:~/apfs-fuse.build/apfs-fuse/build$ sudo apt install fuse libfuse-dev libicu-dev bzip2 libbz2-dev cmake clang git libattr1-dev
Reading package lists... 0%
Reading package lists... 100%
...
http://us.archive.ubuntu.com/ubuntu/pool/main/g/gcc-7/libobjc-7-dev_7.4.0-1ubuntu1~18.04.1_amd64.deb: Automatically disabled Acquire::http::Pipeline-Depth due to incorrect response from server/proxy. (man 5 apt.conf)
localuser@macbookpro17inch:~/apfs-fuse.build/apfs-fuse/build$ make clean
localuser@macbookpro17inch:~/apfs-fuse.build/apfs-fuse/build$ make
[ 2%]
Building C object CMakeFiles/lzfse.dir/3rdparty/lzfse/src/lzfse_decode.c.o
...
[K/home/localuser/apfs-fuse.build/apfs-fuse/apfsfuse/ApfsFuse.cpp:31:10:
fatal error: fuse3/fuse.h: No such file or directory
#include <fuse3/fuse.h>
compilation terminated.
CMakeFiles/apfs-fuse.dir/build.make:62: recipe for target 'CMakeFiles/apfs-fuse.dir/apfsfuse/ApfsFuse.cpp.o' failed
make[2]: *** [CMakeFiles/apfs-fuse.dir/apfsfuse/ApfsFuse.cpp.o] Error 1
CMakeFiles/Makefile2:143: recipe for target 'CMakeFiles/apfs-fuse.dir/all' failed
make[1]: *** [CMakeFiles/apfs-fuse.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2
localuser@macbookpro17inch:~/apfs-fuse.build/apfs-fuse/build$ cmake ..
-- Configuring done
-- Generating done
-- Build files have been written to: /home/localuser/apfs-fuse.build/apfs-fuse/build
localuser@macbookpro17inch:~/apfs-fuse.build/apfs-fuse/build$ ccmake .
Command 'ccmake' not found, but can be installed with:
sudo apt install cmake-curses-gui
localuser@macbookpro17inch:~/apfs-fuse.build/apfs-fuse/build$ sudo apt install cmake-curses-gui
Reading package lists... 0%
...
[####################################################################..............]
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
#####
## Now we run ccmake to disable FUSE 3 library and use FUSE 2 library instead
####
localuser@macbookpro17inch:~/apfs-fuse.build/apfs-fuse/build$ ccmake .
#####
## AT this point, curses-based ccmake launches. Do the following:
## - Navigate to USE_FUSE3, and if it is not set to OFF, hit enter
## - Press c to configure
## - Press g to generate Makefile and exit ccmake
##
## Ref: response by Simon Gander (sgan81) at https://github.com/sgan81/apfs-fuse/issues/87
####
localuser@macbookpro17inch:~/apfs-fuse.build/apfs-fuse/build$ make clean
localuser@macbookpro17inch:~/apfs-fuse.build/apfs-fuse/build$ make
[ 2%]
Building C object CMakeFiles/lzfse.dir/3rdparty/lzfse/src/lzfse_decode.c.o
In file included from
/home/localuser/apfs-fuse.build/apfs-fuse/3rdparty/lzfse/src/lzfse_internal.h:30:0
from
/home/localuser/apfs-fuse.build/apfs-fuse/3rdparty/lzfse/src/lzfse_decode.c:25
...
...
Linking CXX executable apfsutil
[100%] Built target apfsutil
localuser@macbookpro17inch:~/apfs-fuse.build/apfs-fuse/build$ ls -lrt
total 2396
-rw-rw-r-- 1 localuser localuser 3116 Feb 13 13:57 cmake_install.cmake
-rw-rw-r-- 1 localuser localuser 15954 Feb 13 14:04 CMakeCache.txt
-rw-rw-r-- 1 localuser localuser 47562 Feb 13 14:04 Makefile
-rw-rw-r-- 1 localuser localuser 58358 Feb 13 14:04 liblzfse.a
-rw-rw-r-- 1 localuser localuser 655208 Feb 13 14:05 libapfs.a
-rwxrwxr-x 1 localuser localuser 410992 Feb 13 14:05 mapfs-dump
-rwxrwxr-x 1 localuser localuser 443648 Feb 13 14:05 mapfs-fuse
-rwxrwxr-x 1 localuser localuser 397960 Feb 13 14:05 mapfs-dump-quick
-rwxrwxr-x 1 localuser localuser 397488 Feb 13 14:05 mapfsutil
drwxrwxr-x 10 localuser localuser 4096 Feb 13 14:05 CMakeFiles
localuser@macbookpro17inch:~/apfs-fuse.build/apfs-fuse/build$ sudo cp apfs-* /usr/local/bin
localuser@macbookpro17inch:~/apfs-fuse.build/apfs-fuse/build$ sudo cp apfsutil /usr/local/bin
localuser@macbookpro17inch:~/apfs-fuse.build/apfs-fuse/build$ sudo fdisk -l
...
...
Disk /dev/sda: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 084E7565-6EF5-4A47-98B6-CABDA6CA8B4D
Device Start End Sectors Size Type
/dev/sda1 40 409639 409600 200M EFI System
/dev/sda2 409640 488688511 488278872 232.8G unknown
/dev/sda3 488688512 976967383 488278872 232.8G Linux filesystem
/dev/sda4 976967384 1953525127 976557744 465.7G unknown
#####
## The Mac OS X APFS partition is /dev/sda2
## I know this because I have only two 250GB partitions, and /dev/sda2 is of Type "unknown".
#####
localuser@macbookpro17inch:~/apfs-fuse.build/apfs-fuse/build$ sudo mkdir /macos-filesystem # This is the mount-point for the APFS partition
localuser@macbookpro17inch:~/apfs-fuse.build/apfs-fuse/build$ sudo apfs-fuse -o ro,allow_other /dev/sda2 /macos-filesystem # Run a mount command for testing
localuser@macbookpro17inch:~/apfs-fuse.build/apfs-fuse/build$ mount
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
...
/dev/sda2 on /macos-filesystem type fuse (ro,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other)
# Mount is successful
localuser@macbookpro17inch:~/apfs-fuse.build/apfs-fuse/build$ ls -l /macos-filesystem/root/Users/localuser
total 0
drwx------ 1 502 dialout 2 Feb 1 03:02 Applications
...
...
drwxr-xr-x 1 502 dialout 2 Feb 1 02:05 Public
# Unmount it
localuser@macbookpro17inch:~/apfs-fuse.build/apfs-fuse/build$ sudo fusermount -u /macos-filesystem
localuser@macbookpro17inch:~/apfs-fuse.build/apfs-fuse/build$ sync
localuser@macbookpro17inch:~/apfs-fuse.build/apfs-fuse/build$ # "Making it stick"
localuser@macbookpro17inch:~/apfs-fuse.build/apfs-fuse/build$ sudo ln -s /usr/local/bin/apfs-fuse /usr/sbin/mount.apfs
localuser@macbookpro17inch:~/apfs-fuse.build/apfs-fuse/build$ sudo cp /etc/fstab /etc/fstab.orig
localuser@macbookpro17inch:~/apfs-fuse.build/apfs-fuse/build$ sudo vi /etc/fstab
#####
## Now add the following line at the bottom:
## mount.apfs#/dev/sda2 /macos-filesystem fuse ro,noexec,userr,allow_other 0 0
#####
#####
## Test mount from /etc/fstab
#####
localuser@macbookpro17inch:~/apfs-fuse.build/apfs-fuse/build$ sudo mount -a
localuser@macbookpro17inch:~/apfs-fuse.build/apfs-fuse/build$ mount
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
...
/dev/sda3 on / type ext4 (rw,relatime,errors=remount-ro)
...
/dev/sda2 on /macos-filesystem type fuse (ro,nosuid,nodev,noexec,relatime,user_id=0,group_id=0,allow_other)
localuser@macbookpro17inch:~/apfs-fuse.build/apfs-fuse/build$ ls -l /macos-filesystem/
total 0
drw-r--r-- 1 root root 0 Feb 13 10:42 private-dir
drwxr-xr-x 1 root root 28 Feb 2 00:42 root
localuser@macbookpro17inch:~/apfs-fuse.build/apfs-fuse/build$ ls -l /macos-filesystem/root/Users/localuser/
total 0
drwx------ 1 502 dialout 2 Feb 1 03:02 Applications
...
drwxr-xr-x 1 502 dialout 2 Feb 1 02:05 Public



Notes on taking image backup and restoring dual-boot Mac OS X and Ubuntu storage



I use Clonezilla for taking disk image backups of all of my systems at SANYALnet Labs.


Zeroing out free space for better disk image compression (smaller backup size)



It is necessary to zero out unused hard disk / SSD storage space to minimize Clonezilla image backup sizes. For my MacBook pro, I have three partitions that I have to zerofree.

MacBook Pro Dual-Boot Hard Disk SSD Partitioning


The first partition in blue is the MacOS X APFS partition. The second partition in pink is my Linux ext4 partition. The third partition in orange is an unused empty partition for future use which I formatted to exFAT for now.


Zero Out Free Space on MacOS X APFS and Unused Disk Partitions



MacOS X - Zero Free disk space


The Disk Utility command-line tool included with MacOS X is capable of wiping unused disk space by writing zeroes. To identify the partition names to run the tool on, simply do a:

$ ls -l /Volumes
total 256
lrwxr-xr-x  1 root    wheel       1 Feb 15 16:47 Macintosh HD -> /
drwxrwxrwx  1 localuser  staff  131072 Jan  1  1980 unused

This tells me I can use the Disk Utility to zerofree unused space on MacOS X APFS filesystem volume "Macintosh HD" as well as unused exFAT space volume "unused". In the "diskutil secureErase" commands below, the "freespace" parameter indicates we want to only overwrite free disk space without affecting existing files, and the level parameter "0" indicates we want to overwrite with just zeroes without performing more stringent multi-pattern secure disk wipe operations.

$ diskutil secureErase freespace 0 /Volumes/Macintosh\ HD
$ diskutil secureErase freespace 0 /Volumes/unused

Zero Out Free Space on Linux ext4 Partition


To zero out unused space on the Linux ext4 file system, boot into Linux and execute the usual simple shell script for zerofree. Everything in my Linux partition is under the file system's root directory ("/"), so this works fine.

#!/bin/bash
# ---
# zerofree.sh (Ubuntu MATE 18.04 on Apple MacBook Pro 17")
#
# Zeroes Out Unused Disk Space for subsequent image backup
# To execute: ./zerofree.sh
#
# Supratim Sanyal - supratim at riseup dot net
# See http://supratim-sanyal.blogspot.com/2016/12/zero-out-free-disk-space-on-virtual.html
# ---
cd /tmp/
cat /dev/zero > zero.delete-me
sync;sync;sync
#
rm -fv zero.delete-me 
sync;sync;sync
exit 0

Taking Clonezilla Live Disk Image Backup


I use a 2 TB external USB hard disk as Clonezilla disk image repository on which a 500 MB partition has bootable Clonezilla Live. The remaining 1.95 TB space is in a 2nd NTFS partition used to save the disk images after booting from Clonezilla Live from the first partition.

When preparing your Clonezilla USB boot disk, make sure you download the AMD64 version of Ubuntu-based Clonezilla Live. This is required to support the uEFI boot architecture used by modern Apple Macintoshes. If you are unfamiliar with Clonezilla, instructions for preparing a Clonezilla Live USB boot disk are available here.

As of this post, I am using the Disco release of Clonezilla Live AMD64 Alternate Ubuntu edition.

Insert the external Clonezilla USB boot disk, and power the MacBook Pro on. As soon as you hear the chime, hold down the Option (alt) key. Then use the MacBook Pro's boot device selection screen to boot from uEFI partition on the USB drive. Nothing will seem to happen for a little while but Clonezilla Live will eventually boot and start (patience!).

Follow the Clonezilla Live menu system to create a whole-disk image backup on the other bigger partition of the external USB disk. Since Clonezilla does not understand the APFS file system yet, it will take a raw backup of the entire partition. Clonezilla will, however, handle the ext4 and exFAT partitions correctly. Since we zeroed out unused space on all partitions, the backup size will pretty much be the smallest you can get (it is in the range of 64 GB total for my three partitions, but obviously it depends on how much data you actually have).

When backup is complete, use the Clonezilla Live prompt to power the computer off and remove USB storage devices. You can power the MacBook Pro back up at this point and boot into either Linux or MacOS X as you wish usung rEFInd boot manager.


Restoring from Clonezilla Live Disk Image Backup


This is where things get tricky if you are not careful.

On attempting a disk restore operation from the disk image using Beginner Mode settings, Clonezilla Live realized there is an ext4 partition, assumed a Linux system and left me with a unbootable computer. It turns out Clonezilla Live does funky things to the GPT (GUID Partition Table) like generating a initrd, write an MBR and, worst of all, change the GUID of my MacOS X partition to FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF.

Corrupted GPT after CloneZilla Live Disk Restore
Bad Corrupted GPT after CloneZilla Live Disk Restore in Beginner Mode with default options

Luckily, my MacBook Pro's symptoms were close enough to the issue discussed here for the solution to work.

To avoid such a situation, choose the Expert Mode of operation of Clonezilla Live when restoring the image backup, and make sure:

(A) the following checkbox is checked:

[*] Do not update syslinux-related files after restoring

(B) the following checkbox is not checked:

[ ] Write MBR (512 B) again after image is restored

CloneZilla Live advanced parameters for restoring mode
CloneZilla Live expert mode parameters for restore operation (Source: CloneZilla official documentation)

What to do if the EFI boot table is corrupted resulting in unbootable system


If, due to a faulty Clonezilla Live disk restore operation, the system becomes non-bootable, this post at stackexchange answered by klanomath and edited by David Anderson will rescue you. I am reproducing the information from there below, just in case the original post disappears. My MacOS X partition (disk0s2) is the same as that post, so no adjustment was needed there. But I did have to adjust the Start and Size numbers based on my 250 GB partitions which are different from the post. The steps below are to be performed with the MacBook Pro in Internet Recovery Mode activated by holding down Command (⌘), Option (alt) and R keys at the power-on chime.

The proper GUID of APFS partitions is 7C3457EF-0000-11AA-AA11-00306543ECAC.
To get your APFS partition back remove partition disk0s2 and restore it with the proper type: 
Open in the menubar > Utilities > Terminal
get some details: 
diskutil list #below I assume the disk identifier of the internal disk is disk0
gpt -r show disk0 
Unmount disk0: 
diskutil umountDisk disk0 
remove and restore the 2nd partition: 
gpt remove -i 2 disk0
diskutil umountDisk disk0
gpt add -i 2 -b 409640 -s 372637568 -t 7C3457EF-0000-11AA-AA11-00306543ECAC disk0
 
verify disk and partition: 
diskutil list
diskutil verifyDisk disk0
diskutil verifyVolume disk0s2 
Your Mac should be able to boot despite the MBR.

If you want (or have) to restore the pMBR because the MBR is stubborn/blocks the modification of the partition table do the following: 
get all disk details: 
diskutil list #below I assume the disk identifier of the internal disk is disk0
gpt -r show disk0 
replace the GUID partition table: 
diskutil umountDisk disk0
gpt destroy disk0
gpt create -f disk0 
re-add all previous partitions visible in the last gpt -r show disk0 output:
gpt add -i 1 -b 40 -s 409600 -t C12A7328-F81F-11D2-BA4B-00A0C93EC93B disk0
gpt add -i 2 -b 409640 -s 372637568 -t 7C3457EF-0000-11AA-AA11-00306543ECAC disk0
gpt add -i 3 -b 373047208 -s 262144 -t 426F6F74-0000-11AA-AA11-00306543ECAC disk0
gpt add -i 4 ...
gpt add -i 5 ... 
If you get a resource busy error after one of the steps, just unmount disk0 again with 
diskutil umountDisk /dev/disk0 
Finally verify disk and partitions: 
diskutil list
diskutil verifyDisk disk0
diskutil verifyVolume disk0s1
diskutil verifyVolume disk0s2
diskutil verifyVolume disk0s3
#disk0s4 & disk0s5 can't be verified with the default macOS tools because the latter is a Linux swap and the former a Linux partition, probably with ext4

Recommended Products from Amazon