SilverBear tries his paw at Archery

Why?

Because it's there!

For me one of the original attractions to Linux was to have a tailor-made operating system. While nearly every GNU/Linux distro is far more customizable and tweakable than MS-Windows or Mac OS X, there is a difference. If you start with a full-function sort of distro like Ubuntu, Mepis, Mandriva, PCLinuxOS, et al, you are faced with changing, rearranging or tearing down a “software machine” in order to rebuild it. While this, too, is fun and educational, there is a different kind of pleasure in building your hot rod from the chassis, up.

Notice I said “from the chassis, up.” With Arch you do get the chassis to build on, with Arch Core. It's not as tongue-to-the-metal in January kind of close contact you get with Gentoo. Arch is about downloading and configuring discrete, finished pieces in a logical, customized fashion. There is no compiling necessary or expected.

I'm not sneering at “the Gentoo Experience!” Far from it. Someday, this too shall be mine. But it does require a level of time, knowledge, and time, and commitment, and time that Arch does not require. Due to other time commitments, it took me most of a week, working in three separate session of 2-3 hours at a time, to build my Arch the way I need it to work.

I'm still not finished, mind you. But I'm far enough that here it is Friday evening and I'm still in the same session of Arch, without rebooting, that I was into Monday noon when I finished installing KDE and added my essential web development and graphics design progs. I'm not done, but I've been productive all week [redesigning this website yesterday and today, after other jobs] because I built a system that does what I need it to do.

When I decide I need it to do more: then I'll work on my Arch some more.

So maybe a better metaphor is carpentry, not auto mechanics. I've got a house here that's not as big or as grand and finished as it is going to be. But it is good enough for me to have lived in all week. And I'm happy.



Installation tips and pitfalls for the unwary

Tip #1: Have reference material at hand.

I have a portable computer [AKA “laptop”] that I set up on an occasional table next to my desk. While installing and configuring my desktop machine, I was able to refer to the for the most part excellent installation and configuration information available on the Arch Linux website. Go and do likewise, if thou canst. Or else use a printer to print out the configuration files section:

http://wiki.archlinux.org/index.php/Beginners_Guide#Configure_The_System
http://wiki.archlinux.org/index.php/Official_Arch_Linux_Install_Guide#System_Configuration
http://wiki.archlinux.org/index.php/Pacman

Tip #2: nano. And you will need to use it.

During installation when you are given the choice between nano and vi/vim for default text editor, choose nano. Unless you already know how to use vi, I'm quite certain now is not the time you'll want to start learning its arcane modal interface.

Tip #3: Beware the interface!

During installation, when you get to the step of Setting Mountpoints, the Installer interface has a design flaw. After you set mountpoints for your root filesystem, /home, /boot and whatever else, the main interface controls do not have the “done” option available. If you get out of this screen, whatever mountpoints you have set will be lost, and your installation will fail. You need to scroll to the end of the list of availavle partitions to find “done” --or whatever equivalant word is used.

As you might guess, this was what screwed my first attempt to install. On some computers the done entry might be obvious, but I have 4 HDDs with over 35 partitions. There was no reason for me to scroll all the way to the end of that long list, as my root, /boot and /home were all on sda. IMHO, the “done” should be located near the “cancel” option, not with the list of partitions. But if you know it's down there, there should be no problem.

Tip 4: Keep your downloaded packages!

Contributed tip Farcry, and something I did but forgot to mention in the first draft of this article:
Keeping all your downloaded packages in /var/cache/pacman/pkg/ is very useful if you encounter problems and need to downgrade a package or two (as I needed to do for my laptop, only finding out later). Even if they are moved elsewhere, it's great to know you can always just do a 'pacman -U wherever/pkgname' to install any of the saved packages. So, for insurance (paranoia?), or to install the packages on another machine, it's worth a bit of storage space on HD or a CD/DVD to retain them for at least a respectable while. I had to rummage on the Arch mirrors for some old versions, and it wasn't 100% successful.



The only thing I didn't understand was an error message I got —which as far as I can tell, turned out not to indicate any problem, really. Forgive the lousy pic. It isn't a digital screen-shot, it's a photo of the screen with a very cheap digital camera.

arch error 001 screenshot

As far as I can tell, BASH is fine, as you will see later on in the tale.




Add a user and setup groups

The Beginners Guide says:

You should not do your everyday work using the root account. It is more than poor practice; it is dangerous. Root is for administrative tasks. Instead, add a normal user account using:
adduser
While most default options are safe to use, you may want to add storage, audio, video, optical, and wheel to your additional groups- especially if you are planning on having a full-featured desktop environment.
Groups and users thereof are defined in /etc/group.   They include:
* audio - for tasks involving sound card and related software
* wheel - for using sudo
* storage - for managing storage devices
* video - for video tasks and 3d acceleration
* optical - for managing tasks pertaining to the optical drive(s)
* floppy - for access to a floppy if applicable
* lp - for managing printing tasks
See the Groups article to understand what groups you need to be a member of.
Check the man pages for usermod and gpasswd for more information.

IMO, this is pretty scanty info to really assist a “beginner”. What you need to know: issue the following command with the proper switch:

adduser -m silverbear

The new user silverbear is created, and the contents of /etc/skel is copied into the newly created /home/silverbear directory. This sets you up with several hidden directories necessary for configuration.



Mounting Anxiety

Actually, I just like the drama in that headline. Things went fairly smoothly up to this point, with the exception of the problem I mention in tip #3, above. After I got my basic configuration rolling along I installed the X11 server, and then the arch KDE package.

At this point I had a problem. I'd noticed it before, but it wasn't a problem until now. I was still configuring and building my Arch system. But now that Arch was getting ready to use as a desktop machine, I was going to need to SilverBearize the basic install. That meant bringing access to all my data partitions into my /home/silverbear directory by means of symlinks. The first step in that process is to set up the /etc/fstab file so that the proper partitions automount at boot.

But the only entries in my fstab were the system mount points I'd set at installation: /[root] /boot /swap and /home.

I'd asked Adrian, a friend who'd installed Arch a couple weeks before, if he'd encountered the problem. He remembered having to enter one or two partitions manually.

But, my friends! The SilverBear has over 30 partitions on 3 HDDs he needs to account for in the fstab! Granted, not all of them need to be automounted. Some are data-only partitions, some are other OS roots, some are other OS /home partitions. But I want them all in the fstab.

Editing my fstab was not the problem. I could just copy my Mepis 7.0 /etc/fstab, take the relevant sections out and copy them to the Arch fstab. What was a problem, however, is that there were no mountpoints in /mnt. None. the directory was empty.

My friends! It's only been a few weeks that hibernation has been officially over in the Northern Hemisphere. SilverBear was not about to create between 30 and 40 subdirectories in /mnt via the command line! For those of you who don't know already: I am partially paralyzed on my left side. SilverBear is a one-pawed typist. With qwerty-keyboard dyslexia! [A condition the occasional typos in these pages illustrates.]


BASH those problems away with a Script!

What I needed to do was write a BASH script to poll the entries in /dev, and for every one that was named sd-something, I needed to create a corresponding subdirectory in /mnt.

So I spend a bit of time scripting, and tested it out in another OS, in a specially-created /mnt subdirectory in my home. Things went OK, but I was winding up with a /mnt/sda /mnt/sdb and /mnt/sdc which are not mountable partitions. Rather than refine my script to just pick sdx plus some integer out, I added a line to delete these unwanted numberless sdx's.

The script worked perfectly, my editing of the /etc/fstab with cut & paste from another OS's fstab went fine. It was time to start running KDE, create my symlinks inside /home/silverbear, and get on with installing essential programs with pacman!

For those of you interested, here is what I came up with for the BASH script:

#!/bin/sh
#
#  mkdir in /mnt for every instance of /dev/sd*nn
#  SilverBear 2008-04-13
#

#  Set shell environment
PATH=/bin:/dev:/mnt:.
cd /dev
for file in sd*; do
echo "Adding $file to /mnt directory..."
mkdir /mnt/$file
done
cd /mnt
rmdir sd?
echo "****************************************"
echo "Finished creating partition mountpoints."
echo "****************************************"
echo " "
echo "If you don't believe me, here's the directory listing. See for yourself!"
ls -l
exit
Caveat

You are free to use this script, of course. And of course you do it at your own risk. I am not responsible for anything you do as the root user on your computer. If ye know not the binding spells, don't stir the spirits unneccessarily. As H.P. Lovecraft said in The Case of Charles Dexter Ward, “Do not call up that which ye cannot put down!”





Next installment: “How SilverBear screwed up X11”

Be sure to tune in next week for this exciting episode!




This article is definitely a Work in Progress. Check back soon.