Native Harddisk Install 1.6: Difference between revisions

From Alpine Linux
(Undo revision 2483 by Nangel (Talk))
m (Change wikilink.)
 
(8 intermediate revisions by 6 users not shown)
Line 1: Line 1:
{{Historical|This document covers the ancient 1.6 release. For the ancient 1.9.x series, see [[Native Harddisk Install 1.9]]; for more recent instructions see [[installation]].<br>URLs on this page may no longer function}}
=Alpine HD install=
=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/v1.7/albootstrap
'''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: <nowiki>http://dev.alpinelinux.org/alpine/v1.7/albootstrap</nowiki>


Alpine is more geared toward live-cd or usb-key usage, but it is possible to install it to a harddisk.
Alpine is more geared toward live-cd or usb-key usage, but it is possible to install it to a harddisk.
Line 7: Line 9:
This is how it is done. The Alpine version is 1.6.1
This is how it is done. The Alpine version is 1.6.1


==Installation==
== Installation ==
 
Create partitions with fdisk.


Create partitions with fdisk.
  fdisk /dev/hda
  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
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
  apk_add e2fsprogs rsync grub


Create filesystem and swap
Create filesystem and swap  
 
  mkfs.ext3 /dev/hda1
  mkfs.ext3 /dev/hda1
  mkswap /dev/hda2
  mkswap /dev/hda2


Turn on swap already now
Turn on swap already now  
 
  swapon /dev/hda2
  swapon /dev/hda2


Mount file-system
Mount file-system  
 
  mount -t ext3 /dev/hda1 /mnt
  mount -t ext3 /dev/hda1 /mnt


Install base packages on harddisk
Install base packages on harddisk  
 
  ROOT=/mnt apk_add uclibc busybox apk-tools alpine-baselayout alpine-conf grub
  ROOT=/mnt apk_add uclibc busybox apk-tools alpine-baselayout alpine-conf grub


If you want pcmcia support, then also add the pcmciautils package
If you want pcmcia support, then also add the pcmciautils package  
 
  ROOT=/mnt apk_add pcmciautils
  ROOT=/mnt apk_add pcmciautils


Install busybox links
Install busybox links  
 
  mkdir /mnt/proc
  mkdir /mnt/proc
  mount --bind /proc /mnt/proc
  mount --bind /proc /mnt/proc
Line 38: Line 49:
  umount /mnt/proc
  umount /mnt/proc


For convenience, copy the apk repository.
For convenience, copy the apk repository.  
 
  rsync -ruav /media/cdrom/apks /mnt
  rsync -ruav /media/cdrom/apks /mnt


Create the apk.conf:
Create the apk.conf:  
 
  mkdir /mnt/etc/apk
  mkdir /mnt/etc/apk
  echo "APK_PATH=file://apks" > /mnt/etc/apk/apk.conf
  echo "APK_PATH=file://apks" &gt; /mnt/etc/apk/apk.conf


Copy the hd/ext3 initramfs image, kernel and kernel modules.
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/
  rsync -ruav /media/cdrom/kernel/generic/hd-ext3.gz /media/cdrom/kernel/generic/bzImage /mnt
  rsync -ruav /lib/modules/* /mnt/lib/modules/
 
Configure grub


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


It should contain something like:
It should contain something like:  


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


Install grub on MBR:
Install grub on MBR:  
 
  grub
  grub
  root (hd0,0)
  root (hd0,0)
Line 68: Line 84:
  quit
  quit


Append the swap to fstab:
Append the swap to fstab:  
  echo -e "/dev/hda2 none swap sw 0 0" >> /mnt/etc/fstab
 
  echo -e "/dev/hda2 none swap sw 0 0" &gt;&gt; /mnt/etc/fstab
 
Unmount, remove cdrom and reboot. (If you can't eject, just remove it manually as the machine reboots)


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


After reboot, log in as "root" and run:
After reboot, log in as "root" and run:  
 
  setup-alpine
  setup-alpine
[[Category:Installation]]

Latest revision as of 09:03, 12 January 2024

This material is retained only for historical reasons ...

This document covers the ancient 1.6 release. For the ancient 1.9.x series, see Native Harddisk Install 1.9; for more recent instructions see installation.
URLs on this page may no longer function

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/v1.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/kernel/generic/hd-ext3.gz /media/cdrom/kernel/generic/bzImage /mnt
rsync -ruav /lib/modules/* /mnt/lib/modules/

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 /bzImage 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