<?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=PetitCassoulet</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=PetitCassoulet"/>
	<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/wiki/Special:Contributions/PetitCassoulet"/>
	<updated>2026-04-30T03:50:22Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.40.0</generator>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Include:Copying_Alpine_to_Flash&amp;diff=15217</id>
		<title>Include:Copying Alpine to Flash</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Include:Copying_Alpine_to_Flash&amp;diff=15217"/>
		<updated>2018-03-21T23:47:59Z</updated>

		<summary type="html">&lt;p&gt;PetitCassoulet: /* Automated */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Boot Alpine Linux CD-ROM ===&lt;br /&gt;
# Insert the Alpine Linux CD-ROM into a computer.&lt;br /&gt;
# Boot the computer from the Alpine Linux CD-ROM.&lt;br /&gt;
#* This step may require changes to the BIOS settings to select booting from CD. &lt;br /&gt;
# Login with the username &#039;&#039;root&#039;&#039;. No password is needed.&lt;br /&gt;
&lt;br /&gt;
{{Tip|If you&#039;re not able to boot from the CD, then another option is to boot from a regular Alpine installation, and [[Burning_ISOs|manually mount the ISO image to {{Path|/media/cdrom}}]].}} &lt;br /&gt;
&lt;br /&gt;
=== Determine the Device Name of the {{{1|Flash Medium}}} ===&lt;br /&gt;
Determine the name your computer uses for your {{{1|flash medium}}}. The following step is one way to do this.&lt;br /&gt;
# After inserting the {{{1|flash medium}}}, run the command:&lt;br /&gt;
#* {{Cmd|dmesg}}&lt;br /&gt;
#* At the end of this command you should see the name of your {{{1|flash medium}}}, likely starting with &amp;quot;sd&amp;quot;. (For example: &amp;quot;sda&amp;quot;).&lt;br /&gt;
#* The remainder of this document will assume that your {{{1|flash medium}}} is called /dev/sda&lt;br /&gt;
# Use &amp;quot;fdisk -l&amp;quot; or &amp;quot;blkid&amp;quot; to check the device name by size or label&lt;br /&gt;
&lt;br /&gt;
=== Format {{{1|Flash Medium}}} ===&lt;br /&gt;
Run fdisk (replacing sda with your {{{1|flash medium}}} name):&lt;br /&gt;
{{Cmd|fdisk /dev/sda}}&lt;br /&gt;
&lt;br /&gt;
# (&#039;&#039;Optional&#039;&#039;) - Create new partition table with one FAT32 partition&lt;br /&gt;
#* &#039;&#039;&#039;d&#039;&#039;&#039; Delete all partitions (this may take a few steps)&lt;br /&gt;
#* &#039;&#039;&#039;n&#039;&#039;&#039; Create a new partition&lt;br /&gt;
#* &#039;&#039;&#039;p&#039;&#039;&#039; A primary partition&lt;br /&gt;
#* &#039;&#039;&#039;1&#039;&#039;&#039; Partition number 1&lt;br /&gt;
#** Use defaults for first and last cylinder (just press [Enter] twice).&lt;br /&gt;
#* &#039;&#039;&#039;t&#039;&#039;&#039; Change partition type&lt;br /&gt;
#* &#039;&#039;&#039;c&#039;&#039;&#039; Partition type (Win95 FAT32/LBA)&lt;br /&gt;
#Verify that the primary partition is bootable&lt;br /&gt;
#* &#039;&#039;&#039;p&#039;&#039;&#039; Print list of partitions&lt;br /&gt;
#* If there is no &#039;*&#039; next to the first partition, follow the next steps:&lt;br /&gt;
#** &#039;&#039;&#039;a&#039;&#039;&#039; &amp;lt;big&amp;gt;Make the partition bootable (set boot flag)&amp;lt;/big&amp;gt;&lt;br /&gt;
#** &#039;&#039;&#039;1&#039;&#039;&#039; Partition number 1&lt;br /&gt;
#&#039;&#039;&#039;w&#039;&#039;&#039; Write your changes to the device&lt;br /&gt;
&lt;br /&gt;
=== Add Alpine Linux to the {{{1|Flash Medium}}}  ===&lt;br /&gt;
To boot from your {{{1|flash medium}}} you need to copy the contents of the CDROM to the {{{1|flash medium}}} and make it bootable. Those two operations can be automated with the [[setup-bootable]] tool or can be done manually.&lt;br /&gt;
&lt;br /&gt;
See also notes to [http://it-offshore.co.uk/linux/alpine-linux/48-alpine-linux-usb-stick-kvm create an Alpine Linux USB stick from within KVM] with [[setup-bootable]].&lt;br /&gt;
&lt;br /&gt;
{{Note|If the following commands fail due to &#039;No such file or directory&#039;, you may have to remove and reinsert the {{{1|flash medium}}}, or even reboot, to get /dev/sda1 to appear}}&lt;br /&gt;
&lt;br /&gt;
==== Automated ====&lt;br /&gt;
{{Tip|If using Alpine Linux 1.10.4 or newer, you can use this section to complete the install. Otherwise, follow the Manual steps below.}}&lt;br /&gt;
{{Note|The target partition has to be formatted. Use the &amp;lt;code&amp;gt;mkdosfs&amp;lt;/code&amp;gt; command from the Manual steps below if needed.}}&lt;br /&gt;
# Run the [[setup-alpine]] script to setup network(Alpine Linux 3.3 not contain syslinux), answer the last three questions as &#039;none&#039;&lt;br /&gt;
## Which disk(s) would you like to use: none&lt;br /&gt;
## Enter where to store configs: none&lt;br /&gt;
## Enter apk cache directory: none&lt;br /&gt;
# Run &amp;quot;apk add syslinux&amp;quot; to install syslinux package&lt;br /&gt;
# Run &amp;quot;modprobe vfat&amp;quot; to load vfat kernel module&lt;br /&gt;
# Run the [[setup-bootable]] script to add Alpine Linux to the {{{1|flash medium}}} and make it bootable (replacing sda with your {{{1|flash medium}}} name):&lt;br /&gt;
#: {{Cmd|setup-bootable /media/cdrom /dev/sda1}}&lt;br /&gt;
## if &amp;quot;Resource busy&amp;quot; occurs, maybe the old files on /media/sda1, &amp;quot;rm /media/sda1/.alpine-release&amp;quot; and &amp;quot;reboot&amp;quot; to try again.&lt;br /&gt;
{{Note|If you get something like &#039;&amp;lt;code&amp;gt;Failed to mount /dev/sda1 on /media/sda1&amp;lt;/code&amp;gt;&#039; when running the above [[setup-bootable]] command, you might want to try running:&lt;br /&gt;
{{Cmd|modprobe vfat}}&lt;br /&gt;
and then try re-run the [[setup-bootable]] command as described above.}}&lt;br /&gt;
{{Warning|If you are installing to a USB Stick, you may need to modify the {{Path|syslinux.cfg}} file to say &amp;lt;code&amp;gt;usbdisk&amp;lt;/code&amp;gt; as [[#Wrong_Device_Name|described below]], or you will face possible problems booting and definite problems with the package cache. Recent versions of &amp;lt;code&amp;gt;setup-bootable&amp;lt;/code&amp;gt; will specify the alpine_dev using a UUID instead, so it should work properly by default.}}&lt;br /&gt;
&lt;br /&gt;
==== Manual ====&lt;br /&gt;
# (&#039;&#039;Optional&#039;&#039;) - If you created a new partition above, format the {{{1|flash medium}}} with a FAT32 filesystem (replacing sda with your {{{1|flash medium}}} name):&lt;br /&gt;
#: {{Cmd|apk add dosfstools&amp;lt;BR&amp;gt;mkdosfs -F32 /dev/sda1}}&lt;br /&gt;
# Install syslinux and MBR (replacing sda with your {{{1|flash medium}}} name):&lt;br /&gt;
#: {{Cmd|{{{|apk add syslinux&amp;lt;BR&amp;gt;dd if=/usr/share/syslinux/mbr.bin of=/dev/sda}}}&amp;lt;BR&amp;gt;syslinux /dev/sda1}}&lt;br /&gt;
#Copy the files to the {{{1|flash medium}}} (replacing sda with your {{{1|flash medium}}} name):&lt;br /&gt;
#: {{Cmd|&amp;lt;nowiki&amp;gt;mkdir -p /media/sda1&lt;br /&gt;
mount -t vfat /dev/sda1 /media/sda1&lt;br /&gt;
cd /media/cdrom&lt;br /&gt;
cp -a .alpine-release * /media/sda1/&lt;br /&gt;
umount /media/sda1&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
# (&#039;&#039;Optional&#039;&#039;) Remove any apkovl files that were transfered as part of the copy process.  This should be done if you wish to have a fresh install.  Replace sda with your {{{1|flash medium}}} name)&lt;br /&gt;
#: {{Cmd|&amp;lt;nowiki&amp;gt;mount -t vfat /dev/sda1 /media/sda1&lt;br /&gt;
rm /media/sda1/*.apkovl.tar.gz&lt;br /&gt;
umount /media/sda1&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
=== Wrong Device Name ===&lt;br /&gt;
If you cannot boot from the {{{1|flash medium}}} 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;
When your {{{1|flash medium}}} is formatted with a filesystem other than FAT32, you might have to specify the necessary filesystem modules in the boot parameters.&lt;br /&gt;
&lt;br /&gt;
To do so, mount the {{{1|flash medium}}} and change the {{Path|syslinux.cfg}} file line from &lt;br /&gt;
 append initrd=/boot/grsec.gz alpine_dev=usbdisk:vfat modules=loop,cramfs,sd-mod,usb-storage quiet&lt;br /&gt;
to&lt;br /&gt;
 append initrd=/boot/grsec.gz alpine_dev=usbdisk:&#039;&#039;&#039;ext3&#039;&#039;&#039; modules=loop,cramfs,sd-mod,usb-storage&#039;&#039;&#039;,ext3&#039;&#039;&#039; quiet&lt;br /&gt;
in the case of an ext3 formatted partition. A similar procedure might apply to other filesystems (if they are supported by syslinux and the Alpine Linux kernel).&lt;br /&gt;
&lt;br /&gt;
[[Category:Installation]]&lt;/div&gt;</summary>
		<author><name>PetitCassoulet</name></author>
	</entry>
</feed>