Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 

Repository files navigation

Install Alpine Linux on a single partition


Introduction

By default setup-alpine creates 3 partitions: boot, root, swap. With some extra steps it is possible to customize the disk layout for system installation.


1. Partition

$ fdisk /dev/sda
o
n
p
1
63 [ENTER]
[ENTER]
a
1
p
w

2. Filesystem

$ apk add e2fsprogs
$ mkfs.ext4 -O ^64bit /dev/sda1
$ mount -t ext4 /dev/sda1 /mnt

Note: e2fsprogs's mkfs creates filesystems with metadata_csum and 64bit features enabled by default. Syslinux 6.03 does not support this, which will cause the bootloader to fail with error "failed to load ldlinux.c32". So the 64bit feature must be disabled for the ext4 boot volume (shared with the root partition in this case). Syslinux 6.04 is OK.


3. Main Setup

$ setup-alpine
us
us
[hostname]
eth0
dhcp
n
[password]
UTC
none
1
[username]
[Name]
[password]
none
openssh
Disk & Install
[Ctrl+c]

Stop at the Disk & Install part of the installation.


4. Disk Setup

$ mkdir /mnt/boot
$ setup-disk -m sys /mnt

Note: Make sure to create the /boot directory on the mounted volume before running setup-disk. If the /boot directory is not present, Syslinux will miss a step. This can be fixed later though since the directory still gets created by the script but then Syslinux needs to be manually installed after.


Optional fix:

$ apk add syslinux
$ extlinux -i /mnt/boot

5. Make It Bootable

$ apk add syslinux
$ dd bs=440 count=1 conv=notrunc if=/usr/share/syslinux/mbr.bin of=/dev/sda

Done.

$ reboot

About

Alpine Linux installation steps with custom partitioning

Resources

Stars

Watchers

Forks

Contributors