<?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=Andrew71</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=Andrew71"/>
	<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/wiki/Special:Contributions/Andrew71"/>
	<updated>2026-05-02T01:16:08Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.40.0</generator>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Setting_up_disks_manually&amp;diff=25841</id>
		<title>Setting up disks manually</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Setting_up_disks_manually&amp;diff=25841"/>
		<updated>2023-11-30T11:38:52Z</updated>

		<summary type="html">&lt;p&gt;Andrew71: Fix typo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
The menu choices that are provided by &amp;lt;code&amp;gt;setup-alpine&amp;lt;/code&amp;gt; might not cover all needs, however, it&#039;s possible to:&lt;br /&gt;
&lt;br /&gt;
* Call [[Alpine_setup_scripts#setup-disk|setup-disk]] directly, instead of through &amp;lt;code&amp;gt;setup-alpine&amp;lt;/code&amp;gt;, and pass some specific partitioning parameters to it.&lt;br /&gt;
* Set up the partitions and filesystems manually (to the desired details) and [[Alpine_setup_scripts#Partitioning|tell setup-disk]] to install to the prepared target mountpoint.&lt;br /&gt;
&lt;br /&gt;
(Beta reference: [https://docs.alpinelinux.org/user-handbook/0.1a/Installing/manual.html#_finalizing docs.alpinelinux.org] )&lt;br /&gt;
&lt;br /&gt;
== Using setup-alpine (setup-disk) features ==&lt;br /&gt;
&lt;br /&gt;
=== For &amp;quot;diskless&amp;quot; and &amp;quot;data&amp;quot; disk mode installs ===&lt;br /&gt;
&lt;br /&gt;
This requires some manual steps, as long as the setup-scripts auto-detect usable partitions only on &#039;&#039;&#039;removable&#039;&#039;&#039; devices (not internal harddisks). They do not support creating new, writable partitions to be used by Alpine.&lt;br /&gt;
&lt;br /&gt;
How to prepare writable storage space is explained in the section [[Setting_up_disks_manually#Manual_partitioning| manual partitioning]], below.&lt;br /&gt;
&lt;br /&gt;
=== For &amp;quot;sys&amp;quot; disk mode installs ===&lt;br /&gt;
&lt;br /&gt;
{{Draft|Some information on this page may be incomplete or outdate.}}&lt;br /&gt;
&lt;br /&gt;
==== Disk layouts ====&lt;br /&gt;
&lt;br /&gt;
It is possible to have one or more of RAID, encrypted, and/or Logical Volume on your {{Path|/}} (root) volume. However, the Alpine init script only knows how to handle them when they&#039;re layered in that order, and your initram and extlinux.conf files in the {{Path|/boot}} partition are configured properly.&lt;br /&gt;
&lt;br /&gt;
Your {{Path|/boot}} directory cannot reside on an encrypted or LVM volume, at least not with Alpine&#039;s default bootloader (extlinux). (Grub2 can deal with {{Path|/boot}} being on an LVM volume.) The usual practice is to create a small partition for {{Path|/boot}}, then devote the rest of your disk to a separate partition on which you layer one or more of RAID, encryption, and/or Logical Volumes.&lt;br /&gt;
&lt;br /&gt;
Sometimes {{Path|/boot}} is also set up as a mirrored (RAID1) volume. However, this is just for post-init access. That way, when you write a new kernel or bootloader config file to {{Path|/boot}}, it gets written to multiple physical partitions. During the pre-init, bootloader phase, only one of those partitions will be read from.&lt;br /&gt;
&lt;br /&gt;
A typical setup might look like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
One-disk system&lt;br /&gt;
---------------&lt;br /&gt;
  +------------------------------------------------+&lt;br /&gt;
  |  small partition (32--100M), holding           |&lt;br /&gt;
  |  only /boot, filesystem needn&#039;t be journaled   |&lt;br /&gt;
  +------------------------------------------------+&lt;br /&gt;
  |  rest of disk in second partition              |&lt;br /&gt;
  |  +------------------------------------------+  |&lt;br /&gt;
  |  | cryptsetup volume                        |  |&lt;br /&gt;
  |  |  +-------------------------------------+ |  |&lt;br /&gt;
  |  |  |  LVM PV, containing single VG,      | |  |&lt;br /&gt;
  |  |  |  containing multiple LVs, holding   | |  |&lt;br /&gt;
  |  |  |  /, /home, swap, etc                | |  |&lt;br /&gt;
  |  |  +-------------------------------------+ |  |&lt;br /&gt;
  |  +------------------------------------------+  |&lt;br /&gt;
  +------------------------------------------------+&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Two-disk system&lt;br /&gt;
---------------&lt;br /&gt;
  +------------------------------------------------+  +------------------------------------------------+&lt;br /&gt;
  |  small partition (32--100M), holding           |  |  small partition (32--100M), holding           | These 2 partitions might&lt;br /&gt;
  |  only /boot, filesystem needn&#039;t be journaled   |  |  only /boot, filesystem needn&#039;t be journaled   | form a mirrored (RAID1)&lt;br /&gt;
  +------------------------------------------------+  +------------------------------------------------+ volume&lt;br /&gt;
  |  rest of disk in second partition              |  |  rest of disk in second partition              |&lt;br /&gt;
  | T================================================================================================T | These 2 partitions form&lt;br /&gt;
  | T +--------------------------------------------------------------------------------------------+ T | a second mirrored&lt;br /&gt;
  | T | cryptsetup volume                                                                          | T | (RAID1) volume&lt;br /&gt;
  | T |  +---------------------------------------------------------------------------------------+ | T |&lt;br /&gt;
  | T |  | LVM PV, containing single VG,                                                         | | T |&lt;br /&gt;
  | T |  | containing multiple LVs, holding                                                      | | T |&lt;br /&gt;
  | T |  | /, /home, swap, etc                                                                   | | T |&lt;br /&gt;
  | T |  +---------------------------------------------------------------------------------------+ | T |&lt;br /&gt;
  | T +--------------------------------------------------------------------------------------------+ T |&lt;br /&gt;
  | T================================================================================================T |&lt;br /&gt;
  |                                                |  |                                                |&lt;br /&gt;
  +------------------------------------------------+  +------------------------------------------------+&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a three-disk system, the {{Path|/boot}} would still be RAID1, but the larger partition might, in that case, be RAID5.&lt;br /&gt;
&lt;br /&gt;
==== RAID ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;setup-disk&amp;lt;/code&amp;gt; will automatically build a RAID array if you supply the &#039;&#039;&#039;-r&#039;&#039;&#039; switch, or if you specify more than one device.&lt;br /&gt;
&lt;br /&gt;
If you want to build your RAID array manually, see [[Setting up a software RAID array]]. Then you can add additional layers of encryption and/or Logical Volumes, or just assemble the RAID array, and supply the {{Path|/dev/md&amp;lt;i&amp;gt;i&amp;lt;/i&amp;gt;}} device directly to [[setup-disk]]. When you&#039;re finished, be sure to disassemble the RAID array before rebooting.&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;code&amp;gt;setup-disk&amp;lt;/code&amp;gt; sees that you&#039;re using RAID, either because you gave it the &amp;lt;code&amp;gt;-r&amp;lt;/code&amp;gt; switch, or multiple devices, or a {{Path|/dev/md&amp;lt;i&amp;gt;i&amp;lt;/i&amp;gt;}} device, then it will set up your initramfs and extlinux.conf file properly. However, in other cases, such as when you&#039;re also using encryption, or you invoke &amp;lt;code&amp;gt;setup-disk&amp;lt;/code&amp;gt; with a mounted directory argument, these might not be properly set up for RAID. In that case, you may need to manually edit/rebuild them. The following assumes that &amp;lt;code&amp;gt;$MNT&amp;lt;/code&amp;gt; holds the root directory you&#039;re installing into:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|1=echo &amp;quot;/sbin/mdadm&amp;quot; &amp;gt; $MNT/etc/mkinitfs/files.d/raid&lt;br /&gt;
echo &amp;quot;/etc/mdadm.conf&amp;quot; &amp;gt;&amp;gt; $MNT/etc/mkinitfs/files.d/raid&lt;br /&gt;
&amp;amp;#35; edit $MNT/etc/mkinitfs/mkinitfs.conf to make sure features=&amp;quot;...&amp;quot;&lt;br /&gt;
&amp;amp;#35; includes raid (this field is space-separated and quoted)&lt;br /&gt;
mkinitfs -c $MNT/etc/mkinitfs/mkinitfs.conf -b $MNT&lt;br /&gt;
&amp;amp;#35; edit $MNT/etc/update-extlinux.conf to make sure modules=... contains&lt;br /&gt;
&amp;amp;#35; raid1 or raid456 (whichever your / is on; this field is comma-separated)&lt;br /&gt;
&amp;amp;#35; also check the root= setting&lt;br /&gt;
extlinux --raid --install $MNT/boot --update&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Todo|Does adding the &amp;lt;code&amp;gt;--update&amp;lt;/code&amp;gt; option to &amp;lt;code&amp;gt;extlinux ...&amp;lt;/code&amp;gt; suffice to make {{Path|/boot/extlinux.conf}} be regenerated? Or do we need to manually tweak that file, or run &amp;lt;code&amp;gt;update-extlinux&amp;lt;/code&amp;gt;, as well?}}&lt;br /&gt;
&lt;br /&gt;
You might also need to manually tweak {{Path|$MNT/etc/fstab}}. And you might need to copy {{Path|/usr/share/syslinux/mbr.bin}} to your disk&#039;s MBR.&lt;br /&gt;
&lt;br /&gt;
==== Encryption ====&lt;br /&gt;
&lt;br /&gt;
See [[Setting up encrypted volumes with LUKS]]. You can add an additional Logical Volume layer, or just unlock the volume you&#039;ve created (using &amp;lt;code&amp;gt;cryptsetup luksOpen ...&amp;lt;/code&amp;gt;), and supply the {{Path|/dev/mapper/&amp;lt;i&amp;gt;something&amp;lt;/i&amp;gt;}} device directly to [[setup-disk]]. When you&#039;re finished, be sure to relock the volume (using &amp;lt;code&amp;gt;cryptsetup luksClose ...&amp;lt;/code&amp;gt;) before rebooting.&lt;br /&gt;
&lt;br /&gt;
If you install your {{Path|/}} (root) on an encrypted volume, you&#039;ll need to manually edit/rebuild your initram and your extlinux.conf file. The following assumes that &amp;lt;code&amp;gt;$MNT&amp;lt;/code&amp;gt; holds the root directory you&#039;re installing into, that you&#039;ve created the cryptvolume on the device {{Path|/dev/md2}}, and that you want to unlock the encrypted volume into a virtual volume named &amp;quot;crypt&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|1=&amp;amp;#35; edit $MNT/etc/mkinitfs/mkinitfs.conf to make sure features=&amp;quot;...&amp;quot;&lt;br /&gt;
&amp;amp;#35; includes cryptsetup (this field is space-separated and quoted)&lt;br /&gt;
mkinitfs -c $MNT/etc/mkinitfs/mkinitfs.conf -b $MNT&lt;br /&gt;
&amp;amp;#35; edit $MNT/etc/update-extlinux.conf to make sure default_kernel_opts=&amp;quot;...&amp;quot;&lt;br /&gt;
&amp;amp;#35; contains cryptroot=/dev/md1 and cryptdm=crypt (this field is also space-separated and quoted)&lt;br /&gt;
&amp;amp;#35; also check the root= setting&lt;br /&gt;
extlinux --install $MNT/boot --update&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Todo|Does adding the &amp;lt;code&amp;gt;--update&amp;lt;/code&amp;gt; option to &amp;lt;code&amp;gt;extlinux ...&amp;lt;/code&amp;gt; suffice to make {{Path|/boot/extlinux.conf}} be regenerated? Or do we need to manually tweak that file, or run &amp;lt;code&amp;gt;update-extlinux&amp;lt;/code&amp;gt;, as well?}}&lt;br /&gt;
&lt;br /&gt;
You might also need to manually tweak {{Path|$MNT/etc/fstab}}.&lt;br /&gt;
&lt;br /&gt;
==== LVM ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;setup-disk&amp;lt;/code&amp;gt; will automatically build and use volumes in a LVM group if you supply the &#039;&#039;&#039;-L&#039;&#039;&#039; switch.&lt;br /&gt;
&lt;br /&gt;
If you instead want to build your LVM system manually, see [[Setting up Logical Volumes with LVM]]. Then &amp;lt;code&amp;gt;vgchange -ay&amp;lt;/code&amp;gt;, format and mount your volumes, and supply the root mountpoint to [[setup-disk]]. When you&#039;re finished, be sure to&lt;br /&gt;
{{Cmd|umount ...&lt;br /&gt;
vgchange -an}}&lt;br /&gt;
before rebooting.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;code&amp;gt;setup-disk&amp;lt;/code&amp;gt; sees that you&#039;re using LVM, perhaps because you gave it the &amp;lt;code&amp;gt;-L&amp;lt;/code&amp;gt; switch, then it will set up your initram and extlinux.conf file properly. However, in other cases, these might not be properly set up. In that case, you may need to manually edit/rebuild them. The following assumes that &amp;lt;code&amp;gt;$MNT&amp;lt;/code&amp;gt; holds the root directory you&#039;re installing into:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|1=&amp;amp;#35; edit $MNT/etc/mkinitfs/mkinitfs.conf to make sure features=&amp;quot;...&amp;quot;&lt;br /&gt;
&amp;amp;#35; includes lvm (this field is space-separated and quoted)&lt;br /&gt;
mkinitfs -c $MNT/etc/mkinitfs/mkinitfs.conf -b $MNT&lt;br /&gt;
&amp;amp;#35; edit $MNT/etc/update-extlinux.conf to make sure root= is set correctly&lt;br /&gt;
extlinux --install $MNT/boot --update&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Todo|Does adding the &amp;lt;code&amp;gt;--update&amp;lt;/code&amp;gt; option to &amp;lt;code&amp;gt;extlinux ...&amp;lt;/code&amp;gt; suffice to make {{Path|/boot/extlinux.conf}} be regenerated? Or do we need to manually tweak that file, or run &amp;lt;code&amp;gt;update-extlinux&amp;lt;/code&amp;gt;, as well?}}&lt;br /&gt;
&lt;br /&gt;
You might also need to manually tweak {{Path|$MNT/etc/fstab}}.&lt;br /&gt;
&lt;br /&gt;
== Manual partitioning ==&lt;br /&gt;
&lt;br /&gt;
=== For &amp;quot;diskless&amp;quot; and &amp;quot;data&amp;quot; disk mode installs ===&lt;br /&gt;
&lt;br /&gt;
The installation image enviroment may have only the very basic busybox built-in &amp;lt;code&amp;gt;fdisk&amp;lt;/code&amp;gt; command available. However, alpine allows you to install more complete partitioning tool packages like &amp;lt;code&amp;gt;sfdisk&amp;lt;/code&amp;gt; (scriptable fdisk), &amp;lt;code&amp;gt;gptfdisk&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;parted&amp;lt;/code&amp;gt; (CLI), &amp;lt;code&amp;gt;cfdisk&amp;lt;/code&amp;gt; (text menus), or even &amp;lt;code&amp;gt;gparted&amp;lt;/code&amp;gt; (after [[Installation#Post-Install|setting up a graphical environment]]).&lt;br /&gt;
&lt;br /&gt;
The following example installs &amp;lt;code&amp;gt;cfdisk&amp;lt;/code&amp;gt;, looks for existing partitions, and runs cfdisk against &amp;lt;code&amp;gt;/dev/sdX&amp;lt;/code&amp;gt;:&lt;br /&gt;
 # apk add cfdisk&lt;br /&gt;
 # blkid&lt;br /&gt;
 /dev/sdX1: LABEL=&amp;quot;some&amp;quot; UUID=&amp;quot;...&amp;quot; TYPE=&amp;quot;vfat&amp;quot;&lt;br /&gt;
 /dev/sdX2: LABEL=&amp;quot;other&amp;quot; UUID=&amp;quot;...&amp;quot; TYPE=&amp;quot;ext4&amp;quot;&lt;br /&gt;
 # cfdisk /dev/sdX&lt;br /&gt;
&lt;br /&gt;
* Be aware of this Bug: {{Issue|11589|The APKOVL loading of diskless setups doesn&#039;t work on btrfs and xfs filesystems, or nvme-based devices}} =&amp;gt; So, for the moment, use only ext4 filesystem partitions on classic drives to store diskless mode states.&lt;br /&gt;
&lt;br /&gt;
The following creates an ext4 partition with disabled journaling, to reduce write operations and allow the disk to spin down after the .apkovl and the packages have been read from the partition during the boot.&lt;br /&gt;
 # apk add e2fsprogs&lt;br /&gt;
 # mkfs.ext4 -O ^has_journal /dev/sdXY   # the &amp;quot;-O ^has_journal&amp;quot; DISABLES journaling (&amp;quot;^&amp;quot; means &amp;quot;not&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
{{Note|IMPORTANT! There may be additional steps necessary to make proper use of the partition, see&lt;br /&gt;
[[Alpine_local_backup#Saving_and_loading_ISO_image_customizations|Saving_and_loading_ISO_image_customizations]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Note| mkfs.ext4 creates ext4 fs with 64bit feature enabled by default, but extlinux may not be able to boot with that, see Issue {{Issue|14895}}. You may need to add &amp;quot;-O ^has_journal,^64bit&amp;quot; to mkfs.ext4 to circumvent this.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== For &amp;quot;sys&amp;quot; disk mode installs ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;setup-disk&amp;lt;/code&amp;gt; will by default set up a root partition, a separate /boot partition and a swap partition. If you want a different layout, you can manually create the partitions, filesystems and mount them on {{Path|/mnt}} (or any other mount point) then run:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|setup-disk /mnt}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;setup-disk&amp;lt;/code&amp;gt; will install your running system on the mounted root, detect your file system layout and generate an fstab.&lt;br /&gt;
&lt;br /&gt;
If you&#039;re using the MBR, you are responsible for making the proper partition bootable and make sure the MBR is OK for extlinux. If you&#039;re going to use EFI, make sure you mount &amp;lt;code&amp;gt;esp&amp;lt;/code&amp;gt; partition on &amp;lt;code&amp;gt;/boot/efi&amp;lt;/code&amp;gt; and set &amp;lt;code&amp;gt;BOOTLOADER=grub&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;USE_EFI=1&amp;lt;/code&amp;gt;, and that {{Pkg|grub-efi}} and {{Pkg|efibootmgr}} are installed before running &amp;lt;code&amp;gt;setup-disk&amp;lt;/code&amp;gt;. If your system still does not boot, you can try to manually create a boot entry with {{Pkg|efibootmgr}}, for which instructions can be found at [https://wiki.alpinelinux.org/wiki/Bootloaders#efibootmgr EFI Boot Stub].&lt;br /&gt;
&lt;br /&gt;
See also [https://github.com/itoffshore/alpine-linux-scripts setup-partitions]&lt;br /&gt;
&lt;br /&gt;
==== Dual-booting ====&lt;br /&gt;
See [[Installing Alpine on HDD dualbooting|Install to HDD with dual-boot]]&lt;br /&gt;
&lt;br /&gt;
==== Other needs ====&lt;br /&gt;
* [[Installing Alpine Linux in a chroot]]&lt;br /&gt;
* [[Replacing non-Alpine Linux with Alpine remotely]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
 Create partition with with type &amp;quot;Linux&amp;quot; (83).&lt;br /&gt;
 apk_add e2fsprogs rsync&lt;br /&gt;
 mkfs.ext3 /dev/hda1&lt;br /&gt;
 mount -t ext3 /dev/hda1 /mnt&lt;br /&gt;
 ROOT=/mnt apk_add uclibc busybox apk-tools alpine-baselayout alpine-conf&lt;br /&gt;
 # Install busybox links&lt;br /&gt;
 mkdir /mnt/proc &amp;amp;&amp;amp; mount --bind /proc /mnt/proc &amp;amp;&amp;amp; chroot /mnt /bin/busybox --install -s &amp;amp;&amp;amp; umount /mnt/proc&lt;br /&gt;
 # Copy the apk repository&lt;br /&gt;
 rsync -ruav /media/cdrom/apks /mnt&lt;br /&gt;
 mkdir /mnt/etc/apk &amp;amp;&amp;amp; echo &amp;quot;APK_PATH=file://apks&amp;quot; &amp;gt; /mnt/etc/apk/apk.conf&lt;br /&gt;
 # Copy the hd/ext3 initramfs image, kernel and kernel modules&lt;br /&gt;
 rsync -ruav /media/cdrom/kernel/generic/hd-ext3.gz /media/cdrom/kernel/generic/bzImage /mnt&lt;br /&gt;
 rsync -ruav /lib/modules/* /mnt/lib/modules/&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
=== Setting up RAID ===&lt;br /&gt;
Set up a raid array as described [[Setting up a software RAID1 array|here]].&lt;br /&gt;
In this document, two raid arrays are configured: md0 for swap (512MB) and md1 for /var. &lt;br /&gt;
&lt;br /&gt;
=== Create filesystem ===&lt;br /&gt;
We need to install the software to create the filesystem (&amp;quot;format&amp;quot; the partition).&lt;br /&gt;
 apk_add e2fsprogs&lt;br /&gt;
&lt;br /&gt;
If you use an Alpine release older than 1.3.8 you will need to manually create a link to /etc/mtab.&lt;br /&gt;
 ln -fs /proc/mounts /etc/mtab&lt;br /&gt;
&lt;br /&gt;
Create the filesystem. The -j option makes it ext&#039;&#039;&#039;3&#039;&#039;&#039;. Without the -j option it will become non-journaling ext&#039;&#039;&#039;2&#039;&#039;&#039;. This step might take some time if your partition is big.&lt;br /&gt;
 mke2fs -j /dev/md1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now edit /etc/fstab and add your new partitions. Mine looks like this:&lt;br /&gt;
 none            /proc           proc    defaults 0 0&lt;br /&gt;
 none            /sys            sysfs   defaults 0 0&lt;br /&gt;
 udev            /dev            tmpfs   size=100k 0 0&lt;br /&gt;
 none            /dev/pts        devpts  defaults 0 0&lt;br /&gt;
 tmpfs           /dev/shm        tmpfs   defaults 0 0&lt;br /&gt;
 /dev/cdrom      /media/cdrom    iso9660 ro 0 0&lt;br /&gt;
 /dev/fd0        /media/floppy   vfat    noauto  0 0&lt;br /&gt;
 /dev/usba1      /media/usb      vfat    noauto  0 0&lt;br /&gt;
 none            /proc/bus/usb   usbfs noauto 0 0&lt;br /&gt;
  &lt;br /&gt;
 /dev/md0        swap            swap    defaults 0 0&lt;br /&gt;
 /dev/md1        /var            ext3    defaults 0 0&lt;br /&gt;
&lt;br /&gt;
=== Move the data ===&lt;br /&gt;
Stop aall services running that put anything in /var (syslog for example). If you have booted on a clean installation and not run setup-alpine, then no services should be running. However, some packages might have created dirs in /var, so we need to backup /var, mount the new /var directory and move all backed up dirs to the raided /var.&lt;br /&gt;
&lt;br /&gt;
 mv /var /var.tmp&lt;br /&gt;
 mkdir /var&lt;br /&gt;
 mount /var&lt;br /&gt;
 mv /var.tmp/* /var&lt;br /&gt;
 rmdir /var.tmp&lt;br /&gt;
&lt;br /&gt;
Verify that everyting looks ok with the &#039;&#039;df&#039;&#039; utility.&lt;br /&gt;
 ~ $ df&lt;br /&gt;
 Filesystem           1k-blocks      Used Available Use% Mounted on&lt;br /&gt;
 none                    255172     23544    231628   9% /&lt;br /&gt;
 udev                       100         0       100   0% /dev&lt;br /&gt;
 /dev/cdrom              142276    142276         0 100% /media/cdrom&lt;br /&gt;
 /dev/md1              37977060    181056  35866876   1% /var&lt;br /&gt;
&lt;br /&gt;
=== Survive reboots ===&lt;br /&gt;
Now we have everything up and running. We need to make sure that everything will be restored during next reboot.&lt;br /&gt;
&lt;br /&gt;
Create an initscript that will mount /var for you during boot. I call it /etc/init.d/mountdisk and it looks like this:&lt;br /&gt;
 #!/sbin/runscript&lt;br /&gt;
 &lt;br /&gt;
 start() {&lt;br /&gt;
         ebegin &amp;quot;Mounting /var&amp;quot;&lt;br /&gt;
         mount /var&lt;br /&gt;
         eend $?&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 stop() {&lt;br /&gt;
         ebegin &amp;quot;Unmounting /var&amp;quot;&lt;br /&gt;
         umount /var&lt;br /&gt;
         eend $?&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Make it exectutable:&lt;br /&gt;
 chmod +x /etc/init.d/mountdisk&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; Since Alpine-1.7.3 a script named &#039;&#039;localmount&#039;&#039; is included so you will not need to create your own &#039;&#039;mountdisk&#039;&#039; script.&lt;br /&gt;
&lt;br /&gt;
/var needs to be mounted *after* raid is created. The -k option will make alpine unmount the /var partition during boot. Add start swap to boot:&lt;br /&gt;
 rc_add -k -s 06 mountdisk&lt;br /&gt;
 rc_add -k -s 06 swap&lt;br /&gt;
&lt;br /&gt;
The /dev/md* device nodes will not be created automatically, so we need to put them on floppy too.&lt;br /&gt;
 lbu include /dev/md*&lt;br /&gt;
&lt;br /&gt;
If you have users on the server and want /home to be permanent, you can create a directory /var/home and create links to /var/home.&lt;br /&gt;
 mkdir /var/home&lt;br /&gt;
 mv /home/* /var/home/&lt;br /&gt;
 ln -s /var/home/* /home/&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; You cannot just replace /home with a link that points to /var/home since the base has a /home directory. When the system tries to copy the config from floppy it will fail because of the already existing /home directory.&lt;br /&gt;
&lt;br /&gt;
Make sure the links are stored to floppy:&lt;br /&gt;
 lbu include /home/*&lt;br /&gt;
&lt;br /&gt;
Also remember to move any newly created users to /var/home and create a link:&lt;br /&gt;
 adduser bob&lt;br /&gt;
 mv /home/bob /var/home/&lt;br /&gt;
 ln -s /var/home/bob /home/bob&lt;br /&gt;
 lbu include /home/bob&lt;br /&gt;
&lt;br /&gt;
Save to floppy:&lt;br /&gt;
 lbu commit floppy&lt;br /&gt;
&lt;br /&gt;
=== Operational Test ===&lt;br /&gt;
Reboot computer. Now the raid should start and /var should be mounted. Check with df:&lt;br /&gt;
 ~ $ df&lt;br /&gt;
 Filesystem           1k-blocks      Used Available Use% Mounted on&lt;br /&gt;
 none                    255172     23976    231196   9% /&lt;br /&gt;
 mdev                       100         0       100   0% /dev&lt;br /&gt;
 /dev/cdrom              140932    140932         0 100% /media/cdrom&lt;br /&gt;
 /dev/md1              37977060    180984  35866948   1% /var&lt;br /&gt;
&lt;br /&gt;
=== Upgrades ===&lt;br /&gt;
Since the package database is on disk, you cannot update by simply replacing the CDROM. You will have to either run the upgrade on the new CDROM or run &#039;&#039;apk_add -u ... &amp;amp;&amp;amp; update-conf&#039;&#039; manually.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setting up swap ===&lt;br /&gt;
&lt;br /&gt;
# create a partition with the type set to &amp;quot;linux swap&amp;quot; (82) (If you&#039;re going to use a logical volume for swap, skip this step and &amp;lt;code&amp;gt;lvcreate&amp;lt;/code&amp;gt; that instead.)&lt;br /&gt;
# &amp;lt;code&amp;gt;mkswap /dev/sda2&amp;lt;/code&amp;gt;&lt;br /&gt;
# &amp;lt;code&amp;gt;echo -e &amp;quot;/dev/sda2 none swap sw 0 0&amp;quot; &amp;gt;&amp;gt; /mnt/etc/fstab&amp;lt;/code&amp;gt;&lt;br /&gt;
# &amp;lt;code&amp;gt;swapon /dev/sda2&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;rc-service swap start&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
{{Cmd|free -m}} will show how much swap space is available (in MB).&lt;br /&gt;
&lt;br /&gt;
If you prefer maximum speed, you don&#039;t need configure any raid devices for swap. Just add 2 swap partitions on different disks and linux will stripe them automatically. The downside is that the moment one disk fails, the system will go down. For better reliability, put swap on RAID1. &lt;br /&gt;
&lt;br /&gt;
{{Todo|Instructions for cryptswap?}}&lt;br /&gt;
&lt;br /&gt;
=== Custom boot partition size ===&lt;br /&gt;
&lt;br /&gt;
The default boot partition size is under 40MB. This can cause errors if package updates require additional space on /boot.&lt;br /&gt;
Executing &amp;lt;code&amp;gt;export BOOT_SIZE=512&amp;lt;/code&amp;gt; before running &amp;lt;code&amp;gt;setup-disk&amp;lt;/code&amp;gt; will result in a 512MB boot partition.&lt;br /&gt;
&lt;br /&gt;
[[Category:Installation]]&lt;br /&gt;
[[Category:Storage]]&lt;/div&gt;</summary>
		<author><name>Andrew71</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Gitea&amp;diff=25838</id>
		<title>Gitea</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Gitea&amp;diff=25838"/>
		<updated>2023-11-29T20:49:21Z</updated>

		<summary type="html">&lt;p&gt;Andrew71: Update links&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[https://gitea.com Gitea] is a community managed lightweight code hosting solution written in Go. It is a fork of Gogs.&lt;br /&gt;
&lt;br /&gt;
{{Note|This guide is not for installing Gitea in Docker. If you want to install Gitea in a Docker container, follow [https://docs.gitea.com/installation/install-with-docker the official documentation]}}&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
First, [[Repositories#Managing_repositories| Enable the Community Repository]]&lt;br /&gt;
&lt;br /&gt;
Then install the {{pkg|gitea}} package:&lt;br /&gt;
{{cmd|apk add gitea}}&lt;br /&gt;
&lt;br /&gt;
== Setting up the Database ==&lt;br /&gt;
&lt;br /&gt;
{{Note|These instructions are for MariaDB. If you would like to set up another database, follow [https://docs.gitea.com/installation/database-prep the official documentation]}}&lt;br /&gt;
&lt;br /&gt;
Install the MariaDB and {{pkg|mariadb-client}} packages:&lt;br /&gt;
{{cmd|apk add mariadb mariadb-client}}&lt;br /&gt;
&lt;br /&gt;
Set up the MariaDB installation and secure it:&lt;br /&gt;
{{cmd|&amp;lt;nowiki&amp;gt;mysql_install_db --user=mysql --datadir=/var/lib/mysql&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
service mariadb start&lt;br /&gt;
rc-update add mariadb&lt;br /&gt;
mysql_secure_installation}}&lt;br /&gt;
&lt;br /&gt;
Create the &amp;lt;code&amp;gt;gitea&amp;lt;/code&amp;gt; database and a user with access to it:&lt;br /&gt;
{{Note|Everything after the &amp;lt;code&amp;gt;mysql -u root -p&amp;lt;/code&amp;gt; should be typed in the MariaDB prompt (looks like &amp;lt;code&amp;gt;MariaDB [(none)]&amp;gt;&amp;lt;/code&amp;gt;)}}&lt;br /&gt;
{{Note|Replace the above username &#039;giteauser&#039; and password &#039;giteapassword&#039; with something secure. Remember these settings. You will need them later when setting up Gitea.}}&lt;br /&gt;
{{cmd|mysql -u root -p&lt;br /&gt;
&lt;br /&gt;
CREATE DATABASE gitea DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;&lt;br /&gt;
GRANT ALL ON gitea.* TO &#039;giteauser&#039;@&#039;localhost&#039; IDENTIFIED BY &#039;giteapassword&#039;;&lt;br /&gt;
FLUSH PRIVILEGES;&lt;br /&gt;
EXIT}}&lt;br /&gt;
&lt;br /&gt;
If you want, you can uninstall the &amp;lt;code&amp;gt;mariadb-client&amp;lt;/code&amp;gt; now as it&#039;s not needed anymore:&lt;br /&gt;
{{cmd|apk del mariadb-client}}&lt;br /&gt;
&lt;br /&gt;
In {{path|/etc/gitea/app.ini}}, replace the contents of the &amp;lt;code&amp;gt;[database]&amp;lt;/code&amp;gt; section with the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DB_TYPE = mysql&lt;br /&gt;
HOST = /var/run/mysqld/mysqld.sock&lt;br /&gt;
NAME = gitea			; The database name set with &#039;CREATE DATABASE&#039;&lt;br /&gt;
USER = giteauser		; The database user&lt;br /&gt;
PASSWD = giteapassword		; The password for the database user&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configurations ==&lt;br /&gt;
&lt;br /&gt;
The Gitea service can be configured using {{path|/etc/conf.d/gitea}}:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Description !! Configuration Variable !! Default Value&lt;br /&gt;
|-&lt;br /&gt;
| User to run Gitea under || GITEA_USER || gitea&lt;br /&gt;
|-&lt;br /&gt;
| Gitea working directory || GITEA_WORK_DIR || /var/lib/gitea/&lt;br /&gt;
|-&lt;br /&gt;
| Gitea configuration file || GITEA_CONF || /etc/gitea/app.ini&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Some additional settings in {{path|/etc/gitea/app.ini}}:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Description !! Configuration Variable !! Default Value&lt;br /&gt;
|-&lt;br /&gt;
| Gitea customization directory || &amp;lt;code&amp;gt;Cannot be configured&amp;lt;/code&amp;gt; || /var/lib/gitea/custom/&lt;br /&gt;
|-&lt;br /&gt;
| Web files || STATIC_ROOT_PATH || /usr/share/webapps/gitea/&lt;br /&gt;
|-&lt;br /&gt;
| Data files || APP_DATA_PATH || /var/lib/gitea/data/&lt;br /&gt;
|-&lt;br /&gt;
| Git repository storage directory || ROOT || /var/lib/gitea/git/&lt;br /&gt;
|-&lt;br /&gt;
| Log directory || ROOT_PATH || /var/log/gitea/&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{Note|Gitea has a built-in web server, so there is no need to configure one. However, you can [https://docs.gitea.com/administration/reverse-proxies set up a reverse proxy].}}&lt;br /&gt;
&lt;br /&gt;
{{Note|To customize the look and feel of Gitea, find the correct path in {{path|/usr/share/webapps/gitea/}} and make the same path in {{path|/var/lib/gitea/custom/}}. For example, to add a new Gitea theme, create the {{path|/var/lib/gitea/custom/public/css/}} directory, then add the css for the theme there.}}&lt;br /&gt;
&lt;br /&gt;
== Controlling and starting gitea ==&lt;br /&gt;
&lt;br /&gt;
You should not start Gitea without setting certain environment variables and passing some options, since it won&#039;t know where to store data and logs, so it is recommended to start gitea using the init script:&lt;br /&gt;
{{cmd|service gitea start}}&lt;br /&gt;
&lt;br /&gt;
To add Gitea to the default runlevel (such that it runs automatically on every boot):&lt;br /&gt;
{{cmd|rc-update add gitea}}&lt;br /&gt;
&lt;br /&gt;
To stop the Gitea service:&lt;br /&gt;
{{cmd|service gitea stop}}&lt;br /&gt;
&lt;br /&gt;
=== Running Gitea without the init script ===&lt;br /&gt;
&lt;br /&gt;
If (for whatever reason), you would like to start Gitea without using the initscript, you should first stop the Gitea service:&lt;br /&gt;
{{cmd|service gitea stop}}&lt;br /&gt;
&lt;br /&gt;
Then, run Gitea with this command (as the &amp;lt;code&amp;gt;gitea&amp;lt;/code&amp;gt; user):&lt;br /&gt;
{{cmd|&amp;lt;nowiki&amp;gt;GITEA_WORK_DIR=/var/lib/gitea gitea web --config /etc/gitea/app.ini&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
This will use the correct configuration file and write to the correct directories.&lt;br /&gt;
&lt;br /&gt;
== Post installation ==&lt;br /&gt;
&lt;br /&gt;
{{Expand}}&lt;br /&gt;
&lt;br /&gt;
After installing Gitea, go to &amp;lt;nowiki&amp;gt;http://localhost:3000&amp;lt;/nowiki&amp;gt; and start the post-installation process.&lt;br /&gt;
&lt;br /&gt;
== Setting up SSH Git access ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Do not&#039;&#039;&#039; try to be clever and use &amp;lt;code&amp;gt;ssh-copy-id&amp;lt;/code&amp;gt;, as it will not have the correct command set.&lt;br /&gt;
&lt;br /&gt;
As an example, if this is the public key:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ssh-ed25519 ******************************************************************** **********@gmail.com&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The line in {{path|.ssh/authorized_keys}} needs to be:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
command=&amp;quot;/usr/bin/gitea --config=/etc/gitea/app.ini serv key-2&amp;quot;,no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty ssh-ed25519 ******************************************************************** **********@gmail.com&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In order to do this, [https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent generate a SSH key], then go to the Gitea settings panel and click the &amp;lt;code&amp;gt;Add Key&amp;lt;/code&amp;gt; button, then paste in your public key.&lt;br /&gt;
&lt;br /&gt;
Now, once you&#039;ve added your private key to the SSH agent, you can use SSH with Gitea like you normally would with GitHub, GitLab, etc.&lt;br /&gt;
&lt;br /&gt;
[[Category:Server]]&lt;br /&gt;
[[Category:Git]]&lt;/div&gt;</summary>
		<author><name>Andrew71</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Raspberry_Pi&amp;diff=25837</id>
		<title>Raspberry Pi</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Raspberry_Pi&amp;diff=25837"/>
		<updated>2023-11-29T18:58:39Z</updated>

		<summary type="html">&lt;p&gt;Andrew71: Fix broken code tags&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{warning | 11 Feb 2021 - There is currently a known bug upstream &amp;lt;br /&amp;gt;[https://github.com/raspberrypi/firmware/issues/1529 kernel/initramfs cannot be loaded from subdirectory with same name as volume label]. Since the kernel is installed to &amp;lt;code&amp;gt;boot/&amp;lt;/code&amp;gt;, you must not use a label named &amp;lt;code&amp;gt;boot&amp;lt;/code&amp;gt; for the fat32 partition. }}&lt;br /&gt;
&lt;br /&gt;
{{TOC right}}&lt;br /&gt;
&lt;br /&gt;
This tutorial explains how to install Alpine Linux on a Raspberry Pi. Alpine Linux will be installed in [[Installation#Diskless_Mode|diskless mode]], hence, [[Alpine local backup|Alpine Local Backup (lbu)]] is required to save modifications between reboots.&lt;br /&gt;
&lt;br /&gt;
For scenarios where there is not expected to be significant changes to disk after setup (like running a static HTTP server), this is likely preferable, as running the entire system from memory will improve performance (by avoiding the slow SD card) and improve the SD card life (by reducing the writes to the card, as all logging will happen in RAM). Diskless installations still allow you to install packages, save local files, and tune the system to your needs.&lt;br /&gt;
&lt;br /&gt;
If any of the following apply, then installation in [[Classic install or sys mode on Raspberry Pi|sys-mode installation]] is likely more appropriate.&lt;br /&gt;
&lt;br /&gt;
* There will be constant changes to the disk after initial setup (for example, if you expect people to login and save files to their home directories)&lt;br /&gt;
* Logs should persists across reboots&lt;br /&gt;
* Plan to install packages which consume more space than can be loaded into RAM&lt;br /&gt;
* Plan to install kernel modules (such as ZFS)&lt;br /&gt;
&lt;br /&gt;
== Preparation ==&lt;br /&gt;
&lt;br /&gt;
# [https://alpinelinux.org/downloads/ Download] the Alpine for Raspberry Pi tarball. You should be safe using the &#039;&#039;&#039;armhf&#039;&#039;&#039; build on all versions of Raspberry Pi (including Pi Zero and Compute Modules); but it may perform less optimally on recent versions of Raspberry Pi. The &#039;&#039;&#039;armv7&#039;&#039;&#039; build is compatible with Raspberry Pi 2 Model B. The &#039;&#039;&#039;aarch64&#039;&#039;&#039; build should be compatible with Raspberry Pi 2 Model v1.2, Raspberry Pi 3 and Compute Module 3, and Raspberry Pi 4 model B.&lt;br /&gt;
# [[Create_a_Bootable_Device#Manually_copying_Alpine_files|Create a bootable FAT32 partition on your SD card.]] The partitioning and formatting part of the instructions on the linked page could be done using a graphical partitioning tool such as [https://en.wikipedia.org/wiki/GNOME_Disks gnome-disks], just make sure the partition type is &amp;lt;code&amp;gt;W95 FAT32 (LBA)&amp;lt;/code&amp;gt;. (The current type can be found in the &amp;quot;Type&amp;quot; column in the output of &amp;lt;code&amp;gt;fdisk -l&amp;lt;/code&amp;gt;.)&lt;br /&gt;
# Extract the tarball to the root of the bootable FAT32 partition.&lt;br /&gt;
&lt;br /&gt;
To setup a headless system, a bootstrapping configuration overlay file [https://github.com/macmpi/alpine-linux-headless-bootstrap  headless.apkovl.tar.gz] may be added to enable basic networking, so that following configuration steps can be performed under &amp;lt;code&amp;gt;ssh&amp;lt;/code&amp;gt;. Pi Zero may be configured with simple USB ethernet-gadget networking with another computer sharing its internet connection.&lt;br /&gt;
&lt;br /&gt;
Optionally create a &#039;&#039;&#039;usercfg.txt&#039;&#039;&#039; file on the partition to configure low-level system settings. Specifications can be found [https://www.raspberrypi.org/documentation/configuration/config-txt here]. However, note some settings can only be set directly in &#039;&#039;&#039;config.txt&#039;&#039;&#039;, which may be overwritten after updates. In particular, &amp;lt;code&amp;gt;gpu_mem&amp;lt;/code&amp;gt; will have no effect when specified in &#039;&#039;&#039;usercfg.txt&#039;&#039;&#039; ([https://github.com/raspberrypi/firmware/issues/1332 source]). Some interesting values include:&lt;br /&gt;
* To enable the UART console: &amp;lt;code&amp;gt;enable_uart=1&amp;lt;/code&amp;gt;&lt;br /&gt;
* To enable audio: &amp;lt;code&amp;gt;dtparam=audio=on&amp;lt;/code&amp;gt;&lt;br /&gt;
* If you see black edges around your screen after booting the Pi, you can add &amp;lt;code&amp;gt;disable_overscan=1&amp;lt;/code&amp;gt;&lt;br /&gt;
* If you plan to install on a Pi Compute Module 4 with I/O board, you may need to add: &amp;lt;code&amp;gt;otg_mode=1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Recent versions include Broadcom firmware files. If you&#039;re using an older Alpine version, see [[#Wireless_support_with_older_Alpine_images|section below]].&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
Follow these steps to install Alpine Linux in Diskless Mode:&lt;br /&gt;
&lt;br /&gt;
# Insert the SD card into the Raspberry Pi and power it on&lt;br /&gt;
# Login into the Alpine system as root.  Leave the password empty.&lt;br /&gt;
# Type &amp;lt;code&amp;gt;setup-alpine&amp;lt;/code&amp;gt;&lt;br /&gt;
# Once the installation is complete, commit the changes by typing &amp;lt;code&amp;gt;lbu commit -d&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Type &amp;lt;code&amp;gt;reboot&amp;lt;/code&amp;gt; to verify that the installation was indeed successful.&lt;br /&gt;
&lt;br /&gt;
== Post Installation ==&lt;br /&gt;
&lt;br /&gt;
=== Update the System ===&lt;br /&gt;
&lt;br /&gt;
After installation, make sure your system is up-to-date:&lt;br /&gt;
&lt;br /&gt;
{{cmd|apk update&lt;br /&gt;
apk upgrade}}&lt;br /&gt;
&lt;br /&gt;
Don&#039;t forget to save the changes:&lt;br /&gt;
&lt;br /&gt;
{{cmd|lbu commit -d}}&lt;br /&gt;
&lt;br /&gt;
Note: this does not upgrade the kernel. In order to upgrade the kernel, a full upgrade of the Alpine Linux version must be performed as described in [[Upgrading Alpine#Upgrading Alpine Linux on other removable media (such as CF/USB)|upgrading Alpine Linux for removable media]].&lt;br /&gt;
&lt;br /&gt;
=== Clock-related error messages ===&lt;br /&gt;
&lt;br /&gt;
During the booting time, you might notice errors related to the hardware clock.  The Raspberry Pi does not have&lt;br /&gt;
a hardware clock, thus you need to disable the hwclock daemon and enable swclock:&lt;br /&gt;
&lt;br /&gt;
{{cmd|rc-update add swclock boot    # enable the software clock&lt;br /&gt;
rc-update del hwclock boot    # disable the hardware clock}}&lt;br /&gt;
&lt;br /&gt;
Since the Raspberry Pi does not have a clock, Alpine Linux needs to know what the time is by using a&lt;br /&gt;
[https://en.wikipedia.org/wiki/Network_Time_Protocol Network Time Protocol (NTP)] daemon.  Make sure you have a&lt;br /&gt;
NTP daemon installed and running.  If you are not sure, you can install an NTP client by running the following&lt;br /&gt;
command:&lt;br /&gt;
&lt;br /&gt;
{{cmd|setup-ntp}}&lt;br /&gt;
&lt;br /&gt;
The Busybox NTP client might be the most lightweight solution.  Save the changes and reboot, once the NTP software is&lt;br /&gt;
installed and running:&lt;br /&gt;
&lt;br /&gt;
{{cmd|lbu commit -d&lt;br /&gt;
reboot}}&lt;br /&gt;
&lt;br /&gt;
After reboot, make sure the &amp;lt;code&amp;gt;date&amp;lt;/code&amp;gt; command outputs the correct date and time.&lt;br /&gt;
&lt;br /&gt;
=== WiFi on boot ===&lt;br /&gt;
If you have already [[Connecting_to_a_wireless_access_point|configured WiFi]] during the setup, the connection will not return on reboot.&lt;br /&gt;
You will need to start up a service to automatically connect to the wireless access point.&lt;br /&gt;
# Run &amp;lt;code&amp;gt;rc-update add wpa_supplicant boot&amp;lt;/code&amp;gt; to connect to the wireless access point during bootup.&lt;br /&gt;
# Run it manually with &amp;lt;code&amp;gt;rc-service wpa_supplicant start&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Enable Graphics ===&lt;br /&gt;
Remount the boot partition writeable (i.e. &amp;lt;code&amp;gt;/media/mmcblk0p1&amp;lt;/code&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
{{cmd|mount /media/mmcblk0p1 -o rw,remount}}&lt;br /&gt;
&lt;br /&gt;
Add the following lines to &amp;lt;code&amp;gt;/media/mmcblk0p1/config.txt&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 dtoverlay=vc4-kms-v3d&lt;br /&gt;
&lt;br /&gt;
If you are experiencing graphical issues, you can also try:&lt;br /&gt;
&lt;br /&gt;
 dtoverlay=vc4-fkms-v3d&lt;br /&gt;
&lt;br /&gt;
And perhaps also raising the default &amp;lt;code&amp;gt;gpu_mem&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 gpu_mem=128&lt;br /&gt;
&lt;br /&gt;
Note that raising the gpu memory is not likely to [https://www.raspberrypi.com/documentation/computers/config_txt.html#gpu_mem actually improve performance on the Pi4]&lt;br /&gt;
&lt;br /&gt;
Install the Mesa drivers:&lt;br /&gt;
&lt;br /&gt;
{{cmd|&amp;lt;nowiki&amp;gt;apk add mesa-dri-gallium&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Then reboot:&lt;br /&gt;
&lt;br /&gt;
{{cmd|lbu_commit -d; reboot}}&lt;br /&gt;
&lt;br /&gt;
=== WiFi drivers ===&lt;br /&gt;
As of Alpine 3.14, the WiFi drivers for the Raspberry Pi were moved from &amp;lt;code&amp;gt;linux-firmware-brcm&amp;lt;/code&amp;gt; to the &amp;lt;code&amp;gt;linux-firmware-cypress&amp;lt;/code&amp;gt; package (source?). Since the images seem to be an outdated version of the former, Wi-Fi will work during installation, but after the first update it will break.&lt;br /&gt;
Use the ethernet interface to download the required packages:&lt;br /&gt;
&lt;br /&gt;
{{cmd|apk add linux-firmware-cypress}}&lt;br /&gt;
&lt;br /&gt;
And reboot.&lt;br /&gt;
&lt;br /&gt;
== Persistent storage ==&lt;br /&gt;
=== Loopback image with overlayfs ===&lt;br /&gt;
&lt;br /&gt;
When you install Alpine in diskless mode, the entire system is loaded into memory at boot. If you want additional storage (for example, if you need more space than offered by your RAM) we need to create loop-back storage onto the SD card mounted with overlayfs.&lt;br /&gt;
&lt;br /&gt;
First, make the SD card writable again and change fstab to always do so:&lt;br /&gt;
{{cmd|mount /media/mmcblk0p1 -o rw,remount&lt;br /&gt;
sed -i &#039;s/vfat\ ro,/vfat\ rw,/&#039; /etc/fstab}}&lt;br /&gt;
&lt;br /&gt;
Create the loop-back file, this example is 1 GB:&lt;br /&gt;
&lt;br /&gt;
{{cmd|dd if&amp;amp;#61;/dev/zero of&amp;amp;#61;/media/mmcblk0p1/persist.img bs&amp;amp;#61;1024 count&amp;amp;#61;0 seek&amp;amp;#61;1048576}}&lt;br /&gt;
&lt;br /&gt;
Install the ext utilities:&lt;br /&gt;
&lt;br /&gt;
{{cmd|apk add e2fsprogs}}&lt;br /&gt;
&lt;br /&gt;
Format the loop-back file:&lt;br /&gt;
&lt;br /&gt;
{{cmd|mkfs.ext4 /media/mmcblk0p1/persist.img}}&lt;br /&gt;
&lt;br /&gt;
Mount the storage: &lt;br /&gt;
&lt;br /&gt;
{{cmd|echo &amp;quot;/media/mmcblk0p1/persist.img /media/persist ext4 rw,relatime,errors&amp;amp;#61;remount-ro 0 0&amp;quot; &amp;gt;&amp;gt; /etc/fstab&lt;br /&gt;
mkdir /media/persist &lt;br /&gt;
mount -a}}&lt;br /&gt;
&lt;br /&gt;
Make the overlay folders, we are using the /usr directory here, but you can use /home or anything else. &lt;br /&gt;
{{Warning|Overlay workdir needs to be an empty directory on the same filesystem mount as the upper directory. So each overlay must use its own workdir.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{cmd|mkdir /media/persist/usr &lt;br /&gt;
mkdir /media/persist/.work_usr &lt;br /&gt;
echo &amp;quot;overlay /usr overlay lowerdir&amp;amp;#61;/usr,upperdir&amp;amp;#61;/media/persist/usr,workdir&amp;amp;#61;/media/persist/.work_usr 0 0&amp;quot; &amp;gt;&amp;gt; /etc/fstab &lt;br /&gt;
mount -a}}&lt;br /&gt;
&lt;br /&gt;
Your /etc/fstab should look something like this:&lt;br /&gt;
{{Cmd|/dev/cdrom      /media/cdrom    iso9660 noauto,ro 0 0&lt;br /&gt;
/dev/usbdisk    /media/usb      vfat    noauto,ro 0 0&lt;br /&gt;
/dev/mmcblk0p1 /media/mmcblk0p1 vfat rw,relatime,fmask&amp;amp;#61;0022,dmask&amp;amp;#61;0022,errors&amp;amp;#61;remount-ro 0 0&lt;br /&gt;
/media/mmcblk0p1/persist.img /media/persist ext4 rw,relatime,errors&amp;amp;#61;remount-ro 0 0&lt;br /&gt;
overlay /usr overlay lowerdir&amp;amp;#61;/usr,upperdir&amp;amp;#61;/media/persist/usr,workdir&amp;amp;#61;/media/persist/.work_usr 0 0}}&lt;br /&gt;
&lt;br /&gt;
Now commit the changes: (optionally remove the e2fsprogs, but it does contain repair tools)&lt;br /&gt;
{{cmd|lbu_commit -d}}&lt;br /&gt;
&lt;br /&gt;
Remember, with this setup if you install things and you have done this overlay for /usr, you must not commit the &#039;apk add&#039;, otherwise, while it boots it will try and install it to memory, not to the persistent storage.&lt;br /&gt;
&lt;br /&gt;
If you do want to install something small at boot, you can use &amp;lt;code&amp;gt;apk add&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;lbu commit -d&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If it is something a bit bigger, then you can use &amp;lt;code&amp;gt;apk add&amp;lt;/code&amp;gt; but then not commit it. It will be persistent (in &amp;lt;code&amp;gt;/user&amp;lt;/code&amp;gt;), but be sure to check everything you need is in that directory and not in folders you have not made persistent.&lt;br /&gt;
&lt;br /&gt;
=== Traditional disk-based (sys) installation ===&lt;br /&gt;
{{Merge|Classic install or sys mode on Raspberry Pi|There&#039;s an existing page for sys-installations on RasPi.}}&lt;br /&gt;
&lt;br /&gt;
It is also possible to switch to a fully disk-based installation. This is not yet formally supported, but can be done somewhat manually. This frees all the memory otherwise needed for the root filesystem, allowing more installed packages.&lt;br /&gt;
&lt;br /&gt;
Split your SD card into two partitions: the FAT32 boot partition described above (in this example it&#039;ll be &amp;lt;code&amp;gt;mmcblk0p1&amp;lt;/code&amp;gt;) , and a second partition to hold the root filesystem (here it&#039;ll be &amp;lt;code&amp;gt;mmcblk0p2&amp;lt;/code&amp;gt;). Boot and configure your diskless system as above, then create a root filesystem:&lt;br /&gt;
&lt;br /&gt;
{{cmd|apk add e2fsprogs&lt;br /&gt;
mkfs.ext4 /dev/mmcblk0p2}}&lt;br /&gt;
&lt;br /&gt;
Now do a disk install via a mountpoint. The &amp;lt;code&amp;gt;setup-disk&amp;lt;/code&amp;gt; script will give some errors about syslinux/extlinux, but you can ignore them.&lt;br /&gt;
The Raspberry Pi doesn&#039;t need them to boot.&lt;br /&gt;
&lt;br /&gt;
{{cmd|&amp;lt;nowiki&amp;gt;mkdir /stage&lt;br /&gt;
mount /dev/mmcblk0p2 /stage&lt;br /&gt;
setup-disk -o /media/mmcblk0p1/MYHOSTNAME.apkovl.tar.gz /stage&lt;br /&gt;
# (ignore errors about syslinux/extlinux)&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Add a line to &amp;lt;code&amp;gt;/stage/etc/fstab&amp;lt;/code&amp;gt; to mount the Pi&#039;s boot partition again:&lt;br /&gt;
&lt;br /&gt;
{{cmd|/dev/mmcblk0p1 /media/mmcblk0p1 vfat defaults 0 0}}&lt;br /&gt;
&lt;br /&gt;
Now add a &amp;lt;code&amp;gt;root=/dev/mmcblk0p2&amp;lt;/code&amp;gt; parameter to the Pi&#039;s boot command line, either &amp;lt;code&amp;gt;cmdline-rpi2.txt&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;cmdline-rpi.txt&amp;lt;/code&amp;gt; depending on model:&lt;br /&gt;
&lt;br /&gt;
{{cmd|&amp;lt;nowiki&amp;gt;mount -o remount,rw /media/mmcblk0p1&lt;br /&gt;
sed -i &#039;$ s/$/ root=\/dev\/mmcblk0p2/&#039; /media/mmcblk0p1/cmdline-rpi2.txt&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
You might also consider &amp;lt;code&amp;gt;overlaytmpfs=yes&amp;lt;/code&amp;gt; here, which will cause the underlying SD card root filesystem to be mounted read-only, with an overlayed tmpfs for modifications which will be discarded at shutdown.&lt;br /&gt;
&lt;br /&gt;
N.B. &amp;lt;b&amp;gt;the contents of /boot will be ignored when the Pi boots&amp;lt;/b&amp;gt;. It will use the kernel, initramfs, and modloop images from the FAT32 boot partition. To update the kernel, initfs or modules, you will need to manually (generate and) copy these to the boot partition or you could use bind mount, in which case,&lt;br /&gt;
copying the files to boot partition manually, is not needed.&lt;br /&gt;
&lt;br /&gt;
{{cmd|&amp;lt;nowiki&amp;gt;echo /media/mmcblk0p1/boot /boot none defaults,bind 0 0 &amp;gt;&amp;gt; /etc/fstab&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
=== Persistent Installation on Raspberry Pi 3 ===&lt;br /&gt;
See [[Classic install or sys mode on Raspberry Pi]] and https://web.archive.org/web/20171125115835/https://forum.alpinelinux.org/comment/1084#comment-1084&lt;br /&gt;
&lt;br /&gt;
=== Persistent Installation on Raspberry Pi 4 ===&lt;br /&gt;
As of 3.14, setup-alpine should ask you if you want to create a sys mode partition on your Raspberry Pi 4.&lt;br /&gt;
&lt;br /&gt;
== Netboot ==&lt;br /&gt;
&lt;br /&gt;
=== Netbooting Raspberry Pi 4 ===&lt;br /&gt;
&lt;br /&gt;
The Raspberry Pi 4 bootloader can be configured to boot from the network [https://www.raspberrypi.com/documentation/computers/raspberry-pi.html#raspberry-pi-4-bootloader-configuration]. Configure the bootloader with at least&lt;br /&gt;
&lt;br /&gt;
{{cmd|&amp;lt;nowiki&amp;gt;BOOT_ORDER=0xf142&lt;br /&gt;
TFTP_PREFIX=1&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
and optionally also {{cmd|&amp;lt;nowiki&amp;gt;TFTP_IP=x.x.x.x&amp;lt;/nowiki&amp;gt;}} where &amp;lt;code&amp;gt;x.x.x.x&amp;lt;/code&amp;gt; is the IP address of your TFTP server.&lt;br /&gt;
&lt;br /&gt;
If not configuring &amp;lt;code&amp;gt;TFTP_IP&amp;lt;/code&amp;gt; in the bootloader, you&#039;ll need to configure your DHCP server to advertise the TFTP server IP address. This varies depending on your DHCP server; use the following details if applicable:&lt;br /&gt;
&lt;br /&gt;
# Vendor class: &amp;lt;code&amp;gt;PXEClient:Arch:00000:UNDI:002001&amp;lt;/code&amp;gt;&lt;br /&gt;
# Filename: &amp;lt;code&amp;gt;/&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The minimal set of files that your TFTP server needs to host are:&lt;br /&gt;
&lt;br /&gt;
# &amp;lt;code&amp;gt;bcm2711-rpi-4-b.dtb&amp;lt;/code&amp;gt; (from [https://raw.githubusercontent.com/raspberrypi/firmware/master/boot/bcm2711-rpi-4-b.dtb raspberrypi/firmware/master/boot/bcm2711-rpi-4-b.dtb])&lt;br /&gt;
# &amp;lt;code&amp;gt;cmdline.txt&amp;lt;/code&amp;gt; (see below)&lt;br /&gt;
# &amp;lt;code&amp;gt;config.txt&amp;lt;/code&amp;gt; (see below)&lt;br /&gt;
# &amp;lt;code&amp;gt;fixup4.dat&amp;lt;/code&amp;gt; (from [https://raw.githubusercontent.com/raspberrypi/firmware/master/boot/fixup4.dat raspberrypi/firmware/master/boot/fixup4.dat], alternatively &amp;lt;code&amp;gt;fixup4cd.dat&amp;lt;/code&amp;gt; for the cut down version)&lt;br /&gt;
# &amp;lt;code&amp;gt;initramfs-rpi4&amp;lt;/code&amp;gt; (from [https://dl-cdn.alpinelinux.org/alpine/edge/releases/aarch64/netboot/initramfs-rpi4 alpine/edge/releases/aarch64/netboot/initramfs-rpi4])&lt;br /&gt;
# &amp;lt;code&amp;gt;start4.elf&amp;lt;/code&amp;gt; (from [https://raw.githubusercontent.com/raspberrypi/firmware/master/boot/start4.elf raspberrypi/firmware/master/boot/start4.elf], alternatively &amp;lt;code&amp;gt;start4cd.elf&amp;lt;/code&amp;gt; for the cut down version)&lt;br /&gt;
# &amp;lt;code&amp;gt;vmlinuz-rpi4&amp;lt;/code&amp;gt; (from [https://dl-cdn.alpinelinux.org/alpine/edge/releases/aarch64/netboot/vmlinuz-rpi4 alpine/edge/releases/aarch64/netboot/vmlinuz-rpi4])&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;config.txt&amp;lt;/code&amp;gt;:&lt;br /&gt;
{{cmd|&amp;lt;nowiki&amp;gt;[pi4]&lt;br /&gt;
kernel=vmlinuz-rpi4&lt;br /&gt;
initramfs initramfs-rpi4&lt;br /&gt;
arm_64bit=1&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cmdline.txt&amp;lt;/code&amp;gt;:&lt;br /&gt;
{{cmd|&amp;lt;nowiki&amp;gt;modules=loop,squashfs console=ttyAMA0,115200 ip=dhcp alpine_repo=http://dl-cdn.alpinelinux.org/alpine/edge/main modloop=http://dl-cdn.alpinelinux.org/alpine/edge/releases/aarch64/netboot/modloop-rpi4&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Instead of using the &amp;lt;nowiki&amp;gt;http://dl-cdn.alpinelinux.org/alpine/edge/releases/aarch64/netboot/&amp;lt;/nowiki&amp;gt; base URL above, pinning to a specific point in time is preferred. Raspberry Pi 4 netboot files are available from https://dl-cdn.alpinelinux.org/alpine/edge/releases/aarch64/netboot-20230329/ onward.&lt;br /&gt;
&lt;br /&gt;
With the above configured the Raspberry Pi 4 should be able to boot from the network without an SD card.&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
=== Long boot time when running headless ===&lt;br /&gt;
&lt;br /&gt;
If no peripherals are connected, the system might hang for an exceptionally long period of time while it attempts to accumulate entropy.&lt;br /&gt;
&lt;br /&gt;
If this is the case, simply plugging in any USB device should work around this issue, since it increases the amount of entropy available to the kernel via interrupts.&lt;br /&gt;
&lt;br /&gt;
=== apk indicating &#039;No space left on device&#039; ===&lt;br /&gt;
&lt;br /&gt;
Note some models of the Raspberry Pi such as the 3A+ only have 512M of RAM, which on fresh Alpine deployment will only leave around 200M for tmpfs root. It&#039;s important to keep this limitation in mind when using these boards.&lt;br /&gt;
&lt;br /&gt;
=== Wireless support with older Alpine images ===&lt;br /&gt;
&lt;br /&gt;
If you need Wi-Fi, you&#039;ll need to [https://github.com/RPi-Distro/firmware-nonfree/tree/master/brcm download] the latest Broadcom drivers to your SD card.&lt;br /&gt;
(Replace /mnt/sdcard with the correct mount point.)&lt;br /&gt;
&lt;br /&gt;
  git clone --depth 1 https://github.com/RPi-Distro/firmware-nonfree.git&lt;br /&gt;
  cp firmware-nonfree/brcm/* /mnt/sdcard/firmware/brcm&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[Classic install or sys mode on Raspberry Pi]] - a variant.&lt;br /&gt;
* [[Raspberry Pi 3 - Setting Up Bluetooth]]&lt;br /&gt;
* [[Raspberry Pi 3 - Configuring it as wireless access point -AP Mode]]&lt;br /&gt;
* [[Raspberry Pi 3 - Browser Client]]&lt;br /&gt;
* [[Linux Router with VPN on a Raspberry Pi]]&lt;br /&gt;
* [[Create a bootable SDHC from a Mac]]&lt;br /&gt;
* Build custom Raspberry Pi images based on Alpine via [https://github.com/tolstoyevsky/pieman Pieman]&lt;br /&gt;
* [[Tutorials and Howtos#Raspberry Pi]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Installation]]&lt;br /&gt;
[[Category: Raspberry]]&lt;/div&gt;</summary>
		<author><name>Andrew71</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Docker&amp;diff=25836</id>
		<title>Docker</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Docker&amp;diff=25836"/>
		<updated>2023-11-29T16:27:31Z</updated>

		<summary type="html">&lt;p&gt;Andrew71: Improve formatting consistency&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Installation ==&lt;br /&gt;
&lt;br /&gt;
The {{Pkg|docker}} package is in the &#039;&#039;community&#039;&#039; repository. See [[Repositories]] how to add a repository.&lt;br /&gt;
&lt;br /&gt;
 apk add docker&lt;br /&gt;
&lt;br /&gt;
Connecting to the Docker daemon through its socket requires you to add yourself to the &amp;lt;code&amp;gt;docker&amp;lt;/code&amp;gt; group.&lt;br /&gt;
&lt;br /&gt;
 addgroup username docker&lt;br /&gt;
&lt;br /&gt;
To start the Docker daemon at boot, see [[OpenRC]].&lt;br /&gt;
&lt;br /&gt;
 rc-update add docker default&lt;br /&gt;
 service docker start&lt;br /&gt;
&lt;br /&gt;
=== Docker rootless ===&lt;br /&gt;
&lt;br /&gt;
Docker rootless allows unprivileged users to run the docker daemon and docker containers in user namespaces. This is not the same as dockremap explained in the section below. With dockremap the daemon still runs as root.&lt;br /&gt;
&lt;br /&gt;
This requires the {{Pkg|docker-rootless-extras}} package (available in &#039;&#039;community&#039;&#039;) and enabling &amp;lt;code&amp;gt;cgroups v2&amp;lt;/code&amp;gt;:&lt;br /&gt;
edit &amp;lt;code&amp;gt;/etc/rc.conf&amp;lt;/code&amp;gt; and set &amp;lt;code&amp;gt;rc_cgroup_mode=&amp;quot;unified&amp;quot;&amp;lt;/code&amp;gt;. Then start the service on boot:&lt;br /&gt;
&lt;br /&gt;
 rc-update add cgroups&lt;br /&gt;
&lt;br /&gt;
Additionally, the &amp;lt;code&amp;gt;/etc/subuid&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;/etc/subgid&amp;lt;/code&amp;gt; files need to be set up as explained in [https://docs.docker.com/engine/security/rootless/ the official documentation].&lt;br /&gt;
&lt;br /&gt;
=== Docker Compose ===&lt;br /&gt;
&lt;br /&gt;
{{Pkg|docker-cli-compose}} is in the &#039;&#039;community&#039;&#039; repository starting with Alpine Linux 3.15.&lt;br /&gt;
&lt;br /&gt;
 apk add docker-cli-compose&lt;br /&gt;
&lt;br /&gt;
== Isolate containers with a user namespace ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
adduser -SDHs /sbin/nologin dockremap&lt;br /&gt;
addgroup -S dockremap&lt;br /&gt;
echo dockremap:$(cat /etc/passwd|grep dockremap|cut -d: -f3):65536 &amp;gt;&amp;gt; /etc/subuid&lt;br /&gt;
echo dockremap:$(cat /etc/passwd|grep dockremap|cut -d: -f4):65536 &amp;gt;&amp;gt; /etc/subgid&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
add to &amp;lt;code&amp;gt;/etc/docker/daemon.json&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{  &lt;br /&gt;
        &amp;quot;userns-remap&amp;quot;: &amp;quot;dockremap&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;You may also consider these options : &#039;&#039;&lt;br /&gt;
        &amp;quot;experimental&amp;quot;: false,&lt;br /&gt;
        &amp;quot;live-restore&amp;quot;: true,&lt;br /&gt;
        &amp;quot;ipv6&amp;quot;: false,&lt;br /&gt;
        &amp;quot;icc&amp;quot;: false,&lt;br /&gt;
        &amp;quot;no-new-privileges&amp;quot;: false&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You&#039;ll find all possible configurations [https://docs.docker.com/engine/reference/commandline/dockerd/#daemon-configuration-file here].&lt;br /&gt;
&lt;br /&gt;
== Example: How to install docker from Arch ==&lt;br /&gt;
&lt;br /&gt;
https://wiki.archlinux.org/index.php/Docker&lt;br /&gt;
&lt;br /&gt;
== &amp;quot;WARNING: No {swap,memory} limit support&amp;quot; ==&lt;br /&gt;
&lt;br /&gt;
You might encounter this message when executing &amp;lt;code&amp;gt;docker info&amp;lt;/code&amp;gt;.&lt;br /&gt;
To correct this situation, we have to enable the &amp;lt;code&amp;gt;cgroup_enable=memory swapaccount=1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Alpine 3.8 ====&lt;br /&gt;
It may not have been the case before, but with Alpine 3.8, you must configure cgroups properly&lt;br /&gt;
&lt;br /&gt;
{{Warning|This seems &#039;&#039;not&#039;&#039; to work with Alpine 3.9 and Docker 18.06. Follow the instructions for grub or extlinux below instead.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;echo &amp;quot;cgroup /sys/fs/cgroup cgroup defaults 0 0&amp;quot; &amp;gt;&amp;gt; /etc/fstab&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat &amp;gt;&amp;gt; /etc/cgconfig.conf &amp;lt;&amp;lt;EOF&lt;br /&gt;
mount {&lt;br /&gt;
cpuacct = /cgroup/cpuacct;&lt;br /&gt;
memory = /cgroup/memory;&lt;br /&gt;
devices = /cgroup/devices;&lt;br /&gt;
freezer = /cgroup/freezer;&lt;br /&gt;
net_cls = /cgroup/net_cls;&lt;br /&gt;
blkio = /cgroup/blkio;&lt;br /&gt;
cpuset = /cgroup/cpuset;&lt;br /&gt;
cpu = /cgroup/cpu;&lt;br /&gt;
}&lt;br /&gt;
EOF&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Grub ===&lt;br /&gt;
If you use Grub, add the cgroup condition into &amp;lt;code&amp;gt;/etc/default/grub&amp;lt;/code&amp;gt;, then upgrade your grub&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;GRUB_CMDLINE_LINUX_DEFAULT=&amp;quot;... cgroup_enable=memory swapaccount=1&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Extlinux ===&lt;br /&gt;
With Extlinux, you add the cgroup condition, but inside of &amp;lt;code&amp;gt;/etc/update-extlinux.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;default_kernel_opts=&amp;quot;... cgroup_enable=memory swapaccount=1&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then update the config and reboot&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;update-extlinux&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== How to use docker ==&lt;br /&gt;
&lt;br /&gt;
The best documentation on using Docker and creating containers is on the [https://docs.docker.com/ official docker site].  Adding anything to it here would be redundant.&lt;br /&gt;
&lt;br /&gt;
You can browse through user images on [https://hub.docker.com/ Docker Hub] and learn from the syntax in contributed dockerfiles.&lt;br /&gt;
&lt;br /&gt;
Official Docker image files are denoted on the website by a special badge.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [https://www.erianna.com/creating-a-alpine-linux-repository/ Creating and Hosting an Alpine Linux Package Repository for Docker Packages]&lt;br /&gt;
* [[Running Alpine in a Docker Container]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Virtualization]]&lt;/div&gt;</summary>
		<author><name>Andrew71</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Docker&amp;diff=25835</id>
		<title>Docker</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Docker&amp;diff=25835"/>
		<updated>2023-11-29T15:55:31Z</updated>

		<summary type="html">&lt;p&gt;Andrew71: Improve formatting a bit&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Installation ==&lt;br /&gt;
&lt;br /&gt;
The {{Pkg|docker}} package is in the &#039;community&#039; repository. See [[Repositories]] how to add a repository.&lt;br /&gt;
&lt;br /&gt;
 apk add docker&lt;br /&gt;
&lt;br /&gt;
Connecting to the Docker daemon through its socket requires you to add yourself to the `docker` group.&lt;br /&gt;
&lt;br /&gt;
 addgroup username docker&lt;br /&gt;
&lt;br /&gt;
To start the Docker daemon at boot, see [[OpenRC]].&lt;br /&gt;
&lt;br /&gt;
 rc-update add docker default&lt;br /&gt;
 service docker start&lt;br /&gt;
&lt;br /&gt;
=== Docker rootless ===&lt;br /&gt;
&lt;br /&gt;
Docker rootless allows unprivileged users to run the docker daemon and docker containers in user namespaces. This is not the same as dockremap explained in the section below. With dockremap the daemon still runs as root.&lt;br /&gt;
&lt;br /&gt;
This requires the {{Pkg|docker-rootless-extras}} package (available in &amp;lt;code&amp;gt;community&amp;lt;/code&amp;gt;) and enabling &amp;lt;code&amp;gt;cgroups v2&amp;lt;/code&amp;gt;:&lt;br /&gt;
edit /etc/rc.conf and set rc_cgroup_mode to unified. Then start the service on boot:&lt;br /&gt;
&lt;br /&gt;
 rc-update add cgroups&lt;br /&gt;
&lt;br /&gt;
Additionally, the &amp;lt;code&amp;gt;/etc/subuid&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;/etc/subgid&amp;lt;/code&amp;gt; files need to be set up as explained in [https://docs.docker.com/engine/security/rootless/ the official documentation].&lt;br /&gt;
&lt;br /&gt;
=== Docker Compose ===&lt;br /&gt;
&lt;br /&gt;
{{Pkg|docker-cli-compose}} is in the &#039;community&#039; repository starting with Alpine Linux 3.15.&lt;br /&gt;
&lt;br /&gt;
 apk add docker-cli-compose&lt;br /&gt;
&lt;br /&gt;
== Isolate containers with a user namespace ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
adduser -SDHs /sbin/nologin dockremap&lt;br /&gt;
addgroup -S dockremap&lt;br /&gt;
echo dockremap:$(cat /etc/passwd|grep dockremap|cut -d: -f3):65536 &amp;gt;&amp;gt; /etc/subuid&lt;br /&gt;
echo dockremap:$(cat /etc/passwd|grep dockremap|cut -d: -f4):65536 &amp;gt;&amp;gt; /etc/subgid&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
add to &#039;&#039;&#039;/etc/docker/daemon.json&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{  &lt;br /&gt;
        &amp;quot;userns-remap&amp;quot;: &amp;quot;dockremap&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;You may also consider these options : &#039;&#039;&lt;br /&gt;
        &amp;quot;experimental&amp;quot;: false,&lt;br /&gt;
        &amp;quot;live-restore&amp;quot;: true,&lt;br /&gt;
        &amp;quot;ipv6&amp;quot;: false,&lt;br /&gt;
        &amp;quot;icc&amp;quot;: false,&lt;br /&gt;
        &amp;quot;no-new-privileges&amp;quot;: false&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You&#039;ll find all possible configurations here[https://docs.docker.com/engine/reference/commandline/dockerd/#daemon-configuration-file].&lt;br /&gt;
&lt;br /&gt;
== Example: How to install docker from Arch ==&lt;br /&gt;
&lt;br /&gt;
https://wiki.archlinux.org/index.php/Docker&lt;br /&gt;
&lt;br /&gt;
== &amp;quot;WARNING: No {swap,memory} limit support&amp;quot; ==&lt;br /&gt;
&lt;br /&gt;
You might encounter this message when executing &amp;lt;code&amp;gt;docker info&amp;lt;/code&amp;gt;.&lt;br /&gt;
To correct this situation, we have to enable the &amp;lt;code&amp;gt;cgroup_enable=memory swapaccount=1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Alpine 3.8 ====&lt;br /&gt;
It may not have been the case before, but with Alpine 3.8, you must configure cgroups properly&lt;br /&gt;
&lt;br /&gt;
{{Warning|This seems &#039;&#039;not&#039;&#039; to work with Alpine 3.9 and Docker 18.06. Follow the instructions for grub or extlinux below instead.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;echo &amp;quot;cgroup /sys/fs/cgroup cgroup defaults 0 0&amp;quot; &amp;gt;&amp;gt; /etc/fstab&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat &amp;gt;&amp;gt; /etc/cgconfig.conf &amp;lt;&amp;lt;EOF&lt;br /&gt;
mount {&lt;br /&gt;
cpuacct = /cgroup/cpuacct;&lt;br /&gt;
memory = /cgroup/memory;&lt;br /&gt;
devices = /cgroup/devices;&lt;br /&gt;
freezer = /cgroup/freezer;&lt;br /&gt;
net_cls = /cgroup/net_cls;&lt;br /&gt;
blkio = /cgroup/blkio;&lt;br /&gt;
cpuset = /cgroup/cpuset;&lt;br /&gt;
cpu = /cgroup/cpu;&lt;br /&gt;
}&lt;br /&gt;
EOF&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Grub ===&lt;br /&gt;
If you use Grub, add the cgroup condition into &amp;lt;code&amp;gt;/etc/default/grub&amp;lt;/code&amp;gt;, then upgrade your grub&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;GRUB_CMDLINE_LINUX_DEFAULT=&amp;quot;... cgroup_enable=memory swapaccount=1&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Extlinux ===&lt;br /&gt;
With Extlinux, you add the cgroup condition, but inside of &amp;lt;code&amp;gt;/etc/update-extlinux.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;default_kernel_opts=&amp;quot;... cgroup_enable=memory swapaccount=1&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then update the config and reboot&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;update-extlinux&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== How to use docker ==&lt;br /&gt;
&lt;br /&gt;
The best documentation on using Docker and creating containers is at the [https://docs.docker.com/ official docker site].  Adding anything to it here would be redundant.&lt;br /&gt;
&lt;br /&gt;
If you create an account at docker.com, you can browse through user images and learn from the syntax in contributed dockerfiles.&lt;br /&gt;
&lt;br /&gt;
Official Docker image files are denoted on the website by a blue ribbon.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [https://www.erianna.com/creating-a-alpine-linux-repository/ Creating and Hosting an Alpine Linux Package Repository for Docker Packages]&lt;br /&gt;
* [[Running Alpine in a Docker Container]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Virtualization]]&lt;/div&gt;</summary>
		<author><name>Andrew71</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Create_a_Bootable_Device&amp;diff=25833</id>
		<title>Create a Bootable Device</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Create_a_Bootable_Device&amp;diff=25833"/>
		<updated>2023-11-28T18:38:09Z</updated>

		<summary type="html">&lt;p&gt;Andrew71: Add note for potential issue with device file and tip for syslinux install&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Note|These instructions are exclusively for x86_64 and x86. For ARM boards, see [[Alpine_on_ARM#Preparing_installation_media]].}}&lt;br /&gt;
&lt;br /&gt;
This page is about creating directly customizable boot devices. If you are looking for instructions on creating (flashing) read-only (iso9660 &amp;quot;CD&amp;quot; filesystem) images onto installation media, see the [[Installation#Flashing_.28direct_data_writing.29_the_installation_image-file_onto_a_device_or_media|Installation]] page instead.&lt;br /&gt;
&lt;br /&gt;
A directly customizable Alpine Linux boot medium is basically an Alpine system in &#039;&#039;&#039;[[Installation#Diskless_Mode|diskless]]&#039;&#039;&#039; or &#039;&#039;&#039;[[Installation#Data_Disk_Mode|data]]&#039;&#039;&#039; disk-mode installed to (and booting from) a device with a writable filesystem. It allows to also upgrade the kernel with its modules and firmware that is used to boot the system with the &amp;lt;code&amp;gt;[[Alpine_Linux_package_management#Upgrading_.22diskless.22_and_.22data.22_disk_mode_installs|update-kernel]]&amp;lt;/code&amp;gt; script.&lt;br /&gt;
&lt;br /&gt;
The more general local customizations, the configs (.apkovl) and the package cache, may of course also be stored on the same device, as long as the hardware is not being set to be write-locked by a hardware switch.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
= Requirements =&lt;br /&gt;
&lt;br /&gt;
* An Alpine Linux CD-ROM or an .iso file containing the desired Alpine release ([https://alpinelinux.org/downloads/ Download]).&lt;br /&gt;
* A device like an USB drive (flash, external HD, card reader, etc.) or a CF &amp;quot;CompactFlash&amp;quot;, or SDcard.&lt;br /&gt;
&lt;br /&gt;
= Using setup-bootable  =&lt;br /&gt;
&lt;br /&gt;
This is now the preferable method to create a directly customizable bootable device.&lt;br /&gt;
&lt;br /&gt;
It consists an [[Installation]] of a &#039;&#039;&#039;diskless&#039;&#039;&#039; or &#039;&#039;&#039;data&#039;&#039;&#039; mode system with configs and package cache on the target device, and using the &amp;lt;code&amp;gt;[[Alpine_setup_scripts#setup-bootable|setup-bootable]]&amp;lt;/code&amp;gt; script to make the device bootable.&lt;br /&gt;
&lt;br /&gt;
= Manually copying Alpine files =&lt;br /&gt;
&lt;br /&gt;
If you can&#039;t/won&#039;t use &#039;&#039;&#039;setup-bootable&#039;&#039;&#039;, you can manually create a customizable (writable) USB boot device instead.&lt;br /&gt;
&lt;br /&gt;
=== Copying ISO/tarball contents to a USB stick ===&lt;br /&gt;
&lt;br /&gt;
This method is written for copying files from an Alpine ISO file but also works for Alpine tarballs (.tar.gz files) with a one line tweak (see below).&lt;br /&gt;
&lt;br /&gt;
# Install some prerequisites. (If you&#039;re not currently using Alpine Linux then you probably have these installed already, otherwise you&#039;ll have to figure out how to install them.)&lt;br /&gt;
#: {{Cmd|apk add dosfstools&amp;lt;BR&amp;gt;apk add syslinux}}&lt;br /&gt;
# Set the environment variable &#039;mydev&#039; to the [https://en.wikipedia.org/wiki/Device_file device file] name of the USB stick that Alpine Linux is to be installed to:&lt;br /&gt;
#: {{Warning | BE SURE TO GET THIS RIGHT OR ELSE YOU COULD OVERWRITE THE WRONG DISK! }}&lt;br /&gt;
#: {{Note|If USB stick&#039;s device name ends in a digit, you might have to replace all instances of &amp;lt;code&amp;gt;${mydev}1&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;${mydev}p1&amp;lt;/code&amp;gt; below.}}&lt;br /&gt;
#: {{Cmd|&amp;lt;nowiki&amp;gt;mydev=/dev/sdU&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
# Make sure that the target drive&#039;s existing partitions, if any, are not mounted:&lt;br /&gt;
#: {{Cmd|umount -q $mydev?}}&lt;br /&gt;
# Copy and paste the following as a single command to wipe the target drive, create an MBR partition table, and create a single FAT32 partition (you can ignore any &amp;quot;Partition #1 contains a vfat signature.&amp;quot; warning message):&lt;br /&gt;
#: {{Cmd|&amp;lt;nowiki&amp;gt;fdisk -w always $mydev &amp;lt;&amp;lt;EOF&lt;br /&gt;
  o&lt;br /&gt;
  n&lt;br /&gt;
  p&lt;br /&gt;
  1&lt;br /&gt;
  2048&lt;br /&gt;
  -0&lt;br /&gt;
  t&lt;br /&gt;
  0c&lt;br /&gt;
  a&lt;br /&gt;
  w&lt;br /&gt;
EOF&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
# Format the new FAT32 partition with a FAT32 filesystem:&lt;br /&gt;
#: {{Cmd|&amp;lt;nowiki&amp;gt;mkdosfs -F32 ${mydev}1&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
# Copy the [https://wiki.syslinux.org/wiki/index.php?title=Mbr syslinix executable boot code] into the bootstrap code area of the MBR boot sector (if you&#039;re not currently using Alpine Linux you may need to adjust the path to syslinux&#039;s mbr.bin file):&lt;br /&gt;
#: {{Cmd|&amp;lt;nowiki&amp;gt;dd bs=440 count=1 conv=notrunc if=/usr/share/syslinux/mbr.bin of=$mydev&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
# Install the syslinux bootloader files onto the FAT32 filesystem. (Ignore the &amp;quot;Hidden (2048) does not match sectors (62)&amp;quot; messages - modern systems use the partition table. If you are getting &amp;quot;no previous syslinux boot sector found&amp;quot; error, try adding &amp;lt;code&amp;gt;--install&amp;lt;/code&amp;gt; flag):&lt;br /&gt;
#: {{Cmd|syslinux ${mydev}1}}&lt;br /&gt;
# Copy the Alpine files to the FAT32 filesystem (to copy the contents of an Alpine {{Path|.tar.gz}} tarball instead of copying {{Path|/media/cdrom}}, set &amp;lt;code&amp;gt;$alpinetarball&amp;lt;/code&amp;gt; to the path to the tarball and replace the &#039;cp&#039; line with: &amp;lt;code&amp;gt;tar -p -s --atime-preserve --same-owner --one-top-level=/media/$mydevname -zxvf &amp;quot;$alpinetarball&amp;quot;&amp;lt;/code&amp;gt;):&lt;br /&gt;
#: {{Cmd|&amp;lt;nowiki&amp;gt;mydevname=$(basename $mydev)1&lt;br /&gt;
mkdir -p /media/$mydevname&lt;br /&gt;
mount -t vfat ${mydev}1 /media/$mydevname&lt;br /&gt;
cp -aT /media/cdrom /media/$mydevname  # -T to copy hidden files&lt;br /&gt;
umount /media/$mydevname&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
# (&#039;&#039;Optional&#039;&#039;) Remove any .apkovl overlay files that were transferred as part of the copy process. Do this if you want an unmodified, vanilla install.&lt;br /&gt;
#: {{Cmd|&amp;lt;nowiki&amp;gt;mount -t vfat ${mydev}1 /media/$mydevname&lt;br /&gt;
rm /media/$mydevname/*.apkovl.tar.gz&lt;br /&gt;
umount /media/$mydevname&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Troubleshooting ===&lt;br /&gt;
&lt;br /&gt;
==== Wrong Device Name ====&lt;br /&gt;
&lt;br /&gt;
If you cannot boot from the boot device and you see something like:&lt;br /&gt;
 Mounting boot media failed.&lt;br /&gt;
 initramfs emergency recovery shell launched. Type &#039;exit&#039; to continue boot&lt;br /&gt;
then it is likely that the device name in {{Path|syslinux.cfg}} is wrong. You should replace the device name in this line:&lt;br /&gt;
 append initrd=/boot/grsec.gz alpine_dev=&#039;&#039;&#039;usbdisk&#039;&#039;&#039;:vfat modules=loop,cramfs,sd-mod,usb-storage quiet&lt;br /&gt;
with the proper device name.&lt;br /&gt;
* For boot from USB, the device name should be &#039;usbdisk&#039; (as shown above)&lt;br /&gt;
* For other options, you can run &amp;lt;code&amp;gt;cat /proc/partitions&amp;lt;/code&amp;gt; to see the available disks (i.e. &#039;sda&#039; or &#039;sdb&#039;)&lt;br /&gt;
&lt;br /&gt;
==== Non-FAT32 Filesystems ====&lt;br /&gt;
&lt;br /&gt;
===== Diskless and data mode booting =====&lt;br /&gt;
&lt;br /&gt;
When the boot device is formatted with a filesystem other than those supported by default, the necessary initfs features need to be added to the modloop using &amp;lt;code&amp;gt;update-kernel&amp;lt;/code&amp;gt;. See: [[Alpine_Linux_package_management#Upgrading_.22diskless.22_and_.22data.22_disk_mode_installs]]&lt;br /&gt;
&lt;br /&gt;
===== Sys mode booting  =====&lt;br /&gt;
&lt;br /&gt;
Mount the boot device and edit the {{Path|syslinux.cfg}} file.&lt;br /&gt;
&lt;br /&gt;
Then locate the &amp;quot;append&amp;quot; line, and change the &amp;lt;code&amp;gt;alpine_dev=&amp;lt;/code&amp;gt; setting to match the used filesystem and add the filesystem&#039;s kernel module to the &amp;lt;code&amp;gt;modules=&amp;lt;/code&amp;gt; list.&lt;br /&gt;
&lt;br /&gt;
For example, change&lt;br /&gt;
 append [...] alpine_dev=usbdisk:vfat modules=loop,cramfs,sd-mod,usb-storage quiet&lt;br /&gt;
to&lt;br /&gt;
 append [...] alpine_dev=usbdisk:&#039;&#039;&#039;ext4&#039;&#039;&#039; modules=loop,cramfs,sd-mod,usb-storage&#039;&#039;&#039;,ext4&#039;&#039;&#039; quiet&lt;br /&gt;
in the case of an ext4 formatted partition. (Or correspondingly for other filesystems, if they are supported by syslinux and the Alpine Linux kernel.)&lt;br /&gt;
&lt;br /&gt;
== Finishing installation ==&lt;br /&gt;
&lt;br /&gt;
After one has booted the previously created Alpine Linux bootable USB medium, one has to prepare USB stick to hold local customizations and run &#039;&#039;setup-alpine&#039;&#039; to finish the installation.&lt;br /&gt;
&lt;br /&gt;
First let&#039;s find out where is our just booted USB media mounted, the location could vary.&lt;br /&gt;
&lt;br /&gt;
 # mount | grep /media&lt;br /&gt;
 /dev/sdU1 on /media/sdU1 type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=utf8,shortname=mixed,errors=remount-ro)&lt;br /&gt;
&lt;br /&gt;
Create local directory on USB media to hold local APK cache (see [[Alpine_Linux_package_management#Local_Cache|APK Local Cache]] for details).&lt;br /&gt;
&lt;br /&gt;
 # mount -o remount,rw /media/sdU1&lt;br /&gt;
 # mkdir /media/sdU1/cache&lt;br /&gt;
 # setup-apkcache /media/sdU1/cache&lt;br /&gt;
 # ls -l /etc/apk/cache&lt;br /&gt;
 lrwxrwxrwx    1 root     root            17 Oct 19 13:16 /etc/apk/cache -&amp;gt; /media/sdU1/cache&lt;br /&gt;
&lt;br /&gt;
Now run &#039;&#039;setup-alpine&#039;&#039; and proceed until a question about local disk selection - in &#039;&#039;diskless&#039;&#039; mode we won&#039;t use any disk (ie. our bootable media files is basically untouched) and we are going to use &#039;&#039;sdU1&#039;&#039; to hold our system customization.&lt;br /&gt;
&lt;br /&gt;
 # setup-alpine&lt;br /&gt;
 ...&lt;br /&gt;
 Which disk(s) would you like to use? (or &#039;?&#039; for help or &#039;none&#039;) [none] &lt;br /&gt;
 Enter where to store configs (&#039;floppy&#039;, &#039;sdU1&#039;, &#039;usb&#039; or &#039;none&#039;) [sdU1]: &lt;br /&gt;
 Enter apk cache directory (or &#039;?&#039; or &#039;none&#039;) [/media/sdU1/cache]:&lt;br /&gt;
&lt;br /&gt;
After the installer finished you can see how many created/modified files are detected and will be added to the backup:&lt;br /&gt;
 # lbu status&lt;br /&gt;
 # lbu status | wc -l&lt;br /&gt;
 59&lt;br /&gt;
 # lbu commit&lt;br /&gt;
 # ls -l /media/sdU1/*apkovl.tar.gz&lt;br /&gt;
 -rwxr-xr-x    1 root     root          9591 Oct 19 15:23 /media/sdU1/foo.apkovl.tar.gz&lt;br /&gt;
&lt;br /&gt;
Now all the customization are saved into the &#039;&#039;foo.apkovl.tar.gz&#039;&#039; compressed tarball on the USB stick itself.&lt;br /&gt;
&lt;br /&gt;
= Troubleshooting =&lt;br /&gt;
&lt;br /&gt;
=== Slow USB Devices ===&lt;br /&gt;
Specifying the &#039;waitusb=X&#039; 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.&lt;br /&gt;
 append initrd=/boot/grsec.gz alpine_dev=usbdisk:vfat modules=loop,cramfs,sd-mod,usb-storage quiet &#039;&#039;&#039;waitusb=3&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== CF card readers ===&lt;br /&gt;
&lt;br /&gt;
Some CF card readers have problems with the faster CF cards on the market. If you experience problems booting the CF card even after checking BIOS settings, you may need to use an older card.&lt;br /&gt;
&lt;br /&gt;
Also, many CF card readers don&#039;t support DMA correctly, so you may need to add &#039;&#039;nodma&#039;&#039; to the &#039;&#039;append&#039;&#039; line of the syslinux.cfg file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Installation]]&lt;/div&gt;</summary>
		<author><name>Andrew71</name></author>
	</entry>
</feed>