Back Up a Flash Memory Installation: Difference between revisions

From Alpine Linux
(Category:Storage)
(3 intermediate revisions by 2 users not shown)
Line 5: Line 5:
== Install Alpine Linux on the backup medium ==
== Install Alpine Linux on the backup medium ==


Follow the instructions at [[Installing Alpine on USB]] to install Alpine Linux on the backup medium (CF/USB). Install the same version of Alpine Linux as you have on the running system (you can determine this using the command "cat /etc/alpine-release").
Follow the instructions at [[Create a Bootable USB]] to install Alpine Linux on the backup medium (CF/USB). Install the same version of Alpine Linux as you have on the running system (you can determine this using the command "cat /etc/alpine-release").




Line 14: Line 14:
For example, if the backup medium is labeled "sdb" (use the command "dmesg" to see what name your recently inserted device has recieved), and the system is booted from USB, you would run:
For example, if the backup medium is labeled "sdb" (use the command "dmesg" to see what name your recently inserted device has recieved), and the system is booted from USB, you would run:


* {{Cmd|mount -t vfat /dev/sdb1 /mnt}}
{{Cmd|mount -t vfat /dev/sdb1 /mnt
* {{Cmd|cp -a /media/usbdisk/cache /mnt/}}
cp -a /media/usbdisk/cache /mnt/
* {{Cmd|umount /mnt}}
umount /mnt}}


== Copy over the configuration overlay file (apkovl) ==
== Copy over the configuration overlay file (apkovl) ==
Line 26: Line 26:
For example, if the backup medium is labeled "sdb" (use the command "dmesg" to see what name your recently inserted device has recieved), and the system is booted from USB, you would run:
For example, if the backup medium is labeled "sdb" (use the command "dmesg" to see what name your recently inserted device has recieved), and the system is booted from USB, you would run:


* {{Cmd|mount -t vfat /dev/sdb1 /mnt}}
{{Cmd|mount -t vfat /dev/sdb1 /mnt
* {{Cmd|cp -a /media/usbdisk/*.apkovl.tar.gz /mnt/}}
cp -a /media/usbdisk/*.apkovl.tar.gz /mnt/
* {{Cmd|umount /mnt}}
umount /mnt}}


[[Category:Storage]]
[[Category:LBU]]
[[Category:Installation]]

Revision as of 08:07, 31 October 2019

If you have installed Alpine Linux on flash memory, such as a CF card or USB stick, you may wish to create a backup.

This procedure may also be used to migrate an Alpine Linux installation from one form of flash media to another.

Install Alpine Linux on the backup medium

Follow the instructions at Create a Bootable USB to install Alpine Linux on the backup medium (CF/USB). Install the same version of Alpine Linux as you have on the running system (you can determine this using the command "cat /etc/alpine-release").


Copy over the cache directory

If you have enabled APK caching for packages that are downloaded over the Internet, then you should copy over the "cache" directory from the running system to your backup medium.

For example, if the backup medium is labeled "sdb" (use the command "dmesg" to see what name your recently inserted device has recieved), and the system is booted from USB, you would run:

mount -t vfat /dev/sdb1 /mnt cp -a /media/usbdisk/cache /mnt/ umount /mnt

Copy over the configuration overlay file (apkovl)

All the custom configuration of your system is stored in a file named HOSTNAME.apkovl.tar.gz, where HOSTNAME is the locally configured hostname of the system (see the file /etc/hostname).

Simply copy this file to the root of your backup medium.

For example, if the backup medium is labeled "sdb" (use the command "dmesg" to see what name your recently inserted device has recieved), and the system is booted from USB, you would run:

mount -t vfat /dev/sdb1 /mnt cp -a /media/usbdisk/*.apkovl.tar.gz /mnt/ umount /mnt