Install to disk: Difference between revisions

From Alpine Linux
(Fixed regression)
m (Redirect this article. to Installation and request this article for deletion.)
Tag: New redirect
 
(24 intermediate revisions by 10 users not shown)
Line 1: Line 1:
{{Note|This document covers 1.9.x release.}}
#REDIRECT [[Installation]]
For 1.8.x and older please see [[Native Harddisk Install 1.6]]
{{Delete|All substantive content here is now in the [[Installation]] article. In addition no pages link to this article.}}
= If using Alpine Linux 2.2.3 or later =


== Installation ==
{{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.}}
Run ''setup-alpine'' to configure the keyboard, hostname and networking.


{{Cmd|setup-alpine}}
The following is meant to be an absolute newbie guide


Create partitions with fdisk.  
* [[Burning ISOs|Burn the Alpine ISO image to a CD]]
* Put the CD into the new computer and turn on the power. Make sure the computer is capable to boot from a CD. Your manual for the computer or the BIOS can help.
* Wait for the text '''login:''' to appear, type '''root''' and press enter.
* Run the '''setup-alpine''' script
** Choose your keyboard layout. If you don't know your keyboard layout choose '''us'''. Here '''us''' was chosen.
*** Then I chose the '''us''' variant.
** Host name, which will be the name of your computer, you can just press enter if you want to use the default name
** Choose your network card, most people can just go with the default (press enter)
*** Most people will use DHCP, so press enter again, or you can enter in your static IP address
*** You will be asked if you want to do any manual network configuration, press enter for no
** Type in your root password twice.
** Choose a time zone, you can get a list by pressing '''?'''. If you want a sub zone, e.g. Africa, type in Africa and press enter, '''?''' will give you a list of sub zones in Africa.
** Press '''f''' to choose the fastest mirror.
** Choose an SSH server, this allows you to remotely manage your machine. OpenSSH is what the big distro's use, Dropbear is a tiny SSH replacement. Choose '''none''' for best security.
** Choose an NTP client, this keeps your machine's time accurate using an Internet time server. Openntpd is what the big distro's use, while Chrony is a tiny replacement.
** Choose a disk you want to install Alpine onto, as an example, '''sda''' is the first disk in your computer.
*** Now choose how you would like to use it, for this guide, choose '''sys''', this will install the entire OS onto your hard drive
*** You are given a final chance to back out, type in '''Y''' to continue
* The installation is now complete and you will be asked to reboot. Type in '''reboot''' and press enter
Take out the CD, and your computer should boot into Alpine using your hard drive.


{{Cmd|fdisk /dev/sda}}
=== Continue Setting up your Computer ===


You should have 2 partitions: /dev/sda1 as "Linux" (type 83) and /dev/sda2 as "linux swap" (type 82). The /dev/sda1 should be bootable.
* [[Alpine Linux package management]] ''(How to add/remove packages on your Alpine)''
* [[OpenRC]] ''(Configure a service to automatically boot at next reboot)''
* [[Setting up a SSH server]] ''(Using ssh is a good way to administer your box remotely)''
* [[Tutorials and Howtos]] ''(Various tutorials, including how to setup a [[XFCE Setup|XFCE desktop]])''


Install needed programs for the setup
[[Category:Installation]]
 
{{Cmd|apk add e2fsprogs syslinux mkinitfs}}
 
Create filesystem and swap
 
{{Cmd|mkfs.ext3 /dev/sda1
mkswap /dev/sda2}}
 
Mount file-system
 
{{Cmd|mount -t ext3 /dev/sda1 /mnt}}
 
Clone the current running config created by setup-alpine (hostname, networking root password)
 
{{Cmd|<nowiki>lbu package - | tar -C /mnt -zx</nowiki>}}
 
Install base packages on harddisk
 
{{Cmd|<nowiki>apk add --root=/mnt --initdb apk-tools alpine-baselayout alpine-conf linux-grsec linux-grsec-mod acct mkinitfsy</nowiki>}}
 
Generate new initramfs image:
 
{{Cmd|chroot /mnt /sbin/mkinitfs}}
 
Create the repositories list. In this example we use the cdrom as repository:
 
{{Cmd|mkdir -p /mnt/etc/apk
echo "/media/cdrom/packages/core" >> /mnt/etc/apk/repositories
echo "/media/cdrom/packages/extra" >> /mnt/etc/apk/repositories}}
 
Append the / and swap to fstab:
{{Cmd|echo -e "/dev/sda1 /    ext3  defaults 1 1" &gt;&gt; /mnt/etc/fstab
echo -e "/dev/sda2 none swap  sw      0 0" &gt;&gt; /mnt/etc/fstab}}
 
Configure the boot loader, extlinux. We use sthe provided syslinux as base.
 
{{Cmd|cp /media/cdrom/syslinux.cf /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=ext3 quiet
 
Install the bootloader:
{{Cmd|extlinux -i /mnt/boot}}
 
Fix the MBR so its bootable (note that its sda and not sda1)
 
{{Cmd|<nowiki>dd if=/usr/share/syslinux/mbr.bin of=/dev/sda</nowiki>}}
 
Unmount, remove cdrom, and reboot. (If you can't eject, just remove it manually as the machine reboots)
 
{{Cmd|umount /mnt
umount /.modloop
eject
reboot}}
 
After reboot, you should be able to log in as root with the password you created in <tt>setup-alpine</tt>.

Latest revision as of 09:21, 12 January 2024

Redirect to:

This material is proposed for deletion ...

All substantive content here is now in the Installation article. In addition no pages link to this article. (Discuss)
Make sure no other pages link here and check the page's history before deleting.

If using Alpine Linux 2.2.3 or later

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

  • Burn the Alpine ISO image to a CD
  • Put the CD into the new computer and turn on the power. Make sure the computer is capable to boot from a CD. Your manual for the computer or the BIOS can help.
  • Wait for the text login: to appear, type root and press enter.
  • Run the setup-alpine script
    • Choose your keyboard layout. If you don't know your keyboard layout choose us. Here us was chosen.
      • Then I chose the us variant.
    • Host name, which will be the name of your computer, you can just press enter if you want to use the default name
    • Choose your network card, most people can just go with the default (press enter)
      • Most people will use DHCP, so press enter again, or you can enter in your static IP address
      • You will be asked if you want to do any manual network configuration, press enter for no
    • Type in your root password twice.
    • Choose a time zone, you can get a list by pressing ?. If you want a sub zone, e.g. Africa, type in Africa and press enter, ? will give you a list of sub zones in Africa.
    • Press f to choose the fastest mirror.
    • Choose an SSH server, this allows you to remotely manage your machine. OpenSSH is what the big distro's use, Dropbear is a tiny SSH replacement. Choose none for best security.
    • Choose an NTP client, this keeps your machine's time accurate using an Internet time server. Openntpd is what the big distro's use, while Chrony is a tiny replacement.
    • Choose a disk you want to install Alpine onto, as an example, sda is the first disk in your computer.
      • Now choose how you would like to use it, for this guide, choose sys, this will install the entire OS onto your hard drive
      • You are given a final chance to back out, type in Y to continue
  • The installation is now complete and you will be asked to reboot. Type in reboot and press enter

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

Continue Setting up your Computer