Another option is using the {{ic|alien}} tool to convert the {{ic|pacman-mirrorlist}} and {{ic|arch-install-scripts}} (but no {{ic|pacman}}) to native packages of your distro.

Another option is using the {{ic|alien}} tool to convert the {{ic|pacman-mirrorlist}} and {{ic|arch-install-scripts}} (but no {{ic|pacman}}) to native packages of your distro.

+

+

==Remotely Replace the Existing System==

+

If you manage to get ~500MB of free space somewhere on the disk (e.g. by partitioning a swap partition) you can install the new Arch Linux system there, reboot into the newly created system and [[Full_System_Backup_with_rsync#With_a_single_command|rsync the entire system]] to the primary partition. Fix the bootloader configuration before rebooting.

Revision as of 20:56, 18 October 2013

Warning: This page is being worked on at the moment and should be stabilized by Oct. 18 2013 at 6pm EST

This document describes the bootstrapping process required to install Arch Linux from a running Linux host system.
After bootstrapping, the installation proceeds as described in the Installation Guide.

Bootstrapping Goal

The goal of the bootstrapping procedure is to setup an environment from which arch-install-scripts (such as pacstrap and arch-root) run.
This goal is achieved by installing arch-install-scripts natively on the host system, or setting up an Arch Linux-based chroot.

Note: This guide requires that the existing host system be able to execute the new target Arch Linux architecture programs. In the case of an x86_64 host, it is possible to use i686-pacman to build a 32-bit chroot environment. See Arch64 Install bundled 32bit system. However it is not so easy to build a 64-bit environment when the host only supports running 32-bit programs.

Setting up an Arch Linux-based chroot

The Arch Linux chroot environment will be used to run pacstrap.
pacstrap will initiate the actual Arch Linux installation.
There are different ways to setup the chroot explained below.

Using the Bootstrap Image

Extract this tarball. If you have enough memory, you can extract it into a tmpfs file system.

In the example below, we'll assume that it will be extracted to /tmp/root.x86_64/.

Download the bootstrap image which is a tarball containing the arch-install-scripts.
It is a smaller image.
Just expand the tarball into the directory of your choice (if sufficient RAM is available, to a directory in /tmp)
Use the included arch-chroot to chroot into your install "system".

The root image can be found on one of the mirrors under either arch/x86_64/ or arch/i686/ depending on the desired architecture

Using the LiveCD Image

It is possible to mount the root image of the latest Arch Linux installation media and then chroot into it. This method has the advantage of providing you with a working Arch Linux installation right within your host system without the need to prepare it by installing specific packages.

Note: Before proceeding, make sure the latest version of squashfs is installed on the host system. Otherwise you will get errors like: FATAL ERROR aborting: uncompress_inode_table: failed to read block.

The root image can be found on one of the mirrors under either arch/x86_64/ or arch/i686/ depending on the desired architecture. The squashfs format is not editable so we unsquash the root image and then mount it.

To unsquash the root image, run

# unsquashfs -d /squashfs-root root-image.fs.sfs

Now you can loop mount the root image

# mkdir /arch
# mount -o loop /squashfs-root/root-image.fs /arch

Before chrooting to it, we need to set up some mount points and copy the resolv.conf for networking.

Now everything is prepared to chroot into your newly installed Arch environment

# chroot /arch bash

Assembling the chroot Manually (with a script)

The script creates a directory called archinstall-pkg and downloads the required packages in it. It then extracts them in the archinstall-chroot directory. Finally, it prepares mount points, configures pacman and enters a chroot.

CHROOT_DIR=archinstall-chroot Must Change First, or you might ruin your /etc/

On the host system, /dev/shm points to /run/shm. However, in the Arch-based chroot, /run/shm does not exist and the link is broken. To correct this error, create a directory /run/shm inside the chroot environment.

Edit the fstab file

Probably the genfstab script won't work. In that case, you'll need to edit the /mnt/etc/fstab file by hand.
You can use the content of /etc/mtab as reference.

Replacing an Existing System Taking the Whole Partition

If you manage to get ~500MB of free space somewhere on the disk (e.g. by partitioning a swap partition) you can install the new Arch Linux system there, reboot into the newly created system and rsync the entire system to the primary partition. Fix the bootloader configuration before rebooting.

Alternative: Install arch-install-scripts natively on non Arch distro

Warning: This method is potentially difficult, your mileage may vary from distro to distro.

Install dependencies

Using your distribution mechanisms, install the required packages for pacman and the arch install scripts. libcurl, libarchive, fakeroot, xz, asciidoc, wget, and sed are among them. Of course, gcc, make and maybe some other "devel" packages are necessary too.

Compile pacman

If you get errors here, chances are you are missing dependencies, or your current libcurl, libarchive or others, are too old. Install the dependencies missing using your distro options, or if they are too old, compile them from source.

Compile

make

If there were no errors, install the files

make install

You may need to manually call ldconfig to make your distro detect libalpm.

Prepare configuration files

Now is time to extract the configuration files. Change the x86_64 as necessary.

Extract the pacman.conf and makepkg.conf files from the pacman package, and disable signature checking:

Another option is using the alien tool to convert the pacman-mirrorlist and arch-install-scripts (but no pacman) to native packages of your distro.

Remotely Replace the Existing System

If you manage to get ~500MB of free space somewhere on the disk (e.g. by partitioning a swap partition) you can install the new Arch Linux system there, reboot into the newly created system and rsync the entire system to the primary partition. Fix the bootloader configuration before rebooting.