Include:Copying Alpine to Flash: Difference between revisions
(flashing ISO on linux is now described in greater detail on Installation page) |
(leave ISO cloning to the Installation page (covered there)) |
||
Line 1: | Line 1: | ||
The following part describes | The following part describes how to create a custom (writable) USB boot device with Alpine Linux. | ||
Line 27: | Line 23: | ||
umount /media/sda1</nowiki>}} | umount /media/sda1</nowiki>}} | ||
=== Troubleshooting === | |||
==== Wrong Device Name ==== | ==== Wrong Device Name ==== | ||
If you cannot boot from the {{{1|flash medium}}} and you see something like: | If you cannot boot from the {{{1|flash medium}}} and you see something like: | ||
Mounting boot media failed. | Mounting boot media failed. | ||
Line 43: | Line 38: | ||
==== Non-FAT32 Filesystems ==== | ==== 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. | 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. | ||
Revision as of 19:30, 12 May 2021
The following part describes how to create a custom (writable) USB boot device with Alpine Linux.
Copy ISO content to USB stick as individual files
The following procedure 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 flash medium with a FAT32 filesystem (replacing sda with your flash medium name):
apk add dosfstools
mkdosfs -F32 /dev/sda1
- Install syslinux and MBR (replacing sda with your flash medium name):
apk add syslinux
dd if=/usr/share/syslinux/mbr.bin of=/dev/sda
syslinux /dev/sda1
- Copy the files to the flash medium (replacing sda with your flash medium name):
mkdir -p /media/sda1 mount -t vfat /dev/sda1 /media/sda1 cd /media/cdrom cp -a .alpine-release * /media/sda1/ umount /media/sda1
- (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 flash medium name)
mount -t vfat /dev/sda1 /media/sda1 rm /media/sda1/*.apkovl.tar.gz umount /media/sda1
Troubleshooting
Wrong Device Name
If you cannot boot from the 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 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
cat /proc/partitions
to see the available disks (i.e. 'sda' or 'sdb')
Non-FAT32 Filesystems
When your 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 flash medium and change the 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).