HowTo Install Arch Linux: Difference between revisions

From PS:1 Wiki Dev
Jump to navigationJump to search
Content deleted Content added
 
(33 intermediate revisions by 2 users not shown)
Line 1: Line 1:
== Initializing the Disk==
== Installation Media ==
* Get the latest Arch install disk from https://www.archlinux.org/download/
* Boot from it


== Initializing the Disk ==
Install GPT (Guid Partition Table) on the disk`

Install/reinitialize GPT (Guid Partition Table) on the disk`
<syntaxhighlight lang="bash">
sgdisk --zap /dev/vda
</syntaxhighlight>

Create partition 1, leave 2048 sectors blank for the syslinux bootloader, and don't specify an end size, so that it takes the rest of the drive.
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
sgdisk -z /dev/vda
sgdisk --new 1:2048: /dev/vda
</syntaxhighlight>
</syntaxhighlight>


For Partition 1, set the bootable flag, (flag 2)
Create partition one, leave 2048 sectors blank for the bootloader, and consuming the rest of the drive.
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
sgdisk -n 1:2048: /dev/vda
sgdisk --attributes=1:set:2 /dev/vda
sgdisk --attributes=1:set:2 /dev/vda
</syntaxhighlight>
</syntaxhighlight>


Now that you have a partition, it will show as /dev/vda1. Format The partition as ext4
Now that you have a partition, it will show as /dev/vda1. Format The partition as ext4
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
mkfs.ext4 /dev/vda1 -F
mkfs.ext4 /dev/vda1 -F
Line 24: Line 32:
== Install Arch ==
== Install Arch ==


Install Arch to /mnt
* Also install base-devel: compiler programs
* openssh: remote access
* syslinux: bootloader

<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
pacstrap /mnt base base-devel openssh syslinux
pacstrap /mnt base
</syntaxhighlight>
</syntaxhighlight>


Line 35: Line 40:
Now that arch is isntalled, build a partition to mount point table, and write it to /mnt/etc/fstab
Now that arch is isntalled, build a partition to mount point table, and write it to /mnt/etc/fstab
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
genfstab -p /mnt >> /mnt/etc/fstab
genfstab /mnt >> /mnt/etc/fstab
</syntaxhighlight>
</syntaxhighlight>


== Jump into Arch ==
== Change Root (chroot) to Arch ==


Switch into the arch installtion.
Switch into the arch installtion.
Line 45: Line 50:
</syntaxhighlight>
</syntaxhighlight>


Set time Timezone

Fix the timezone settings
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
unlink /etc/localtime
ln -s /usr/share/zoneinfo/America/Chicago /etc/localtime
ln -s /usr/share/zoneinfo/America/Chicago /etc/localtime
</syntaxhighlight>
</syntaxhighlight>


== Prepraring to Boot ==


Create your initial ramdisk - The initial file system before the real one boots
Set dhcpd to start at boot
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
mkinitcpio -p linux
systemctl enable dhcpcd
</syntaxhighlight>
</syntaxhighlight>


Install syslinux
Set sshd to start at boot.
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
pacman -S syslinux
systemctl enable sshd
</syntaxhighlight>
</syntaxhighlight>


Install syslinux's GPT MBR (Master Boot Record) to the root of MBR. This will sit in the 2048 of reserved space from when we partitioned the drive.
== Prepraring to boot ==
<syntaxhighlight lang="bash">
dd if=/usr/lib/syslinux/bios/gptmbr.bin of=/dev/vda
</syntaxhighlight>


Prepare the /boot folder with syslinux's modules. The .c32 files that ship with syslinux are for systems that use a bios to boot. Symlink the bios modules into syslinux's boot folder.
Create your initial ramdisk - The initial file system before the real one boots
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
ln -s /usr/lib/syslinux/bios/*.c32 /boot/syslinux/
mkinitcpio -p linux
</syntaxhighlight>
</syntaxhighlight>


Prepare the /boot folder with syslinux's init stuff.
Run the syslinux extlinux installer.
* extlinux is the filesystem variant of syslinux
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
cp -r /usr/lib/syslinux/bios/*.c32 /boot/syslinux/
extlinux --install /boot/syslinux
extlinux --install /boot/syslinux
</syntaxhighlight>
</syntaxhighlight>


By default, syslinux tries to boot /dev/sda3. Change it to boot /dev/vda1
Install syslinux's GPT MBR (Master Boot Record) to the root of MBR. This will sit in the 2048 of reserved space from when we partitioned the drive.
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
sed -i 's#/dev/sda3#/dev/vda1#' /boot/syslinux/syslinux.cfg
dd bs=440 count=1 conv=notrunc if=/usr/lib/syslinux/bios/gptmbr.bin of=/dev/vda
</syntaxhighlight>
</syntaxhighlight>


== Reboot ==
By default, syslinux tries to boot /dev/sda3. Change it to boot /dev/vda1

<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
exit
sed -i 's#/dev/sda3#/dev/vda1#' /boot/syslinux/syslinux.cfg
reboot
</syntaxhighlight>
</syntaxhighlight>


=== When Something Goes Wrong ===
== Flavor ==

If something goes wrong with rebooting and you end up back on the live cd, you don't need to start over.
Running the following 2 commands will bring you back to your Arch Linux Environment
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
mount /dev/vda1 /mnt
echo [archlinuxfr] >> /etc/pacman.conf
arch-chroot /mnt
echo SigLevel = Never >> /etc/pacman.conf
echo Server = http://repo.archlinux.fr/\$arch >> /etc/pacman.conf
pacman -Sy
pacman -S --noconfirm salt-zmq
systemctl enable salt-minion
</syntaxhighlight>
</syntaxhighlight>


Once you are back in the Arch environment, Check the following:
== enter your hostname ==
* You set the bootable flag on the partions
* You setup the syslinux boot loader correctly.


== PS:One Flavor ==
echo ${hostname} > /etc/hostname


=== Salt ===
Some settings common to most of the computers at PS:One can be applied by running the following commands:
<syntaxhighlight lang="bash">
pacman -S salt-zmq
systemctl start salt-minion
salt-call state.highstate
</syntaxhighlight>


== reboot ==
=== Network Logins ===
Enable Network logins by joining the domain server.
exit
After this command is run, the machine will support network authentication.
reboot
<syntaxhighlight lang="bash">
net ads join -U <your user name>
</syntaxhighlight>

Latest revision as of 03:54, 6 September 2015

Installation Media

Initializing the Disk

Install/reinitialize GPT (Guid Partition Table) on the disk` <syntaxhighlight lang="bash"> sgdisk --zap /dev/vda </syntaxhighlight>

Create partition 1, leave 2048 sectors blank for the syslinux bootloader, and don't specify an end size, so that it takes the rest of the drive. <syntaxhighlight lang="bash"> sgdisk --new 1:2048: /dev/vda </syntaxhighlight>

For Partition 1, set the bootable flag, (flag 2) <syntaxhighlight lang="bash"> sgdisk --attributes=1:set:2 /dev/vda </syntaxhighlight>

Now that you have a partition, it will show as /dev/vda1. Format The partition as ext4 <syntaxhighlight lang="bash"> mkfs.ext4 /dev/vda1 -F </syntaxhighlight>

Mount The partiton, so that we can install arch onto it. <syntaxhighlight lang="bash"> mount /dev/vda1 /mnt </syntaxhighlight>

Install Arch

Install Arch to /mnt <syntaxhighlight lang="bash"> pacstrap /mnt base </syntaxhighlight>


Now that arch is isntalled, build a partition to mount point table, and write it to /mnt/etc/fstab <syntaxhighlight lang="bash"> genfstab /mnt >> /mnt/etc/fstab </syntaxhighlight>

Change Root (chroot) to Arch

Switch into the arch installtion. <syntaxhighlight lang="bash"> arch-chroot /mnt </syntaxhighlight>

Set time Timezone <syntaxhighlight lang="bash"> ln -s /usr/share/zoneinfo/America/Chicago /etc/localtime </syntaxhighlight>

Prepraring to Boot

Create your initial ramdisk - The initial file system before the real one boots <syntaxhighlight lang="bash"> mkinitcpio -p linux </syntaxhighlight>

Install syslinux <syntaxhighlight lang="bash"> pacman -S syslinux </syntaxhighlight>

Install syslinux's GPT MBR (Master Boot Record) to the root of MBR. This will sit in the 2048 of reserved space from when we partitioned the drive. <syntaxhighlight lang="bash"> dd if=/usr/lib/syslinux/bios/gptmbr.bin of=/dev/vda </syntaxhighlight>

Prepare the /boot folder with syslinux's modules. The .c32 files that ship with syslinux are for systems that use a bios to boot. Symlink the bios modules into syslinux's boot folder. <syntaxhighlight lang="bash"> ln -s /usr/lib/syslinux/bios/*.c32 /boot/syslinux/ </syntaxhighlight>

Run the syslinux extlinux installer.

  • extlinux is the filesystem variant of syslinux

<syntaxhighlight lang="bash"> extlinux --install /boot/syslinux </syntaxhighlight>

By default, syslinux tries to boot /dev/sda3. Change it to boot /dev/vda1 <syntaxhighlight lang="bash"> sed -i 's#/dev/sda3#/dev/vda1#' /boot/syslinux/syslinux.cfg </syntaxhighlight>

Reboot

<syntaxhighlight lang="bash"> exit reboot </syntaxhighlight>

When Something Goes Wrong

If something goes wrong with rebooting and you end up back on the live cd, you don't need to start over. Running the following 2 commands will bring you back to your Arch Linux Environment <syntaxhighlight lang="bash"> mount /dev/vda1 /mnt arch-chroot /mnt </syntaxhighlight>

Once you are back in the Arch environment, Check the following:

  • You set the bootable flag on the partions
  • You setup the syslinux boot loader correctly.

PS:One Flavor

Salt

Some settings common to most of the computers at PS:One can be applied by running the following commands: <syntaxhighlight lang="bash"> pacman -S salt-zmq systemctl start salt-minion salt-call state.highstate </syntaxhighlight>

Network Logins

Enable Network logins by joining the domain server. After this command is run, the machine will support network authentication. <syntaxhighlight lang="bash"> net ads join -U <your user name> </syntaxhighlight>