{"title":"Alpine Linux LBU","url":"https://seanbehan.ca/posts/alpine-lbu","description":"Alpine can commit changes back onto its own live ISO. Using LBU to build a persistent maintenance drive.","author":"Sean Behan","published":"2020-12-04T03:09:46.000Z","updated":null,"draft":false,"tags":["alpine","linux"],"readingMinutes":2,"image":null,"sections":[{"id":"what-is-lbu","text":"What is LBU?","level":2},{"id":"setup-and-committing","text":"Setup and Committing","level":2},{"id":"caching-and-configuration","text":"Caching and Configuration","level":2}],"content_format":"text/markdown","content_url":"https://seanbehan.ca/posts/alpine-lbu.md","content":"### What is LBU?\n\nAlpine Linux has a cool feature called LBU that lets you create a backup on top\n\nof the Live ISO. These backups are called local backups.\n\nI plan on using LBU as a system maintenance drive. It allows you to save\n\nchanges you make to the Live ISO and restore them automatically when you boot\n\nthe next time.\n\n### Setup and Committing\n\nTo set up LBU I booted the Alpine Linux ISO, ran `setup-alpine`, mounted my\n\ndrive to `/media/alpine_usb` and when I got to the disk selection I selected no\n\ndisk, and `alpine_usb` as where to store the configs, and the default for\n\ncache.\n\nNow when I make changes in the Alpine Linux Live ISO I can commit them.\n\nTo see what is being committed I first check `lbu status` which lists all the\n\nfiles being added or removed, then `lbu commit` to commit the changes.\n\nWhen I was rebooting I had an issue where the drive would automount itself to\n\n/media/sdb and then wouldn't work with lbu when I wanted to commit or check the\n\nstatus because it was already mounted. To fix this I just had to `umount\n\n/dev/sdb` on boot and then lbu worked as expected.\n\n### Caching and Configuration\n\nTo use cache you have to mount it to `/media/alpine_usb` so that it can write\n\nthe cache files when you're installing packages. I want this because it makes\n\nreinstalling my packages on reboot a lot faster, they can just be loaded from\n\ncache instead of from online repositories.\n\nUpon reboot I had to reinstall all the packages I had installed using `apk\n\nupgrade` but since the cache is there it just installs everything really\n\nquickly.\n\nI uncommented and changed the number of backups in `/etc/lbu/lbu.conf` to 20 so\n\nthat I would be able to revert up to 20 commits in case I broke my configs.\n\nI see Alpine LBU as a good way to keep a backup of changes to the ISO so it\n\ncould be used as a system recovery disk with the tools that are needed.\n"}