Install to disk

From Alpine Linux

Jump to: navigation, search

If using Alpine Linux 2.2.3 or later

Tango-dialog-warning.png
Warning: This will erase everything on your machine's harddisk. Don't blame me if someone sues you for this, your cat dies etc. You are warned.

The following is meant to be an absolute newbie guide

Take out the CD, and your computer should boot into Alpine using your hard drive.

Continue Setting up your Computer

If using Alpine Linux 2.2.2 or earlier

A number of steps are nowadays included in the setup-disk and setup-lbu scripts, which are invoked by setup-alpine. But in these older systems, these steps have to be performed manually.

Run setup-alpine to configure the keyboard, hostname and networking.

setup-alpine

Now for the manual steps. Create partitions with fdisk.

fdisk /dev/sda

You should have 2 partitions: /dev/sda1 as "Linux" (type 83) and /dev/sda2 as "linux swap" (type 82). The /dev/sda1 must be bootable (command "a" within fdisk).

Install needed programs for the setup:

apk add e2fsprogs syslinux mkinitfs

Create filesystem and swap:

mkfs.ext4 /dev/sda1 mkswap /dev/sda2

Mount filesystem:

mount -t ext4 /dev/sda1 /mnt

Clone the current running config created by setup-alpine (hostname, networking root password):

lbu package - | tar -C /mnt -zx

Install base packages on harddisk:

apk add --root=/mnt --initdb $(cat /etc/apk/world)

Append the / and swap to /etc/fstab:

echo -e "/dev/sda1 / ext4 defaults 1 1" >> /mnt/etc/fstab echo -e "/dev/sda2 none swap sw 0 0" >> /mnt/etc/fstab

Configure the boot loader, extlinux. We use the provided syslinux.cfg as base.

cp /media/cdrom/syslinux.cfg /mnt/boot/extlinux.conf vi /mnt/boot/extlinux.conf

It should contain something like:

timeout 20
prompt 1
default grsec
label grsec
    kernel /boot/grsec
    append initrd=/boot/grsec.gz root=/dev/sda1 modules=ext4 quiet

Install the bootloader:

extlinux -i /mnt/boot

Install syslinux bootloader at the beginning of the MBR so its bootable (note that its sda and not sda1)

dd if=/usr/share/syslinux/mbr.bin of=/dev/sda

Unmount, remove cdrom, and reboot. (If you can't eject, just remove it manually as the machine reboots)

umount /mnt umount /.modloop eject reboot

After reboot, you should be able to log in as root with the password you created in setup-alpine.

Personal tools
Namespaces
Variants
Actions
Welcome
Services
Wiki
Toolbox