FILE: Arch Linux Install DATE: 2015-12-26 ARCHIVED: 2021-10-22 (c) Copyright Brett Paufler # # # # # # # # # # # # # # # # # # # # # # # # # # # # This is essentially a .html file stored as a .txt. So, that should give you some idea about my feelings... and if it does not, my feelings are that this is not worth publishing as a html or of any use for casuals, which anyone but A-AI most surely is. I used Arch Linux for a week or two. But the simple fact is that I am a Windows Guy, always have been, and likely always will be. Or in other words, I am not so much of a Computer Geek, I wished to buck the system... or The Easy Turn Key OS that is Windows. My computer of choice (I currently have three of them: operational, web facing, and back up, along with at least one more for parts) is good enough for me, cost a mere $250 (or so), and came loaded with Windows Professional. I don't care all that much about the underlying OS... especially now that Windows runs Linux Programs (not that I ever have the need) right out of the box. Anyhow, this file is in Dead Code not Code. And there are way better tutorials out there. So, it's reference of my journey. I doubt I would follow my own notes if I had to do this over (and rather, would simply start from scratch). So, I certainly cannot recommend them to another. # # # # # # # # # # # # # # # # # # # # # # # # # # # # Posted for Archeological Reference ONLY. # # # # # # # # # # # # # # # # # # # # # # # # # # # # Taking the steps as written may Brick The System. # # # # # # # # # # # # # # # # # # # # # # # # # # # # If you are not A-AI (or to a lesser extent, interested in The Historical Evolution of Code) just walk away. # # # # # # # # # # # # # # # # # # # # # # # # # # # # Arch Linux Install

Arch Linux Basic Install

Yes, it took me way longer to successful install Arch Linux than any programmer might happily admit. And in the end, for the most, I wound up following someone else's line by line. So of course, I decided to write those instructions down here in the off chance I should ever need them again, you know, should I ever crash the system or whatnot.

References

wiki.archlinux.org/index.php/Beginners'_guide
Arch Linux Install Wiki Page: probably a more authoritative guide than yours truly.

youtu.be/6C_hwvU98xQ part one
youtu.be/6Odi10sIvyo part two
youtu.be/kQFzVG4wZEg a different tutorial
I trust you can do the search on your own and/or add the http on the front.

Create a Bootable Thumb Drive

I keep all the programs and bit of code that I think I'll ever need again in a special file on my computer, so creating a bootable thumb drive isn't that hard at this point.

Rufus
A portable utility that makes a thumb drive bootable. I have no idea where to get a copy.

archlinux.iso
Step one: fire up Rufus.
Step two: select from ISO Image
Step three: point it towards your previously downloaded archlinux.iso file.

Note: when Rufus runs, it will want to download two additional files from the Internet if they aren't previously stored in /rufus_files. Just let rufus download them the first time. Then, save for later with the rest.

Partition the Disc

fdisk -l
Lists the current partitions. I will use sda in the examples below, but just be forewarned, when I needed to do partition my disc, I actually needed to work on sdb. Also, another time (I did this lots), I partitioned my thumb drive and not my hard drive, which, of course, meant going back and using Rufus again. Long story short, it can take some doing figuring sda from sdb, but you're pretty much on your own for this. On the bright side, if you're planning on turning your machine into a dedicated Arch Linux box, I can testify to the fact that it doesn't really matter how many times the next step is done incorrectly.

cfdisk /dev/sda
Opens the cfdisk utility on disk /dev/sda, which is not the same thing as any of the partitions on sda, such as (maybe) /dev/sda1, /dev/sda2, or so on.
sda1	boot	1G	boot
sda2	swap	16G	swap
sda3	root	50G
sda4	home	100G+
This is the partition scheme I used. It's one of those points of personal preference and freewill, so the choices are a lot more complicated than they need be. Setting the above up using cfdisk just isn't that hard, but if stumped, perhaps watch a video or two. It really is easy. Finally, swap and root are probably much bigger than needed, but I figure disc space if cheap. And quite frankly, I have no idea what I'm doing (and if you are reading this, neither do you), so why stress it. This can't possibly be the last install.
boot = boot BIOS area, future home of grub
swap = for hibernate, mostly, but also some performance
root = Linux kernel lives here, future home of most programs
home = area for user files, so like desktop
Partitions will persist, now, across user sessions, so feel free to power down and resume at some later point in time.

File System Set Up

I have a hunch this is completely optional. As in, the system will work even if this step is skipped. But what file system is in use will be anybody's guess.

mkfs.ext2 /dev/sda1
Formats the boot partition with a non-journalling file system. mkfs.ext4 /dev/sda3
mkfs.ext4 /dev/sda4
Formats, um, let's see, per above, sda3 is root and sda4 is home, so the above code formats root and home with a journaling file system: type ext4, in fact.

Breaking here is OK, as well.

The Main Sequence

Thus begins the main push.

Turn Swap On

Ultimately, I had errors when I tried to turn swap off further down the line, so maybe the problem resides here, so take all of this with a grain of salt. mkswap /dev/sda2
swapon -s
Got no idea what the -s is for. And a better man, would check to confirm the swap was on at this point.

Mount the Lot

mount /dev/sda3 /mnt
mkdir /mnt/boot
mkdir /mnt/home
mount /dev/sda4 /mnt/home
mount /dev/sda1 /mnt/boot
Using mount and make directory, it seems pretty obvious what this does to me. However, the order is important in that root needs to be mounted before either of the directories are made or boot or home mounted to their directories. So, in other words, root is mounted to /mnt.

Run Pacstrap

Or if that's not clear, let Arch Linux take over. Obviously, building a Linux system from scratch is far beyond my means at this point. But this next step sort of highlights how far from building a system from scratch installing Arch Linux really is.
pacstrap -i /mnt base base-devel So, pacstrap is the install utility, -i insures a prompt, or so I am told, while base and base-devel are two packages of system files, commonly regarded as being the least code required to be up and running for a novice such as I, or someone reading this page such as you, or anyone else who doesn't want to bother calling the individual packages (bash, vi, etc.) one by one.

This may take a few minutes, but no thought is involved. It's a self-performing function.

The One Liners

genfstab -L -p /mnt > /mnt/etc/fstab
Generates a fstab file, which contains the partitioning scheme.
nano /mnt/etc/fstab
Reviewing the fstab file for accuracy is recommended, and nano is installed at this point, so why not use that?
arch-chroot /mnt
Change into the distro now installed on the hard disk, but not yet fully functional.
nano /etc/locale.gen
Using nano to open the locale file, uncomment the two en_USxxxx entries.
So, turn this:
#en_US.UTF-8
#en_US.something
into this:
en_US.UTF-8
en_US.something

locale-gen
Runs the locale-gen update program. Like most of this, something, something, the rationale for this being mostly beyond my ken. Locale information is processed according to the un-commented en_US directions in the step above. And yes, if you're not of th en_US crowd, you'll be wanting to un-comment something more appropriate to you.

export LANG=en_US.UTF-8
echo LANG=en_US.UTF-8 > /etc/locale.conf
The first sets these as variables for the system now; and the second, for the future.

ls /usr/share/zoneinfo
ls /usr/share/zoneinfo/US
The first brings forth a list, of which US is the correct choice for me. And the second brings forth another list, chose what's right for you.
ln -s /usr/share/zoneinfo/US/Hawaii /etc/localtime
As ls is to list, ln is to link. The final line there creates a symbolic link. hwclock --systohc --utc Sets the hardware clock to utc time. I'm told this is to prevent bugs. But quite frankly, at this point I've typed in so many commands without a clue, now does not seem to be the time to start questioning why.
systemctl enable dhcpcd.service A very important line of code, this would be. After typing the above into the command line, when it's finally time to reboot (not now) if you are ever plugged into an Ethernet cable, you'll be connected to the internet. So, um, let's see, 'system control enable Ethernet service' or something like that.
mkinitcpio -p linux Builds the RAM disc. Yep, that's what the guy on the video said. Mine is not to question why...

Grub

pacman -S grub Hey, I actually just know what this does. It installs grub. You remember grub, right Brett? It's that BIOS Bootloader that you couldn't get to run properly and why you gave up on trying to install a dual boot system, because you know, that was hard. Installing grub, on the other hand, is a piece of cake. grub-install --target=i386-pc --recheck /dev/sda Then, run grub, using the pc type architecture as appropriate on the hard disk (/dev/sda, if my memory serves correct). But it's worth mentioning this is for the disc (sda), not a partition on the disc (sda1). grub-mkconfig -o /boot/grub/grub.cfg If the previous set grub up (and I can only assume that they did), this runs grup, that is to say, sets it in stone on the hard disk, so it will actually run on reboot.

Backing Out

Back away slowly and keep your umount's where I can see them. exit Back's out of the chroot, so probably out of the install on the hard disc, meaning we're operating form the thumb drive again. umount /dev/sda1 umount /dev/sda4 umount /dev/sda3 These are unmounted in reverse order, so root is unmounted last. swapoff /dev/sda2 Turn the swap off, which I hope was obvious from the code. What isn't obvious is why this didn't work correctly for me. No matter, only one command to go at this point. reboot I had to take the thumb drive out for this to work. And I got a presumably fully functional Arch Linux system on restart. Though, I did lose all the colors in my shell...