evanjon.es

Multi Machine Single User Computing Consistency

A screenshort from the anime Serial Experiments Lain. Lain sitting at her NAVI.

Intro

I've been long agitated by various methods of keeping $HOME in sync across computers. For the past few weeks I’ve been using a setup I see myself continuing to use into the future. Thought I would write down what I’ve been doing and how it’s been.

Before we get into the details I’ve made a tradeoff I don’t think the average computer user would be willing to make: my operating system is ran from a flash drive. When I wake up in the morning I remove my flash drive from my desktop and throw it in my book bag with my laptop. When I use my laptop in public it always has the flash drive hanging out of a port. When I get home I remove the flash drive from my book bag and plug it back into my computer.

This does have the nice property of being able to swallow my entire operating system if police enforcements attempt to coerce me into gaining access to my data. Not that I have anything to hide…

Privacy is a good.

Goals

  1. I want my computer users and the softwares available between them to be the same across machines
  2. I want a painless way to create backup and send them off site.
  3. I want a painless way to restore from backup quickly.
  4. I want my data encrypted.

Failures

  1. I want my data encrypted.

Unforuntely ZFS on Linux 0.8.2 doesn’t play well with bootloaders… Filesystem not found. Everything else has been smooth sailing since it’s been setup.

I've installed Arch Linux on a 64GB flash drive on ZFS.

Setup

To install Arch with ZFS you need an ISO with support for ZFS built in or you will quickly run out of room on your ISO. Once you get the hang of creating your own ISO it’s a pain free process. As always Arch’s wiki is great for this.

The high level steps are:

  1. Install archiso.
  2. Copy a config from /usr/share/archiso/configs/, probably releng.
  3. Tweak the resulting pacman.conf and packages.x86_64 to your liking. You’ll want to make sure you’re installing zfs-linux via the archzfs unofficial repo. More info here.
  4. ./build.sh the ISO and dd!

After you’ve booted into your ISO you’ll need to get your drives ready. Pacstrap. The normal things after this.

BUT

Don’t try to encrypt your ZFS root yet. You won’t be able to install a bootloader on ZFS on Linux 0.8.2. :(

Once again, the Arch wiki is superb on this. Chere here.

After your first boot and Systemd related things you’re ready to install your window manager, editors, and web browsers. Sweet.

Backups and Restores

ZFS is truly great for backup and restores. After my first boot I got to writing a custom Systemd service that runs a Bash script I wrote. Basically, on boot and on sleep i check if an external drive of mine is available with a collection of fdisk, sed, and awk commands. If so, mounted it zfs snap..., zfs send... the data over, lastly unmount. Restoring from here are simple zfs recv... and/or zfs rollback.

I need to get some TBs over at my parent’s place so I can get so off site backups going. Yay Thanksgiving.

Looking forward

I spent a solid day getting to the point where I was confident that it was due to an encrypted ZFS root that I couldn’t install a bootloader. I’m sure this will be fixed soon. Even after it’s fixed I wouldn’t recommend installing this the Arch way. Check ALEZ out. They’ll soon have support for setting up an encrypted ZFS root for you. Use ALEZ. I will be.

End

That’s all I have for now. Although, it’s annoying having a flash drive to carry around I have my exact development enviroment with my everywhere I go. All my keys, all my media, all my bookmarks. Best of all I don’t have to rely on any remote servers of $BIGCO or my own. Wish I could implant it in my body somehow and keep it usable.