This is an installer for Alpine linux with ZFS as root filesystem, and ZFSBootMenu to boot into different environments.
Since installing Alpine with ZFS and ZfsBootmenu needs a whole tutorial with many steps, we've created this easy installer.
- Fastest and easiest way to install Alpine on ZFS
- Uses the excellent ZFS filesystem.
- ZFSBootMenu as bootloader, which allows you to rollback in case of failed upgrades.
- After installing it can boot both in BIOS mode and UEFI mode.
- Perfect for running docker.
- Also easy to install at VPS providers that do not provide an Alpine installer.
- Install time is about 1 minute.
Alpine is one of the best and cleanest Linux distros out there, for running Docker and various other stuff. Packages like the Linux kernel, ZFS support and Docker are very up to date but also very stable.
Its super small, fast and simple. Its not the most versatile distribution, but what it does, it does very well.
Also upgrading to newer releases is quick and painless, in contrast to other distro's. And since we use snapshots before upgrading, its easy to roll back should there be a problem.
For this reason all our boxes run Alpine and just auto-upgrade and reboot every week without problems.
Installation by just writing the official image to the disk is the easiest way:
- Boot any Linux distro via CD, USB. Or use a rescue-boot if you use some kind of VPS hosting provider. (example screenshot below)
- Download the imager:
# wget https://boot.datux.nl/image
NOTE: This is just a redirect to https://raw.githubusercontent.com/psy0rz/alpinebox/master/install/installimage.sh
- Start the imager and specify your harddisk:
# bash image /dev/sda
This should download and reboot, and you're basically done :)
Here are some specific VPS provider tips on how to get into an environment to start the installer:
- Hetzner: Via the Hetzner console request a Rescue boot. See this screenshot.
- TransIP: Open de console screen in popup-mode and choose to boot linux in Rescue mode. See this screenshot.
Once you've entered the rescue environment, you can use the Alpinebox installer mentioned above.
Note: Some provider require a powercycle or reset, after the installer. (normal reboot doesnt work)
There is no root-password for console logins. However, for ssh you will need to add your keys.
Since it's an image, you will need to grow the partition and zfs disk:
Just run grow-disks
script in /root/alpinebox, and it should be handled automaticly without a reboot even.
Do this as soon as possible, since its a somewhat risky operation
To add a disk to the zpool as a mirror, just run the add-disk
script in /root/alpinebox
This will also make sure that the disk has the correction partitioning, MBR/UEFI and ZfsBootmenu stuff. So that if the first disk completely fails, you can still boot from this one.
Make sure you remove any non-ONLINE disks from the pool first.
To make backups via ZFS replication, check out my other project: https://pypi.org/project/zfs-autobackup/
Now everytime you need to do a bunch of Alpine upgrade, just run something like: zfs snapshot rpool/ROOT@upgrades1
If the upgrade fails you can rollback via the ZfsBootmenu.
If you dont like the imaging method above, you can also use the official Alpine ISO and our install scripts:
Get and boot a matching Alpine version: https://alpinelinux.org/downloads/
Note: Should be the extended edition, since that one has ZFS support.
Get you network configured with:
setup-interfaces -r
wget https://boot.datux.nl/install
sh install /dev/sda
This will partition/format/install and reboot.
Look in the devtools directory. With createimage.sh
you can create your own image.
Run it from an Alpine ISO or installation.
You might need to install some dependencies first if something fails.
See https://github.com/csachs/docker-zfs-plugin
Based on this excellent tutorial: https://docs.zfsbootmenu.org/en/v2.3.x/guides/alpine/uefi.html