Native Harddisk Install 1.6: Difference between revisions

From Alpine Linux
(chiacelboc)
m (Reverted edits by 80.227.1.101 (Talk); changed back to last version by WikiSysop)
Line 1: Line 1:
liousittalir
=Alpine HD install=
=Alpine HD install=



Revision as of 15:06, 20 February 2008

Alpine HD install

NOTE: This document covers 1.6 release. From version 1.7.3 there is an albootstrap script that will install the basic packages (except grub) into a subdir. The script is available here: http://dev.alpinelinux.org/alpine/1.7/albootstrap

Alpine is more geared toward live-cd or usb-key usage, but it is possible to install it to a harddisk.

This is how it is done. The Alpine version is 1.6.1

Installation

Create partitions with fdisk.

fdisk /dev/hda

You should have 2 partitions: /dev/hda1 as "Linux" (type 83) and /dev/hda2 as "linux swap" (type 82).

Install needed programs for the setup

apk_add e2fsprogs rsync grub

Create filesystem and swap

mkfs.ext3 /dev/hda1
mkswap /dev/hda2

Turn on swap already now

swapon /dev/hda2

Mount file-system

mount -t ext3 /dev/hda1 /mnt

Install base packages on harddisk

ROOT=/mnt apk_add uclibc busybox apk-tools alpine-baselayout alpine-conf grub

If you want pcmcia support, then also add the pcmciautils package

ROOT=/mnt apk_add pcmciautils

Install busybox links

mkdir /mnt/proc
mount --bind /proc /mnt/proc
chroot /mnt /bin/busybox --install -s
umount /mnt/proc

For convenience, copy the apk repository.

rsync -ruav /media/cdrom/apks /mnt

Create the apk.conf:

mkdir /mnt/etc/apk
echo "APK_PATH=file://apks" > /mnt/etc/apk/apk.conf

Copy the hd/ext3 initramfs image, kernel and kernel modules.

rsync -ruav /media/cdrom/hd-ext3.gz /media/cdrom/vmlinuz /mnt
rsync -ruav /lib/modules /mnt/lib/

Configure grub

grub-install --root-directory=/mnt /dev/hda1
vi /mnt/boot/grub/menu.lst

It should contain something like:

default 0
timeout 0
title Alpine Linux
root (hd0,0)
kernel /vmlinuz root_dev=hda1:ext3 alpine_dev=../:ext3
initrd /hd-ext3.gz

Install grub on MBR:

grub
root (hd0,0)
setup (hd0)
quit

Append the swap to fstab:

echo -e "/dev/hda2 none swap sw 0 0" >> /mnt/etc/fstab

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

umount /mnt
eject 
reboot

After reboot, log in as "root" and run:

setup-alpine