<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.alpinelinux.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Andre</id>
	<title>Alpine Linux - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.alpinelinux.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Andre"/>
	<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/wiki/Special:Contributions/Andre"/>
	<updated>2026-04-28T12:49:22Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.40.0</generator>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Alpine_local_backup&amp;diff=10196</id>
		<title>Alpine local backup</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Alpine_local_backup&amp;diff=10196"/>
		<updated>2014-10-10T18:10:33Z</updated>

		<summary type="html">&lt;p&gt;Andre: /* Create a apkovl elsewhere than on some specific media */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Alpine itself only loads a few required packages when you boot a clean Alpine Linux.&amp;lt;BR&amp;gt;&lt;br /&gt;
But you probably want to do some personal adjustments (e.g [[Alpine_package_management|installing a package]] or doing some configuration).&amp;lt;BR&amp;gt;&lt;br /&gt;
Because Alpine runs on RAM (normally), and everything in RAM will get lost next time the box is rebooted or shut down, you will need to permanently save your modifications and adjustments to Alpine. This is where &#039;lbu&#039; comes in handy!&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
{{Note | If you installed Alpine on HDD you don&#039;t need to use &#039;lbu&#039;. All your modifications would be permanently stored on your HDD.}}&lt;br /&gt;
&lt;br /&gt;
First thing you need to know is this: &#039;&#039;&#039;As default &#039;lbu&#039; only cares about modifications in &#039;&#039;/etc/&#039;&#039; and it&#039;s subfolders, with the exception of /etc/init.d/!&#039;&#039;&#039; &amp;lt;BR&amp;gt;&lt;br /&gt;
Please have a look at &#039;[[#Include_special_files.2Ffolders_to_the_apkovl|lbu include]]&#039; to save files/folders located elsewhere than in &#039;&#039;/etc/&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Alpine has the following tools for permanently storing your modifications:&lt;br /&gt;
* lbu&lt;br /&gt;
* lbu commit &#039;&#039;(Same as &#039;lbu ci&#039;)&#039;&#039;&lt;br /&gt;
* lbu exclude &#039;&#039;(Same as &#039;lbu ex&#039;)&#039;&#039;&lt;br /&gt;
* lbu include &#039;&#039;(Same as &#039;lbu inc&#039;)&#039;&#039;&lt;br /&gt;
* lbu status &#039;&#039;(Same as &#039;lbu st&#039;)&#039;&#039;&lt;br /&gt;
* lbu list-backup &#039;&#039;(Same as &#039;lbu lb&#039;)&#039;&#039;&lt;br /&gt;
* lbu revert&lt;br /&gt;
&lt;br /&gt;
In the below examples you will find some characters with special meaning&lt;br /&gt;
* &#039;&#039;&#039;|&#039;&#039;&#039; = &#039;&#039;&#039;or&#039;&#039;&#039; &#039;&#039;(&#039;lbu commit|ci&#039; means that you can type ether &#039;lbu commit&#039; or &#039;lbu ci&#039;)&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;[ ]&#039;&#039;&#039; = &#039;&#039;&#039;optional&#039;&#039;&#039; &#039;&#039;(In &#039;lbu commit|ci [-nv]&#039; you can just skip the &#039;-n&#039;, &#039;-v&#039; or &#039;-nv&#039; part if you don&#039;t want it)&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Saving your changes ==&lt;br /&gt;
When you save your changes you will get a file that is named like &#039;myboxname.apkovl.tar.gz&#039; &#039;&#039;(&#039;myboxname&#039; will be the same as the hostname)&#039;&#039;.&amp;lt;BR&amp;gt;&lt;br /&gt;
This file (that contains your modifications) is called &#039;apkovl&#039;.&amp;lt;BR&amp;gt;&lt;br /&gt;
You will need to save your &#039;apkovl&#039; on some suitable media (floppy, usb, cf, other).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
usage: lbu commit|ci [-nv] [&amp;lt;media&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
Options:&lt;br /&gt;
  -d	Remove old apk overlay files.&lt;br /&gt;
  -e	Protect configuration with a password.&lt;br /&gt;
  -n	Don&#039;t commit, just show what would have been committed.&lt;br /&gt;
  -p &amp;lt;password&amp;gt;	Give encryption password on the command-line&lt;br /&gt;
  -v	Verbose mode.&lt;br /&gt;
&lt;br /&gt;
The following values for &amp;lt;media&amp;gt; is supported: floppy usb&lt;br /&gt;
If &amp;lt;media&amp;gt; is not specified, the environment variable LBU_MEDIA will be used.&lt;br /&gt;
&lt;br /&gt;
Password protection will use aes-256-cbc encryption. Other ciphers can be&lt;br /&gt;
used by setting the DEFAULT_CIPHER or ENCRYPTION environment variables.&lt;br /&gt;
For possible ciphers, try: openssl -v&lt;br /&gt;
&lt;br /&gt;
The password used to encrypt the file, can either be specified with the -p&lt;br /&gt;
option or using the PASSWORD environment variable.&lt;br /&gt;
&lt;br /&gt;
The environment variables can also be set in /etc/lbu/lbu.conf&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Include special files/folders to the apkovl ==&lt;br /&gt;
Assume that you have some files that you want to permanently save, but they are located somewhere else than in &#039;&#039;/etc/&#039;&#039;.&amp;lt;BR&amp;gt;&lt;br /&gt;
It could be &#039;&#039;/root/.ssh/authorized_keys&#039;&#039; (used by &#039;sshd&#039; to authenticate ssh-users).&amp;lt;BR&amp;gt;&lt;br /&gt;
Such files/folders can be added to the &#039;&#039;/etc/lbu/include&#039;&#039; list by manually editing the file or using the following command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
usage: lbu include|inc|add [-rv] &amp;lt;file&amp;gt; ...&lt;br /&gt;
       lbu include|inc|add [-v] -l&lt;br /&gt;
&lt;br /&gt;
Options:&lt;br /&gt;
  -l	List contents of include list.&lt;br /&gt;
  -r	Remove specified file(s) from include list instead of adding.&lt;br /&gt;
  -v	Verbose mode.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
{{Note| This command only modifies some lbu-related config files. You will need to run &#039;lbu commit&#039; to actually create/modify your apkovl.}}&lt;br /&gt;
&lt;br /&gt;
== Exclude specific files/folders from the apkovl ==&lt;br /&gt;
Assume that you have some files located in &#039;&#039;/etc/&#039;&#039; or one of it&#039;s subfolders that you &#039;&#039;&#039;do not&#039;&#039;&#039; want to permanently save.&amp;lt;BR&amp;gt;&lt;br /&gt;
It could be some log file or status file that for some reason is elsewhere than in &#039;&#039;/var/log&#039;&#039;.&amp;lt;BR&amp;gt;&lt;br /&gt;
Such files/folders can be added to the &#039;&#039;/etc/lbu/exclude&#039;&#039; list by manually editing the file or using the following command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
usage: lbu exclude|ex|delete [-rv] &amp;lt;file&amp;gt; ...&lt;br /&gt;
       lbu exclude|ex|delete [-v] -l&lt;br /&gt;
&lt;br /&gt;
Options:&lt;br /&gt;
  -l	List contents of exclude list.&lt;br /&gt;
  -r	Remove specified file(s) from exclude list instead of adding.&lt;br /&gt;
  -v	Verbose mode.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
{{Note| This command only modifies some lbu-related config files. You will need to run &#039;lbu commit&#039; to actually create/modify your apkovl.}}&lt;br /&gt;
&lt;br /&gt;
== Execute a script as part of a backup ==&lt;br /&gt;
&lt;br /&gt;
Sometimes it is necessary to run a script before or after a backup.  Scripts in two optional directories allow for this:&lt;br /&gt;
&lt;br /&gt;
 /etc/lbu/pre-package.d&lt;br /&gt;
 /etc/lbu/post-package.d&lt;br /&gt;
&lt;br /&gt;
Files in those directories are run using run-script rules (meaning they must have the executable bit set, they are run in alphabetical order, and cannot contain an &amp;quot;extension&amp;quot;  e.g. &#039;&#039;runme&#039;&#039; works,  &#039;&#039;runme.sh&#039;&#039; does not.)&lt;br /&gt;
&lt;br /&gt;
The scripts in pre-package.d are run before the apkovl is created; scripts inpost-package.d are run after the apkovl is created.&lt;br /&gt;
&lt;br /&gt;
=== Example ===&lt;br /&gt;
&lt;br /&gt;
Rather than adding the raw database directories to /etc/lbu/include, you can do a &amp;quot;database dump&amp;quot;.    For purposes of example, we use postgresql:&lt;br /&gt;
&lt;br /&gt;
* Add the database dump file to the list of files to back up: lbu include root/pgdatabases.gz&lt;br /&gt;
* Create /etc/lbu/pre-package.d/sqldump with the following contents: &amp;lt;code&amp;gt;pg_dumpall -U postgres | gzip -c &amp;gt;/root/pgdatabases.gz&amp;lt;/code&amp;gt;&lt;br /&gt;
* Mark the file executable: chmod +x /etc/lbu/pre-package.d/sqldump&lt;br /&gt;
* Create /etc/lbu/post-package.d/sqldumpdelete with the following contents: &amp;lt;code&amp;gt;rm -f /root/pgdatabases.gz&amp;lt;/code&amp;gt;&lt;br /&gt;
* Mark the file executable: chmod +x /etc/lbu/post-package.d/sqldumpdelete&lt;br /&gt;
&lt;br /&gt;
Now whenever you do a &#039;&#039;lbu commit&#039;&#039;, the sql databases are dumped and gzipped to /root/pgdatabases.gz, and then the temporary file is deleted at the end of the lbu commit.&lt;br /&gt;
&lt;br /&gt;
On a catastrophic restore, the databases are not automatically restored (that&#039;s not lbu&#039;s responsibility), but you will find a complete database dump in the /root directory, where it can be restored manually.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Check what will be added to your apkovl ==&lt;br /&gt;
Sometimes it would be handy to know what files will be permanently saved next time you run &#039;lbu commit&#039;. Here you have your help:&lt;br /&gt;
 usage: lbu list|ls&lt;br /&gt;
&lt;br /&gt;
== Create a apkovl elsewhere than on some specific media ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
usage: lbu package|pkg -v [&amp;lt;dirname&amp;gt;|&amp;lt;filename&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
Options:&lt;br /&gt;
  -v	Verbose mode.&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;dirname&amp;gt; is a directory, a package named &amp;lt;hostname&amp;gt;.apkovl.tar.gz will&lt;br /&gt;
be created in the specified directory.&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;filename&amp;gt; is specified, and is not a directory, a package with the&lt;br /&gt;
specified name will be created.&lt;br /&gt;
&lt;br /&gt;
If neither &amp;lt;dirname&amp;gt; nor &amp;lt;filename&amp;gt; is specified, a package named&lt;br /&gt;
&amp;lt;hostname&amp;gt;.apkovl.tar.gz will be created in current work directory.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Use SSH to create an apkovl on a different host ==&lt;br /&gt;
&lt;br /&gt;
To create an apkovl of client on a centralized server, use &amp;quot;-&amp;quot; as the apkovl name:&lt;br /&gt;
&lt;br /&gt;
On the server:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ssh root@client &amp;quot;lbu package -&amp;quot; &amp;gt;client.apkovl.tar.gz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Check what files have been changed since last commit ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
usage: lbu status|st [-av]&lt;br /&gt;
&lt;br /&gt;
Options:&lt;br /&gt;
  -a	Compare all files, not just since last commit.&lt;br /&gt;
  -v	Also show include and exclude lists.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Multiple Backups ==&lt;br /&gt;
Lbu can now keep backups so you can revert to older, good known config.&lt;br /&gt;
Set BACKUP_LIMIT in /etc/lbu/lbu.conf to the number of backups you want&lt;br /&gt;
to keep.&lt;br /&gt;
&lt;br /&gt;
You can list the current backups with:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|lbu list-backup [&amp;lt;media&amp;gt;]}}&lt;br /&gt;
&lt;br /&gt;
and you can revert to an older with:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|lbu revert &amp;lt;filename&amp;gt; [&amp;lt;media&amp;gt;]}}&lt;br /&gt;
&lt;br /&gt;
Note that when you revert, the current apkovl on media will be backed&lt;br /&gt;
up.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Back Up a Flash Memory Installation]]&lt;br /&gt;
* [[Manually editing a existing apkovl]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Installation]]&lt;br /&gt;
[[Category:Storage]]&lt;br /&gt;
[[Category:Booting]]&lt;br /&gt;
[[Category:Package Manager]]&lt;/div&gt;</summary>
		<author><name>Andre</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Alpine_local_backup&amp;diff=10195</id>
		<title>Alpine local backup</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Alpine_local_backup&amp;diff=10195"/>
		<updated>2014-10-10T18:05:57Z</updated>

		<summary type="html">&lt;p&gt;Andre: /* Create a apkovl elsewhere than on some specific media */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Alpine itself only loads a few required packages when you boot a clean Alpine Linux.&amp;lt;BR&amp;gt;&lt;br /&gt;
But you probably want to do some personal adjustments (e.g [[Alpine_package_management|installing a package]] or doing some configuration).&amp;lt;BR&amp;gt;&lt;br /&gt;
Because Alpine runs on RAM (normally), and everything in RAM will get lost next time the box is rebooted or shut down, you will need to permanently save your modifications and adjustments to Alpine. This is where &#039;lbu&#039; comes in handy!&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
{{Note | If you installed Alpine on HDD you don&#039;t need to use &#039;lbu&#039;. All your modifications would be permanently stored on your HDD.}}&lt;br /&gt;
&lt;br /&gt;
First thing you need to know is this: &#039;&#039;&#039;As default &#039;lbu&#039; only cares about modifications in &#039;&#039;/etc/&#039;&#039; and it&#039;s subfolders, with the exception of /etc/init.d/!&#039;&#039;&#039; &amp;lt;BR&amp;gt;&lt;br /&gt;
Please have a look at &#039;[[#Include_special_files.2Ffolders_to_the_apkovl|lbu include]]&#039; to save files/folders located elsewhere than in &#039;&#039;/etc/&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Alpine has the following tools for permanently storing your modifications:&lt;br /&gt;
* lbu&lt;br /&gt;
* lbu commit &#039;&#039;(Same as &#039;lbu ci&#039;)&#039;&#039;&lt;br /&gt;
* lbu exclude &#039;&#039;(Same as &#039;lbu ex&#039;)&#039;&#039;&lt;br /&gt;
* lbu include &#039;&#039;(Same as &#039;lbu inc&#039;)&#039;&#039;&lt;br /&gt;
* lbu status &#039;&#039;(Same as &#039;lbu st&#039;)&#039;&#039;&lt;br /&gt;
* lbu list-backup &#039;&#039;(Same as &#039;lbu lb&#039;)&#039;&#039;&lt;br /&gt;
* lbu revert&lt;br /&gt;
&lt;br /&gt;
In the below examples you will find some characters with special meaning&lt;br /&gt;
* &#039;&#039;&#039;|&#039;&#039;&#039; = &#039;&#039;&#039;or&#039;&#039;&#039; &#039;&#039;(&#039;lbu commit|ci&#039; means that you can type ether &#039;lbu commit&#039; or &#039;lbu ci&#039;)&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;[ ]&#039;&#039;&#039; = &#039;&#039;&#039;optional&#039;&#039;&#039; &#039;&#039;(In &#039;lbu commit|ci [-nv]&#039; you can just skip the &#039;-n&#039;, &#039;-v&#039; or &#039;-nv&#039; part if you don&#039;t want it)&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Saving your changes ==&lt;br /&gt;
When you save your changes you will get a file that is named like &#039;myboxname.apkovl.tar.gz&#039; &#039;&#039;(&#039;myboxname&#039; will be the same as the hostname)&#039;&#039;.&amp;lt;BR&amp;gt;&lt;br /&gt;
This file (that contains your modifications) is called &#039;apkovl&#039;.&amp;lt;BR&amp;gt;&lt;br /&gt;
You will need to save your &#039;apkovl&#039; on some suitable media (floppy, usb, cf, other).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
usage: lbu commit|ci [-nv] [&amp;lt;media&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
Options:&lt;br /&gt;
  -d	Remove old apk overlay files.&lt;br /&gt;
  -e	Protect configuration with a password.&lt;br /&gt;
  -n	Don&#039;t commit, just show what would have been committed.&lt;br /&gt;
  -p &amp;lt;password&amp;gt;	Give encryption password on the command-line&lt;br /&gt;
  -v	Verbose mode.&lt;br /&gt;
&lt;br /&gt;
The following values for &amp;lt;media&amp;gt; is supported: floppy usb&lt;br /&gt;
If &amp;lt;media&amp;gt; is not specified, the environment variable LBU_MEDIA will be used.&lt;br /&gt;
&lt;br /&gt;
Password protection will use aes-256-cbc encryption. Other ciphers can be&lt;br /&gt;
used by setting the DEFAULT_CIPHER or ENCRYPTION environment variables.&lt;br /&gt;
For possible ciphers, try: openssl -v&lt;br /&gt;
&lt;br /&gt;
The password used to encrypt the file, can either be specified with the -p&lt;br /&gt;
option or using the PASSWORD environment variable.&lt;br /&gt;
&lt;br /&gt;
The environment variables can also be set in /etc/lbu/lbu.conf&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Include special files/folders to the apkovl ==&lt;br /&gt;
Assume that you have some files that you want to permanently save, but they are located somewhere else than in &#039;&#039;/etc/&#039;&#039;.&amp;lt;BR&amp;gt;&lt;br /&gt;
It could be &#039;&#039;/root/.ssh/authorized_keys&#039;&#039; (used by &#039;sshd&#039; to authenticate ssh-users).&amp;lt;BR&amp;gt;&lt;br /&gt;
Such files/folders can be added to the &#039;&#039;/etc/lbu/include&#039;&#039; list by manually editing the file or using the following command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
usage: lbu include|inc|add [-rv] &amp;lt;file&amp;gt; ...&lt;br /&gt;
       lbu include|inc|add [-v] -l&lt;br /&gt;
&lt;br /&gt;
Options:&lt;br /&gt;
  -l	List contents of include list.&lt;br /&gt;
  -r	Remove specified file(s) from include list instead of adding.&lt;br /&gt;
  -v	Verbose mode.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
{{Note| This command only modifies some lbu-related config files. You will need to run &#039;lbu commit&#039; to actually create/modify your apkovl.}}&lt;br /&gt;
&lt;br /&gt;
== Exclude specific files/folders from the apkovl ==&lt;br /&gt;
Assume that you have some files located in &#039;&#039;/etc/&#039;&#039; or one of it&#039;s subfolders that you &#039;&#039;&#039;do not&#039;&#039;&#039; want to permanently save.&amp;lt;BR&amp;gt;&lt;br /&gt;
It could be some log file or status file that for some reason is elsewhere than in &#039;&#039;/var/log&#039;&#039;.&amp;lt;BR&amp;gt;&lt;br /&gt;
Such files/folders can be added to the &#039;&#039;/etc/lbu/exclude&#039;&#039; list by manually editing the file or using the following command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
usage: lbu exclude|ex|delete [-rv] &amp;lt;file&amp;gt; ...&lt;br /&gt;
       lbu exclude|ex|delete [-v] -l&lt;br /&gt;
&lt;br /&gt;
Options:&lt;br /&gt;
  -l	List contents of exclude list.&lt;br /&gt;
  -r	Remove specified file(s) from exclude list instead of adding.&lt;br /&gt;
  -v	Verbose mode.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
{{Note| This command only modifies some lbu-related config files. You will need to run &#039;lbu commit&#039; to actually create/modify your apkovl.}}&lt;br /&gt;
&lt;br /&gt;
== Execute a script as part of a backup ==&lt;br /&gt;
&lt;br /&gt;
Sometimes it is necessary to run a script before or after a backup.  Scripts in two optional directories allow for this:&lt;br /&gt;
&lt;br /&gt;
 /etc/lbu/pre-package.d&lt;br /&gt;
 /etc/lbu/post-package.d&lt;br /&gt;
&lt;br /&gt;
Files in those directories are run using run-script rules (meaning they must have the executable bit set, they are run in alphabetical order, and cannot contain an &amp;quot;extension&amp;quot;  e.g. &#039;&#039;runme&#039;&#039; works,  &#039;&#039;runme.sh&#039;&#039; does not.)&lt;br /&gt;
&lt;br /&gt;
The scripts in pre-package.d are run before the apkovl is created; scripts inpost-package.d are run after the apkovl is created.&lt;br /&gt;
&lt;br /&gt;
=== Example ===&lt;br /&gt;
&lt;br /&gt;
Rather than adding the raw database directories to /etc/lbu/include, you can do a &amp;quot;database dump&amp;quot;.    For purposes of example, we use postgresql:&lt;br /&gt;
&lt;br /&gt;
* Add the database dump file to the list of files to back up: lbu include root/pgdatabases.gz&lt;br /&gt;
* Create /etc/lbu/pre-package.d/sqldump with the following contents: &amp;lt;code&amp;gt;pg_dumpall -U postgres | gzip -c &amp;gt;/root/pgdatabases.gz&amp;lt;/code&amp;gt;&lt;br /&gt;
* Mark the file executable: chmod +x /etc/lbu/pre-package.d/sqldump&lt;br /&gt;
* Create /etc/lbu/post-package.d/sqldumpdelete with the following contents: &amp;lt;code&amp;gt;rm -f /root/pgdatabases.gz&amp;lt;/code&amp;gt;&lt;br /&gt;
* Mark the file executable: chmod +x /etc/lbu/post-package.d/sqldumpdelete&lt;br /&gt;
&lt;br /&gt;
Now whenever you do a &#039;&#039;lbu commit&#039;&#039;, the sql databases are dumped and gzipped to /root/pgdatabases.gz, and then the temporary file is deleted at the end of the lbu commit.&lt;br /&gt;
&lt;br /&gt;
On a catastrophic restore, the databases are not automatically restored (that&#039;s not lbu&#039;s responsibility), but you will find a complete database dump in the /root directory, where it can be restored manually.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Check what will be added to your apkovl ==&lt;br /&gt;
Sometimes it would be handy to know what files will be permanently saved next time you run &#039;lbu commit&#039;. Here you have your help:&lt;br /&gt;
 usage: lbu list|ls&lt;br /&gt;
&lt;br /&gt;
== Create a apkovl elsewhere than on some specific media ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
usage: lbu package|pkg -v [&amp;lt;dirname&amp;gt;|&amp;lt;filename&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
Options:&lt;br /&gt;
  -v	Verbose mode.&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;dirname&amp;gt; is a directory, a package named &amp;lt;hostname&amp;gt;.apkovl.tar.gz will&lt;br /&gt;
be created in the specified directory.&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;filename&amp;gt; is specified, and is not a directory, a package with the&lt;br /&gt;
specified name will be created.&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;dirname&amp;gt; and &amp;lt;filename&amp;gt; are not specified, a package named&lt;br /&gt;
&amp;lt;hostname&amp;gt;.apkovl.tar.gz will be created in current work directory.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Use SSH to create an apkovl on a different host ==&lt;br /&gt;
&lt;br /&gt;
To create an apkovl of client on a centralized server, use &amp;quot;-&amp;quot; as the apkovl name:&lt;br /&gt;
&lt;br /&gt;
On the server:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ssh root@client &amp;quot;lbu package -&amp;quot; &amp;gt;client.apkovl.tar.gz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Check what files have been changed since last commit ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
usage: lbu status|st [-av]&lt;br /&gt;
&lt;br /&gt;
Options:&lt;br /&gt;
  -a	Compare all files, not just since last commit.&lt;br /&gt;
  -v	Also show include and exclude lists.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Multiple Backups ==&lt;br /&gt;
Lbu can now keep backups so you can revert to older, good known config.&lt;br /&gt;
Set BACKUP_LIMIT in /etc/lbu/lbu.conf to the number of backups you want&lt;br /&gt;
to keep.&lt;br /&gt;
&lt;br /&gt;
You can list the current backups with:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|lbu list-backup [&amp;lt;media&amp;gt;]}}&lt;br /&gt;
&lt;br /&gt;
and you can revert to an older with:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|lbu revert &amp;lt;filename&amp;gt; [&amp;lt;media&amp;gt;]}}&lt;br /&gt;
&lt;br /&gt;
Note that when you revert, the current apkovl on media will be backed&lt;br /&gt;
up.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Back Up a Flash Memory Installation]]&lt;br /&gt;
* [[Manually editing a existing apkovl]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Installation]]&lt;br /&gt;
[[Category:Storage]]&lt;br /&gt;
[[Category:Booting]]&lt;br /&gt;
[[Category:Package Manager]]&lt;/div&gt;</summary>
		<author><name>Andre</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Xen_Dom0_on_USB_or_SD&amp;diff=10194</id>
		<title>Xen Dom0 on USB or SD</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Xen_Dom0_on_USB_or_SD&amp;diff=10194"/>
		<updated>2014-10-10T13:24:42Z</updated>

		<summary type="html">&lt;p&gt;Andre: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This guide will show you how to perform a Xen Dom0 install on a USB or SD card, so you can have your Dom0 running from tmpfs. This has some benefits, but you will need a place to store your guests (virtual machines) and a syslog server to redirect the logs to.&lt;br /&gt;
&lt;br /&gt;
The first step is to set up a basic usb or SD install, to do this boot from the Alpine install CD (minimal is fine) and follow one of the following guides: [[Create a Bootable USB]] or [[Create a Bootable Compact Flash]]. Once you finished installing Alpine Linux on your device, boot from it and configure your newly installed system:&lt;br /&gt;
&lt;br /&gt;
{{Note|you might have to edit /etc/apk/repositories and change the first line so it points to /media/usb/apks.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# setup-alpine&lt;br /&gt;
[...]&lt;br /&gt;
# apk update&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that you have your system properly configured, it&#039;s time to install Xen:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Should this not be apk add xen xen-hypervisor ?&lt;br /&gt;
# apk add xen&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we have Xen installed, but we will need to modify the usb bootloader in order to load the Xen kernel. The first step is to remount /media/usb with write permissions:&lt;br /&gt;
&lt;br /&gt;
{{Note|&amp;lt;nowiki&amp;gt;you might have to use /media/UUID=XXX-XXXX instead of /media/usb, see /proc/mounts to detected where is your usb/cf card mounted.&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# mount -o remount,rw /media/usb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, copy the Xen kernel and mboot.c32 to the usb boot partition:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# cp /boot/xen.gz /media/usb/boot/&lt;br /&gt;
# cp /boot/mboot.c32 /media/usb/boot/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we have all the necessary files to boot Xen from the usb, it&#039;s time to change the bootloader and add a Xen entry, to do so open /media/usb/syslinux.cfg with your favorite editor and add one of the following entries:&lt;br /&gt;
&lt;br /&gt;
Normal boot:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
LABEL xen&lt;br /&gt;
  KERNEL /boot/mboot.c32&lt;br /&gt;
  APPEND /boot/xen.gz --- /boot/grsec alpine_dev=UUID=XXXX-XXXX:vfat modules=loop,squashfs,sd-mod,usb-storage modloop=/boot/grsec.modloop.squashfs --- /boot/grsec.gz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Serial console boot:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
LABEL xen&lt;br /&gt;
  KERNEL /boot/mboot.c32&lt;br /&gt;
  APPEND /boot/xen.gz com1=115200,8n1 console=com1 --- /boot/grsec alpine_dev=UUID=XXXX-XXXX:vfat modules=loop,squashfs,sd-mod,usb-storage modloop=/boot/grsec.modloop.squashfs --- /boot/grsec.gz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Change the UUID to the correct one, and add the necessary modules for your system. It&#039;s also a good idea to check [http://wiki.xen.org/wiki/Xen_Hypervisor_Boot_Options Xen Boot options] and set dom0_mem, dom0_vcpus_pin and dom0_max_vcpus at least.&lt;br /&gt;
&lt;br /&gt;
The next step is to load the necessary kernel modules for Xen, we will add them to /etc/modules, so they will be loaded automatically on boot:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# echo &amp;quot;xen_netback&amp;quot; &amp;gt;&amp;gt; /etc/modules&lt;br /&gt;
# echo &amp;quot;xen_blkback&amp;quot; &amp;gt;&amp;gt; /etc/modules&lt;br /&gt;
# echo &amp;quot;tun&amp;quot; &amp;gt;&amp;gt; /etc/modules&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last step is to configure startup services, we will need udev and xencommons at least to be started on boot:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# rc-update add udev sysinit&lt;br /&gt;
# rc-update add udev-postmount&lt;br /&gt;
# rc-update add xenstored&lt;br /&gt;
# rc-update add xenconsoled&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you need the xm toolstack, also add xend to startup services:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# rc-update add xend&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ok, now you have a fully functional Xen install, it&#039;s time to save your changes and boot into it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# lbu commit&lt;br /&gt;
# reboot&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also remember to configure at least one network bridge following the [[Bridge]] guide.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Xen Dom0]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Virtualization]]&lt;/div&gt;</summary>
		<author><name>Andre</name></author>
	</entry>
</feed>