Installing Arch from a LiveCD
From ArchWiki
This guide has been supplanted by: Install From Existing Linux
See this thread.
i18n |
---|
English |
Italiano |
Contents |
Introduction
This guide will show you how to install Arch Linux from a Linux LiveCD. I used this method to install Arch Linux on a Compaq tc1000 that has no CD drive, and the Arch Installer doesn't work right from a USB CD drive. So I booted up a Gentoo LiveCD I had lying around (Knoppix or grml should work too) and did the following...
Preparing Drives
I am going to assume a 3 partition setup for your system, if yours is not, please make changes accordingly. This is my partition scheme: /dev/hda1 - 50MB - /boot /dev/hda2 - 512MB - swap /dev/hda3 - Rest of drive - /
Also, you need an active internet connection to do this.
First, boot into a LiveCD like Knoppix or Gentoo. Then, run cfdisk to set up your partitions.
cfdisk /dev/hda
There are plenty of guides for using cfdisk, so I won't go into it here. You could also use the less user-friendly fdisk.
Once the partitions are made, put filesystems on them. Start with swap first:
mkswap /dev/hda2 swapon /dev/hda2
I like to put ext2 on my boot partition, and ext3 with dir_index on my root partiton:
mke2fs /dev/hda1 mke2fs -j -O dir_index /dev/hda3
Now mount the partitions in a directory like /arch:
mkdir /arch mount /dev/hda3 /arch mkdir /arch/boot mount /dev/hda1 /arch/boot
Bootstrapping
Then cd to /root and obtain the newarch script and the pacman.conf from Quick_Custom_Installation. If you want to get the addedpacks too. Edit newarch, set DESTDIR=/arch and check if the other configuration variables fit you needs.
To prevent the newarch script from trying to delete your /arch/boot directory comment out the following lines in the script like this:
#if [ ! -d $DESTDIR ]; then # mkdir -p $DESTDIR #else # rm -rf $DESTDIR/* # if [ $? -ne 0 ]; then # echo "ERROR: couldn't remove $DESTDIR" # exit 1 # fi #fi
Running the newarch script should download the required packages to provide you a fresh arch installation.
Chroot into your system
Once this is done, you will have a base Arch install. Now we can chroot into our new system after we mount proc and dev
mount -t proc none /arch/proc mount -o bind /dev /arch/dev mount -o bind /sys /arch/sys chroot /arch /bin/bash
Install a kernel
Now we are in our Arch system! Minus a kernel, and an internet connection =( Fix that with the following.
dhcpcd eth0
Also, it may be a good idea to set your locale
nano -w /etc/locale.gen
Uncomment the lines corresponding to your locale, mine are...
en_US.UTF-8 UTF-8 en_US ISO-8859-1
Then generate the locale
locale-gen
Check your /etc/mkinitcpio.conf and edit it according to your needs. Now install your kernel
pacman -Sy kernel26
Once that is done, set up your config files (this is also covered in other places)
nano -w /etc/rc.conf nano -w /etc/fstab nano -w /boot/grub/menu.lst
Set up Grub
Now set up grub by running these commands.
grep -v rootfs /proc/mounts > /etc/mtab grub-install /dev/hda
Set up Udev
Run this command or you won't be able to boot!! (Thanks lucke!)
migrate-udev
Reboot!
Now reboot your computer and you should be all set. Make sure you take out the liveCD after you reboot!
exit cd umount /arch/boot /arch/dev /arch/proc /arch/sys /arch reboot
Enjoy!