Overall description: Alpine Installation from a official iso, dumpet to a usb source device media, and installed to a bare metal computer no matter if include UEFI this will guide to installed to boot, but using customized partiton layout
Means you will install Alpine in customized layout paritiont on PC computer from USB media.
Warning This method only works for most modern pc beyond 2016 and recents.
Feels lost here? check How to use this guide section of this document
In this case, your PC wil have UEFI or must be beyond 2016’s you will need 64-bit iso then, the download URL will be:
http://dl-cdn.alpinelinux.org/alpine/v3.20/releases/x86_64/alpine-extended-3.20.0-x86_64.iso
How to download usin Graphical browser: point the web browser to that url and the download of the iso file will start. A file with .iso extension type, will be downloaded commonly into the Download directory.
How to download usin Command line method: in unix-like terminal (MAC/Linux) execute:
cd $HOME;wget -c -t8 --no-check-certificate http://dl-cdn.alpinelinux.org/alpine/v3.20/releases/x86_64/alpine-extended-3.20.0-x86_64.iso
,
and unless the case of GUI, your .iso file wil be direclty in your home directory.
Using balena-etcher-electron to flash the USB drive from any system, its easy, simple and available for all OSs.
*Warning this guide assume only one hard drive as
/dev/sda
and only one USB as/dev/sdb
program balena-etcher-electron
(there are portable versions)balena-etcher-electron
as root in the graphical sessionsdb
Note this method only works on recent MacOs 10.12+ or recent Linux 4.9+ installations
You can also made it manually, open your terminal program, move to the place
directory where ISO downloaded are placed and cp
to the USB device:
umount /dev/sdb; cp alpine-extended-3.20.0-x86_64.iso /dev/sdb
When the machine start, you must be sure to choose the right booting drive (commonly named USB boot drive or USB hard disk), so the disc/iso will boot and after a while a command line shell will show you:
Note When starting Alpine it will ask for the login, just typing root and pressing enter allows you to start:
Warning Tip: If your system is not configured to boot from a USB drive, it must be configured in the BIOS/UEFI, ask/search to your vendor or technical support, Toshiba computers need to hit F1 to choose boot medium, DELL must hit F11 to choose medium for example, and so and so
Warning if you do not download the extended ISO it may require internet.!!!
After entering the root environment and gets the console prompt installation media, you must perform these commands, that will be in following order:
export BOOT_SIZE=500
export SWAP_SIZE=8164
export BOOTLOADER=grub
setup-alpine
After last command, it will start some questions, these are in the following order:
es
and after then es-winkeys
eth0
one that is the network cable and answer dhcp
.
8.8.8.8
and none
for the domainAmerica/Panama
or something similarnone
if you are connecting directly to the Internet.chrony
the packet already in the medium (extended).Skip
or none
no
/etc/apk/respositories
and enable community ones!openssh
the package that already comes in the medium (extended).
yes
because we do not setup user yet!none
none
cos we will use custom disk layout partition setup.
none
cos we don not need this in futureWe are configuring a UEFI capable system so we need to setup a minimal layout of three or more partionts, following are the mandatory ones:
Mount point | Partition | Partition type Purpose | Minimum size | Formats |
---|---|---|---|---|
/boot/efi ? | /dev/ |
GPT UEFI Boot partition | 260 MiB | eufat |
none | /dev/ |
Linux swap memory | 2Gb | swap |
/ | /dev/ |
Alpine Linux root system OS | 32 GiB | btreefs,ext2/3/4,xfs |
For more info about check ../alpine/requirementes.md and the document ../alpine/alpine-boot-uefi-bios.md.
Warning edit
/etc/apk/respositories
and enable community repositories!
Here we will assume you already partitioned the disk, if not this part will
be only a quick steps using fdisk and assuming your ssd/hdd is /dev/sda
so
then using same medium running alpine linux you can use fdisk:
fdisk /dev/sda
; warning will erase entire disk!d
and then enter how many times need until said: no partition is defined..
n
+enter and then hit 1
+enter, and then enter to use default first sector+500M
and hit enterY
+entern
+enter and then hit 2
+enter and use first default+16G
(or at least 4G) and enterY
+entern
+enter and then hit 3
+enter and use first default+160G
(or at least 80G) and enterY
+entert
+enter and then hit 1
+enter and then hit 1
+entert
+enter and then hit 2
+enter and then hit 19
+entert
+enter and then hit 3
+enter and then hit 20
+enterw
and you will have 3 partitons, first: EFI, second: SWAP and rootAfter answering sys
to the questions about the drive, and since there will only
be one drive, answering sda
(if options shows to you) on which drive to use,
this will create and leave your hard drive as follows:
/dev/sda1
as BOOT in 500Mb in /boot
/dev/sda2
as SWAP in 16Gb (or at least 4 gigs)/dev/sda3
as ROOT in 160Gb in /
(approximately or rest of space available)So now we must format partitions so lest run those commands from alpine running medium, be carefully that you must enabled the community repositories previously:
apk add e2fsprogs dosfstools
mkfs.vfat -n EFI /dev/sda1
mkswap -L SWAP /dev/sda2
mkfs.ext4 -b 1024 -m 1 -L ROOT /dev/sda3
This part will assume the following layout to property work, mounted in the following order as mandatory:
/dev/sda3
as ROOT on /target
with format EXT4 and 1024 sector size/dev/sda1
as BOOT in /target/boot
with format of EFIFAT/dev/sda2
as SWAP with a previous formatSo then lest install customized partioned disk with alpine:
Warning edit
/etc/apk/respositories
and enable community repositories!
apk add grub-efi arch-install-scripts coreutils os-prober
mkdir -p /target
mount -t ext4 /dev/sda3 /target
mkdir -p /target/boot
mount -t vfat /dev/sda1 /target/boot
mkdir -p /target/boot/efi
export BOOTLOADER=grub
export KERNELOPTS=" acpi_enforce_resources=lax iomem=relaxed vsyscall=emulated "
setup-disk -m sys /target
umount /target/boot
umount /target
If you cannot setup a internet connection you cannot install Alpine linux, unless you used 64bit intel/amd and “extended” iso install media. Most of the packages need to setup this procedure are not included in standard images, specially those for ARM devices like RasberryPi ones becouse WIFi setup.
After all of the scripts in the setup end, the “reboot” message will not happens and just type “reboot” and press enter, remove the boot media and newly installed system will be booted.
You cannot see a graphical window system? take it easy and get calmed down.. in Alpine all are made by the right way.. so if user need a desktop.. user can install a desktop
Please follow the guide alpine-tutorial-wifi-routering.md, you will need to download the needed packages manually from another device and then but it on the installed Alpine computer using USBstorage external device.
This guide is for install process, many parts will need you understand minimal knowledge of linux.
This guide assumed you have a serial port allowed in the targeted computer, also its important you shuold understand the way of the configuration in this guide.
Warning Some Linux or/and Mac terminals have security cut/paste locks, so if you paste, the first line will be preceded by garbage, check always the first char of your paste.
Each portion of monospaced text means you must run it on the console, those lines junted can be performed and paste as one command, separate lines canont be run in bach mode.. so eacho separate line must be run alonside and wait output!
CC BY-NC-SA: the project allows reusers to distribute, remix, adapt, and build upon the material in any medium or format for noncommercial purposes only, and only so long as attribution is given to the creators involved. If you remix, adapt, or build upon the material, you must license the modified material under identical terms, includes the following elements:
https://codeberg.org/alpine/alpine-wiki/src/branch/main#license