Back Up a Flash Memory Installation: Difference between revisions

From Alpine Linux
(Update links to installing on USB)
 
(7 intermediate revisions by 4 users not shown)
Line 3: Line 3:
This procedure may also be used to migrate an Alpine Linux installation from one form of flash media to another.
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 ==
== Make the backup medium bootable ==


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").
The backup device may be made bootable by following the instructions for <code>[[Alpine_setup_scripts#setup-bootable|setup-bootable]]</code>.


Alternatively, you can boot an installation image of the same version of Alpine Linux that is to be backed up. (The version can be determined using the command "cat /etc/alpine-release".) Follow the instructions at [[Create a Bootable Device]] to install the boot system on the backup medium (CF/USB).


== Copy over the cache directory ==
== Copy the cache directory ==


If you have [[Alpine Linux package management#Local_Cache |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.
If you have [[Alpine Linux package management#Local_Cache |enabled APK caching]] for packages downloaded from the Internet, then you should copy 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:
For example, if the backup medium is labeled "sdb" (use the command "dmesg" to see what name your recently inserted device has received), and the system is booted from USB, you would run:


{{Cmd|mount -t vfat /dev/sdb1 /mnt
{{Cmd|mount -t vfat /dev/sdb1 /mnt
Line 18: Line 19:
umount /mnt}}
umount /mnt}}


== Copy over the configuration overlay file (apkovl) ==
== Copy 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).
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.
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:
For example, if the backup medium is labeled "sdb" (use the command "dmesg" to see what name your recently inserted device has received), and the system is booted from USB, you would run:


{{Cmd|mount -t vfat /dev/sdb1 /mnt
{{Cmd|mount -t vfat /dev/sdb1 /mnt
Line 30: Line 31:
umount /mnt}}
umount /mnt}}


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

Latest revision as of 14:06, 28 June 2021

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.

Make the backup medium bootable

The backup device may be made bootable by following the instructions for setup-bootable.

Alternatively, you can boot an installation image of the same version of Alpine Linux that is to be backed up. (The version can be determined using the command "cat /etc/alpine-release".) Follow the instructions at Create a Bootable Device to install the boot system on the backup medium (CF/USB).

Copy the cache directory

If you have enabled APK caching for packages downloaded from the Internet, then you should copy 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 received), 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 the configuration overlay file (apkovl)

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 received), 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