LinuxCommandLibrary

lbu

Backup and restore Alpine Linux configuration

TLDR

Commit changes to persistent storage (only files in /etc by default)

$ lbu [[ci|commit]]
copy

List files that would be saved using commit
$ lbu [[st|status]]
copy

Display changes in tracked files that would be saved using commit
$ lbu diff
copy

Include a specific file or directory in the apk overlay
$ lbu [[inc|include]] [path/to/file_or_directory]
copy

Exclude a specific file or directory in /etc from the apk overlay
$ lbu [[ex|exclude]] [path/to/file_or_directory]
copy

Display the list of manually included/excluded files
$ lbu [include|exclude] -l
copy

List backups (previously created overlays)
$ lbu [[lb|list-backup]]
copy

Revert to a backup overlay
$ lbu revert [overlay_filename.tar.gz]
copy

SYNOPSIS

lbu <command> [options] [arguments...]

Common commands:
lbu commit [module_name]
lbu update [module_name]
lbu info
lbu build module_name [source_path]
lbu convert package_file
lbu add module_name file_or_directory
lbu remove module_name file_or_directory
lbu --help

PARAMETERS

commit [module_name]
    Saves all current changes made to the live system into a new or specified existing `.xzm` module. If no module name is provided, changes are saved to the default porteus_changes.xzm.

update [module_name]
    Applies system updates and pending changes to an existing `.xzm` module, typically used for persistent changes. Similar to commit but implies updating an existing state.

info
    Displays detailed information about currently loaded Porteus modules, pending changes, and system persistence status.

build module_name [source_path]
    Creates a new `.xzm` module. Can build from an existing directory (source_path) or from installed packages if source_path is omitted and used with other options (e.g., from installed Slackware packages).

convert package_file
    Converts a specified package file (e.g., `.deb`, `.rpm`, `.tgz`) into a Porteus-compatible `.xzm` module, making it easy to integrate software from other distributions.

add module_name file_or_directory
    Adds specific files or directories to an existing `.xzm` module, allowing for granular module content management.

remove module_name file_or_directory
    Removes specific files or directories from an existing `.xzm` module.

--help
    Displays the help message and available commands for lbu.

DESCRIPTION

lbu is a critical utility in Porteus Linux, specifically designed to manage the distribution's unique modular architecture. Porteus operates by loading a base system and then overlaying various SquashFS modules (traditionally `.xzm` files) which contain applications, drivers, or system modifications. The lbu command allows users to convert persistent changes made during a live session into a new `.xzm` module, update existing modules, create new ones from installed packages, and manage the boot process's module loading order. This tool is fundamental for maintaining a persistent state on live USB drives or CDs, enabling users to install software, apply updates, and configure their system, then save these changes back into a reloadable module. It facilitates a lightweight, fast, and highly customizable experience, ensuring that changes are saved efficiently without modifying the base system image directly. It's often used post-installation to "save changes" to a module for future sessions.

CAVEATS

The lbu command is exclusive to Porteus Linux and will not function on other Linux distributions due to its reliance on Porteus's unique modular system and SquashFS `.xzm` modules. Improper usage, especially with commit or update, can lead to loss of unsaved changes or corrupt module files. Always ensure sufficient disk space when creating or modifying modules.

MODULE SYSTEM (.XZM FILES)

Porteus Linux uses a modular system where most software and system components are stored in compressed read-only `.xzm` (SquashFS) files. lbu is the primary tool for managing these modules, allowing users to save, update, and create new ones. This modular approach makes Porteus highly flexible, easy to update, and efficient in terms of disk space and boot time.

PERSISTENCE IN PORTEUS

For live USB/CD installations, lbu is crucial for achieving persistence. When a user makes changes (installs software, modifies configurations) during a live session, lbu commit or lbu update is used to save these changes into a persistent `.xzm` module (e.g., porteus_changes.xzm) which is then loaded automatically on subsequent boots, preserving the system state.

HISTORY

lbu was developed as a core utility for Porteus Linux from its inception, designed to facilitate the distribution's unique modular and live-bootable nature. Its primary purpose has always been to manage the creation, update, and persistence of `.xzm` modules, which are central to Porteus's lightweight and customizable design. Over the years, its functionality has expanded to include convenient package conversion utilities, making it easier for users to integrate software from other distributions into their Porteus environment.

SEE ALSO

Copied to clipboard