This catalogs my experience with installing archlinux. Which of course, I’ve never used before, so it should be a nice learning curve. First off, navigate to the archlinux website, and download the iso. Then put that on a USB Flash drive. I used the following command to do that:
dd if=archlinux-2012.09.07-dual.iso of=/dev/sdb bs=4M
Next boot the device in question with the USB flash drive inserted, and tell the system to boot from the USB Flash drive (usually F12 on alot of systems). In my case I choose “Boot Arch Linux (x86_64). It boots the system to a command prompt. Now you have to do some work to get the system installed. The readme.txt file in your home directory gives you a rundown, and also points you to the wiki if you wish to view on another screen / machine.
Use fdisk to create your partition(s), then format them with mkfs. In my case I created the following:
sda1 512M For /boot
sda2 2G swap
sda3 20G for /
sda4 rest for /home
So, the exact commands would be:
fdisk /dev/sda
n (select n for "New Partition")
p (select between "p" or "e" primary/extended)
1 (Partition # to use. 1 is of course the first partition)
+512M (size of Partition 1)
n,p,2,+2G (to create a primary partition #2 of 2GB in size)
t,2,82 --> (Change the type of partition #2 to 82, which is the code for Linux Swap)
n,p,3,+20G (create a 20GB parition for / )
n,p,4,[enter] (use reset of the disk for partition #4, which will be for /home)
Note: It should be noted that there are restrictions to 4 Primary partitions only. If you plan on dual-booting or having some extra-room for expansion don’t use all primary partitions. You could do primary for Parition #1, and extended for the rest. Using the same scenario as above, we’ll create the partitions in fdisk. Partition 1 will be a primary parition (for boot), then we’ll create an extended partition which spans the rest of the disk, followed by creating logical partitions for the others. Note: If this setup will be a dual-boot scenario (with multiple O/s’s on the same hard drive) then you should install os-prober with pacman -S os-prober
.
Hence, this would be the layout:
sda1 512M For /boot (Primary)
sda2 extended (spans rest of the disk)
sda5 2G swap (logical partition)
sda6 20G for / (logical partition)
sda7 rest for /home (logical partition)
This is accomplished with:
fdisk /dev/sda
n,p,1 (enter for default sector to start at), +512M [enter]
n,e,[enter],[enter @ start sector], enter [for ALL remaining space of disk]
n,l,[enter],+2G .. t,5,82 (to change partition #5 to a swap partition)
n,l,[enter],+20G (for root)
n,l,[enter],[enter] (rest for home)
Then format them with:
mkfs.ext2 /dev/sda1
mkfs.ext4 /dev/sda3
mkfs.ext4 /dev/sda4
Next, prepare the swap space for usage:
mkswap /dev/sda2
swapon /dev/sda2
Then mount them:
mount /dev/sda3 /mnt
mkdir /mnt/boot
mkdir /mnt/home
mount /dev/sda1 /mnt/boot
mount /dev/sda4 /mnt/home
Note: Substitute the proper partitions if you are using an extended partition scheme.
Confirm I have an IP with ifconfig
. Which I did, so no need to run dhclient
. Now run the command to download the core system files. pacstrap /mnt base base-devel
Next, install your bootloader.
pacstrap /mnt grub-bios
then pacstrap /mnt syslinux
NOTE: The boot-loader won’t be installed until after you do a chroot.
Create your fstab with genfstab -p -U /mnt >> /mnt/etc/fstab
(Using the UUIDs).
Now chroot into our new environment. arch-chroot /mnt
Write your hostname. ex. echo sandbox > /etc/hostname
Symlink your zone info. ex. ln -s /usr/share/zoneinfo/America/New_York /etc/localtime
Set locale preferences in /etc/locale.conf nano /etc/locale.gen
and uncomment the lines for en_US.
Generate the locales with locale-gen
Create your initramfs. mkinitcpio -p linux
Install grub bootloader with
modprobe dm-mod
grub-install --target=i386-pc --recheck --debug /dev/sda
mkdir -p /boot/grub/locale
cp /usr/share/locale/en\@quot/LC_MESSAGES/grub.mo /boot/grub/locale/en.mo
grub-mkconfig -o /boot/grub/grub.cfg
Set the root password passwd
Before exiting the chroot environment, you may wish to install some packages that will make your life a bit easier on reboot (such as a dhcp client for automatically getting an IP address)
My base selections thus far are:
* pkgfile (gives you the ability to search packages for files, similar to debian’s apt-file)
* wpa_supplicant (if you have a wireless card, this one would be handy)
* wireless_tools (Tools allowing one to manipulate the wireless extensions)
Now to get out of the chroot, simple type exit
then unmount the filesystems with umount /mnt/{boot,home} && umount /mnt
Reboot the system.
Now you may notice that ifconfig
is NOT installed. This has been replaced by ip
as ifconfig (part of the net-tools package) is being phased out. If you still wish to use it, then you should install it from a LIVE-Media, or get an ip now and install it later.
First things first. Let’s configure pacman configuration, then we’ll move on to networking.
Modify the /etc/pacman.conf file if required. (nano /etc/pacman.conf
)
Uncomment the [multilib] section if you are running in 64-bit. Then force a refresh of the repositories with pacman -Syy
. You can attempt to update the system with pacman -Syu
which may or may not be required.
= Get DHCP network going =
Apparently Arch Linux has an auto-rename setup for the networking interfaces. This can be a bit of a pain for most users moving over from another variation of Linux (like me). We can determine this with:
ls -l /sys/class/net
If you see your wired interface (and possibly wireless interface) have non-standard names, then you should create the link below to fix this… then upon reboot they will be back to normal.
example auto-renamed interface for eth0, is now called enp0s3.
== Disable auto-rename of network interfaces ==
ln -s /dev/null /etc/udev/rules.d/80-net-name-slot.rules
then reboot. Issuing another ls -l /sys/class/net
should confirm this.
== Enable DHCP networking ==
Run this one liner to enable dhcp service for the network interface eth0:
systemctl enable [email protected]
# Will take affect on future reboots
To enable DHCP networking now run the command:
systemctl start [email protected]
Confirm with: ip addr
Ensure you can ping an internet server with:
ping -c 3 www.google.com
= Install X Window System =
pacman -S xorg-server xorg-xinit xorg-server-utils xterm
Now install your preferred window manager, or look for the available ones:
pacman -Ss "window manager"
Now of course to run X-windows, you’ll need to install a graphical driver for your video card. This varies based on the hardware. To get an idea of what you have (in case you don’t know) run the command:
lspci |grep VGA
= Additional packages to install =
Here are some additional packages which may be useful to install.
unrar (access compressed files without unpacking them)
udisks (automount external drives)
vdpau-video (accelerated video playback for nvidia cards)
xvba-video (accelerated video playback for amd cards)
lirc (remote controller support)
cups (CUPS backend — for printers)
the gstreamer package and plugins
pacman -S unrar udisks vdpau-video gstreamer gstreamer0.10-{good,bad,ugly}-plugins vlc wget openssh openssl
Edit /etc/ssh/sshd_config as you see fit, and then set it to launch at system boot with:
systemctl enable sshd.service
Reblogged this on Gigable – Tech Blog.