Include:Copying Alpine to Flash: Difference between revisions

From Alpine Linux
m (link to voidlinux wiki is dead)
m (Propose for deletion. Completely unused and obsolete include.)
 
(8 intermediate revisions by 3 users not shown)
Line 1: Line 1:
The following part describes various ways how to create bootable USB stick with Alpine Linux.
{{Delete|This include has become obsolete. It is completely unused on the wiki}}
 
=== Clone ISO image content to USB stick (Alpine Linux from 3.3.0 and later) ===
 
From Alpine Linux 3.3.0, the generated ISO's are a hybridISO, which means they contain a valid MBR and can be raw copied directly to the USB stick, Hard Drive (If you really know what you're doing), or burnt to a CD/DVD.
 
If the USB stick is in a Unix/Linux/OSX system, you will need to find out what the USB device is.  There are various utilities to determine the device name (e.g. {{Path|/dev/sdx}}) for your USB device.  One way is:
 
$ sudo fdisk -l
 
If it is still unclear which is your USB's device name, in Linux you could try <code>sudo lsblk -a</code> ;  or use {{Pkg|parted}} (<code>sudo parted -l</code>).
 
Then, in order to dd the iso, ensure that your usb drive is '''not''' mounted, as various desktop environments automatically mount usb pen drives:
 
$ sudo umount /dev/sdx
 
Next, change to the directory where your Alpine .iso file is located, for example:
 
$ cd ~/Downloads
 
{{Warning|The following instruction will '''destroy''' data on the device being written to - be sure that you have identified your USB device name correctly first!}}
 
Then you can use '''dd''' to copy the iso to it.  Change <code>alpine.iso</code> in the following command to the name of your '''.iso''' file; and change <code>/dev/sdx</code> to the name of your pen drive's device name.  The following command may take a few minutes to execute:
  $ sudo dd if=alpine.iso of=/dev/sdx && sync
 
=== Copy ISO content to USB stick as individual files ===
 
{{Warning | We assume here ''sda'' is your USB stick which would hold bootable Alpine Linux files. }}
 
The following procesure is for Alpine Linux distribution itself, if you are using other Linux distro or other operating system you should know the best how to install syslinux and where ''mbr.bin'' file is located on your filesystem.
 
# If you created a new partition above, format the {{{1|flash medium}}} with a FAT32 filesystem (replacing sda with your {{{1|flash medium}}} name):
#: {{Cmd|apk add dosfstools<BR>mkdosfs -F32 /dev/sda1}}
# Install syslinux and MBR (replacing sda with your {{{1|flash medium}}} name):
#: {{Cmd|{{{|apk add syslinux<BR>dd if=/usr/share/syslinux/mbr.bin of=/dev/sda}}}<BR>syslinux /dev/sda1}}
#Copy the files to the {{{1|flash medium}}} (replacing sda with your {{{1|flash medium}}} name):
#: {{Cmd|<nowiki>mkdir -p /media/sda1
mount -t vfat /dev/sda1 /media/sda1
cd /media/cdrom
cp -a .alpine-release * /media/sda1/
umount /media/sda1</nowiki>}}
# (''Optional'') 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)
#: {{Cmd|<nowiki>mount -t vfat /dev/sda1 /media/sda1
rm /media/sda1/*.apkovl.tar.gz
umount /media/sda1</nowiki>}}
 
=== Troubleshooting ===
==== Wrong Device Name ====
If you cannot boot from the {{{1|flash medium}}} and you see something like:
Mounting boot media failed.
initramfs emergency recovery shell launched. Type 'exit' to continue boot
then it is likely that the device name in {{Path|syslinux.cfg}} is wrong. You should replace the device name in this line:
append initrd=/boot/grsec.gz alpine_dev='''usbdisk''':vfat modules=loop,cramfs,sd-mod,usb-storage quiet
with the proper device name.
* For boot from USB, the device name should be 'usbdisk' (as shown above)
* For other options, you can run <code>cat /proc/partitions</code> to see the available disks (i.e. 'sda' or 'sdb')
 
==== Non-FAT32 Filesystems ====
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.
 
To do so, mount the {{{1|flash medium}}} and change the {{Path|syslinux.cfg}} file line from
append initrd=/boot/grsec.gz alpine_dev=usbdisk:vfat modules=loop,cramfs,sd-mod,usb-storage quiet
to
append initrd=/boot/grsec.gz alpine_dev=usbdisk:'''ext3''' modules=loop,cramfs,sd-mod,usb-storage''',ext3''' quiet
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).
 
[[Category:Installation]]

Latest revision as of 00:50, 15 December 2021

This material is proposed for deletion ...

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