Create a Bootable Device: Difference between revisions

From Alpine Linux
No edit summary
(details about whole diskless mode)
Line 1: Line 1:
Generally there's no difference between Alpine Linux USB bootable installation medium and installed system in ''diskless'' or ''run-from-ram'' installation mode. The only difference is that after finished installation modified files have to be saved somewhere, hence [[Alpine_local_backup|Alpine Local Backup]].
Generally there's no difference between Alpine Linux USB bootable installation medium and installed system in ''diskless'' or ''run-from-ram'' installation mode. The only difference is that after finished installation modified files have to be saved somewhere, hence [[Alpine_local_backup|Alpine Local Backup]]. Thus this document describes how to proceed to end with an installation of a system in ''diskless'' or ''run-from-ram'' installation mode with locally saved modifications.


This process applies to Alpine Linux 1.9.0 or later, and results in a '''run-from-ram''' style installation.  
This process applies to Alpine Linux 1.9.0 or later.
== Requirements ==
== Requirements ==


Line 12: Line 13:


{{:Include:Copying Alpine to Flash|USB stick}}
{{:Include:Copying Alpine to Flash|USB stick}}
== Finishing installation ==
After one has booted previously created Alpine Linux bootable USB medium, to finish the installation one has to prepare USB stick to hold local customization and run ''setup-alpine''.
First let's find out where is our just booted USB media mounted, the location could vary.
# mount | grep /media
/dev/sda1 on /media/sda1 type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=utf8,shortname=mixed,errors=remount-ro)
Create local directory on USB media to hold local APK cache (see [[Alpine_Linux_package_management#Local_Cache|APK Local Cache]] for details).
# mount -o remount,rw /media/sda1
# mkdir /media/sda1/cache
# setup-apkcache /media/sda1/cache
# ls -l /etc/apk/cache
lrwxrwxrwx    1 root    root            17 Oct 19 13:16 /etc/apk/cache -> /media/sda1/cache
Now run ''setup-aplpine'' and proceed till a question about local disk selection - in ''diskless'' mode we won't use any disk (ie. our bootable media files is basically untouched) and we are going to use ''sda1'' to hold our system customization.
# setup-alpine
...
Which disk(s) would you like to use? (or '?' for help or 'none') [none]
Enter where to store configs ('floppy', 'sda1', 'usb' or 'none') [sda1]:
Enter apk cache directory (or '?' or 'none') [/media/sda1/cache]:
After the installer finished you can see how many files are created/modified by the installer and which need to be preserved:
# lbu status | wc -l
59
# lbu commit
# ls -l /media/sda1/*apkovl.tar.gz
-rwxr-xr-x    1 root    root          9591 Oct 19 15:23 /media/sda1/foo.apkovl.tar.gz
Thus all our customization is saved into ''foo.apkovl.tar.gz'' compressed tarball on the USB stick itself.
== Troubleshooting ==


=== Slow USB Devices ===
=== Slow USB Devices ===

Revision as of 13:40, 19 October 2020

Generally there's no difference between Alpine Linux USB bootable installation medium and installed system in diskless or run-from-ram installation mode. The only difference is that after finished installation modified files have to be saved somewhere, hence Alpine Local Backup. Thus this document describes how to proceed to end with an installation of a system in diskless or run-from-ram installation mode with locally saved modifications.

This process applies to Alpine Linux 1.9.0 or later.

Requirements

In order to follow this document, you will need:

  • Alpine Linux CD-ROM (Download a .iso file containing an Alpine release.)
  • A USB drive (flash, external HD, card reader, etc.)

Copy Alpine to USB stick

This material is proposed for deletion ...

This include has become obsolete. It is completely unused on the wiki (Discuss)
Make sure no other pages link here and check the page's history before deleting.

Finishing installation

After one has booted previously created Alpine Linux bootable USB medium, to finish the installation one has to prepare USB stick to hold local customization and run setup-alpine.

First let's find out where is our just booted USB media mounted, the location could vary.

# mount | grep /media
/dev/sda1 on /media/sda1 type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=utf8,shortname=mixed,errors=remount-ro)

Create local directory on USB media to hold local APK cache (see APK Local Cache for details).

# mount -o remount,rw /media/sda1
# mkdir /media/sda1/cache
# setup-apkcache /media/sda1/cache
# ls -l /etc/apk/cache
lrwxrwxrwx    1 root     root            17 Oct 19 13:16 /etc/apk/cache -> /media/sda1/cache

Now run setup-aplpine and proceed till a question about local disk selection - in diskless mode we won't use any disk (ie. our bootable media files is basically untouched) and we are going to use sda1 to hold our system customization.

# setup-alpine
...
Which disk(s) would you like to use? (or '?' for help or 'none') [none] 
Enter where to store configs ('floppy', 'sda1', 'usb' or 'none') [sda1]: 
Enter apk cache directory (or '?' or 'none') [/media/sda1/cache]:

After the installer finished you can see how many files are created/modified by the installer and which need to be preserved:

# lbu status | wc -l
59
# lbu commit
# ls -l /media/sda1/*apkovl.tar.gz
-rwxr-xr-x    1 root     root          9591 Oct 19 15:23 /media/sda1/foo.apkovl.tar.gz

Thus all our customization is saved into foo.apkovl.tar.gz compressed tarball on the USB stick itself.

Troubleshooting

Slow USB Devices

Specifying the 'waitusb=X' option at the end of the syslinux.cfg line might help with certain USB devices that take a bit longer to register. X stands for the amount of seconds kernel will wait before looking for the installation media.

append initrd=/boot/grsec.gz alpine_dev=usbdisk:vfat modules=loop,cramfs,sd-mod,usb-storage quiet waitusb=3

See Also

Alpine Linux has some special applications that helps you to use it in the way you want.
Some of the first scripts you are suggested to use is:

  • setup-alpine (Configures all basic things on your Alpine Linux)
  • setup-acf (was named setup-webconf before Alpine 1.9 beta 4) (Configures ACF (webconfiguration) so you can manage your box through https)
Note: Just type any of the above commands on your console and hit Enter to execute the script.

Other useful pages