openSUSE tips

Table of Contents

I installed openSUSE Tumbleweed on a 2011 Macbook Pro (now running as my home laptop). Here's some notes from the experience.

1 Installation

Get yourself an wired Internet connection before installing, because we'll need to install a special wifi driver

1.1 Partitioning

To dual boot, partition the disk by booting into the Mac's recovery mode (hold Command+R on boot) and use the Disk Utility GUI.

openSUSE is less greedy for disk space than macOS, so if you can get away with as little as 40GB for the Linux partition. For simplicity, create a single partition here and divide it into /, /home, /boot etc. in the openSUSE installer.

Note that you don't need refit or refind if you're happy to boot into Linux by default. If you hold Option on boot you can manually choose which disk to boot into.

Use the 'Expert partitioner' option in the openSUSE installer to create the following partitions from the Linux partition:

/boot/efi
500MB
/swap
size of your RAM
/ (root)
15GB 25GB
/var
25GB
/home
whatever's left

I haven't been using it that long, but the root partition has 50% space available so this should be plenty of room to grow. I had to grow my root partition from 15 to 25GB because eventually updates and snapshots ate all the space. I am increasingly aggressive with snapshot cleanup now but it still seems greedy. Various places suggest a 40GB root partition, which seems obscene when you're used to 8GB being enough, but is perhaps reasonable when using Snapper. The boot partition was probably way too large, since it has 99% space available. Obviously keeping your home partition separate will ease things if you ever do need to modify this setup.

I originally didn't have the 25GB var partition, but then docker suddenly dumped 5GB into /var/lib/docker and bang the space was gone. Attempting to move var to a new partition proved problematic because btrfs is not your grandfather's filesystem and you can't just mount, cp and edit fstab. I still have no clue what you're supposed to do with btrfs.

1.2 Snapper setup

1.2.1 Configuration

For some reason the following simple and necessary steps were not already prepared on my system. Perhaps because I dove into using expert partitioner before understanding Snapper and BTRFS.

  • Create a root config at /etc/snapper/configs/root (use snapper create-config if you don't have this)
  • Add the snapshots subvolume to /etc/fstab:
UUID=<uid of your *root* partition> /.snapshots          btrfs      subvol=@/.snapshots   0 0

You should then be able to use snapper rollback [id of snapshot] to rollback without problems in future. If you don't do the above, you can get stuck in a rollback, where snapper list is suddenly empty and trying to rollback results in weirdness like:

IO error (.snapshots is not a btrfs subvolume).

I learned this the hard way. To escape that situation, I did this:

sudo mount /dev/sdaN -o subvol=@/.snapshots /.snapshots

Where /dev/sdaN is your root partition. It's then possible to rollback again.

1.2.2 Disk space

Snapper is very greedy by default. If you're short on disk space you'll want to edit the config and do something like this:

  • change SPACE_LIMIT to "0.25" or lower
  • change all other *_LIMIT variables to a range (e.g. NUMBER_LIMIT to "2-8").
  • you'll probably want the DAILY/WEEKLY/MONTHLY/YEARLY timeline limits to be decreasing (because it's less likely you will want to roll back to a week ago and even less likely a month ago, etc.).

Then run snapper cleanup number && snapper cleanup timeline && snapper cleanup empty-pre-post. According to the docs this is set up as a cron job, but I couldn't find evidence of this so you may wish to do it manually.

1.3 Wifi

Unfortunately proprietary wifi drivers are required. You need two packages starting broadcom-wl from the third-party Packman repository. I was a bit suspicious of this at first because the opensuse.org wiki page on this linked to a domain like packages.inode.pl i.e. some unknown mirror. After searching online it turns out that Packman is a trusted repository of proprietary RPMs (largely drivers and codecs). For peace of mind, get the GPG key from the official Packman site and check before installing.

1.4 Touchpad

The touchpad works out of the box, but the default settings were way too sensitive for me. You can tweak these in Configure Desktop under Input Devices.

1.5 GPG

Set up KGPG early on, since a lot of programs seem to default to using your GPG key.

1.6 Updates

Disable the automatic software updates, as this can cause your system to diverge from the Tumbleweed distribution.

To disable in KDE:

  • context-click the system tray (notification area)
  • select System Tray Settings
  • uncheck Software Updates and apply the changes

Similarly, always use zypper dist-upgrade (dup) instead of zypper update (up). The reasoning is that the Tumbleweed distribution is actually a regular snapshot of a set of packages. If you use dup then you are sure to get packages from that snapshot. If you use up you may get different packages and find it difficult to reconcile with the snapshot. Also up doesn't clean up after itself, whereas dup does.

2 Errors

2.1 On system upgrade

I had a strange boot error after running zypper dup:

Failed to switch root: Specified switch root path '/sysroot' does not seem to be an OS tree. os-release file is missing

This solution from the Fedora forums worked for me:

mount -o remount,rw /sysroot
rm -rf /sysroot/etc/os-release
cp /usr/lib/os-release /sysroot/etc
exit

And then hard reboot (hold down power button).

2.2 From zypper

I seem to get this quite often:

Failed to cache rpm database (1)

The solution is just to run sudo rpmdb --rebuilddb.

2.3 Internet problems (DNS)

One day all Internet requests started timing out. I discovered I could reliably ping some IPs I remembered, but could not reliably visit anything by its URL. It turned out that my system was configured to use Yahoo's DNS nameservers, and these were mostly not responding. Resolved by updating /etc/resolv.conf with some nameservers from OpenDNS.

2.4 Snapper defaulting to old snapshot, can't cleanup

I rolled back from a failed zypper dup (disk space error) with snapper rollback 184 and all seemed well. However subsequently snapper cleanup number would fail with a useless "Deleting snapshot failed." message. Searching online, other people experienced this when they tried to delete their current snapshot, and lo and behold, my "current" snapshot was not the newest. My system was apparently stuck on the snapshot created by the rollback operation. Subsequent snapshots were being created, but not moved to.

The btrfs subvolume get-default command indicated the current snapshot was ID 546, number 232:

$ btrfs subvolume get-default /
ID 546 gen 15935 top level 282 path @/.snapshots/232/snapshot

A detailed look showed that this is indeed the case (the elided list of snapshots also matches up with snapper list):

$ btrfs subvolume show /
@/.snapshots/232/snapshot
    ...blah...
    Subvolume ID:       546
    ...blah...
    Parent ID:      282
    Top level ID:       282
    ...blah...
    Snapshot(s):
                @/.snapshots/233/snapshot
                @/.snapshots/234/snapshot
                ...blah...
                @/.snapshots/260/snapshot <--- actual newest snapshot

To escape this I've tried changing the default subvolume manually:

$ btrfs subvolume set-default 579 /

After a reboot I was able to create new snapshots, but it still didn't seem to be moving on. Jury's still out on how to fix this.

Author: Chris Bowdon

Created: 2018-05-01 Tue 20:55

Emacs 25.3.1 (Org mode 8.2.10)

Validate