Migrated the ThinkPad X201 to FreeBSD
=====================================

The ThinkPad X201 is my daily driver.
-------------------------------------
I own two ThinkPads:

* X201: Intel Core i5 M 520, 8 Gb RAM, 12 inch 1280x800 display
* X270: Intel Core i5-7300U, 16 Gb RAM, 12 inch 1920x1080 display

Like all ThinkPads. both the X201 and the X270 have a TrackPoint,
which I think is a brilliant solution.

I use the X201 on a daily basis, it has become my so-called
daily driver.

I love this little machine and specially its keyboard, which is a
classic ThinkPad keyboard.

From the moment I got the X201, I use my X270 a lot less and
mostly boot the X270 up when I want to use one or two virtual
machines on it, running in bhyve.

OpenBSD
-------
I bought the X201 refurbished in February 2023. In the time
between ordering and the delivery, I prepared an USB memory stick
to test the machine with upon delivery.

The fastest way is an OpenBSD install image, because of the
small size of this image.

Compare this:

696745984 OpenBSD install74.img
1360155136 FreeBSD-14.0-RELEASE-amd64-memstick.img

I downloaded an OpenBSD install image (probably 7.2) and dd-ed
that to a memory stick. After the delivery of the X201, I put in
the stick with the OpenBSD install image and booted. Everything
seemed to work and I installed OpenBSD on it.

Installing OpenBSD is very easy, and it comes completely with X
and so on. The X201 ran smoothly on it, so I added Ratpoison as
window manager and started using the laptop.

Because everything worked fine, I kept it this way, just doing
the updates when they became available.

Virtual machines
----------------
I bought the X201 with 4 Gb RAM. I tried to run a virtual machine
on it, using vmm and vmctl. OpenBSD vmm only offers a virtual
serial connection to your VM's, until the virtual machine gets it
network connection. Because of this, I tend to use the hypervisor
only to run OpenBSD VM's.

I started to use the OpenBSD virtual machines for testing purposes
and this worked fine. Because of that, I extended the memory to
8 GB RAM.

FreeBSD vs OpenBSD
------------------
OpenBSD is a wonderful operating system. To me it seems the most
aesthetic OS, it is very clean. The configuration for example, is
only done in the /etc directory. It has good hardware support,
and most things work right out of the box.

Of course there are some trade offs, everything has its pro's and
cons.

* OpenBSD doesn't have ZFS or some equivalent of it.
* OpenBSD doesn't support container technology.
* The hypervisor is less user friendly because of the serial
 connection restriction.

FreeBSD is just as light weight as OpenBSD, both run fine on
limited hardware. FreeBSD is not as clean as OpenBSD. For
example, the configuration is scattered over /boot, /etc, and
/usr/local/etc. X is not part of the OS, you have to install the
Xorg package.

FreeBSD supports container technology for a very long time, the
FreeBSD jails have a long history. The bhyve hypervisor is
friendlier, and with the vm-bhyve package very easy to use.

FreeBSD supports the ZFS filesystem for quite some years, this
includes using ZFS as root filesystem and booting from it.

ZFS
---
I have never run ZFS on multiple disks or multiple SSD's or made
use of the more advanced features. My only experience with boot
environments comes from the time when I was playing with
OpenSolaris, just before Oracle pulled the plug out of
OpenSolaris.

I do like the options to snapshot, rollback and clone that ZFS
offers. Also I appreciate the ZFS send and receive feature.

Moving to ZFS was the main reason to start thinking about moving to
FreeBSD on my X201.

Conversion
----------
To have a kind of fall back before overwriting the OpenBSD disk,
I rsynced the /etc directory and the /proto/home directory (which
is used to populate $HOME in MFS) to another machine, dd-ed the
FreeBSD install image to a memory stick and rebooted the X201.

After installation, I set up some extra ZFS datasets and
installed some packages, like Xorg, the ratpoison window manager,
the lynx and links web browsers, and so on.

Currently Emacs is compiling, after this is finished, I am
back in business.

The next few days will show where perhaps some extra tuning
is needed and how the system functions as a daily driver.


Last edited: $Date: 2023/12/22 20:09:46 $