{"id":1466,"date":"2010-11-20T22:47:14","date_gmt":"2010-11-20T22:47:14","guid":{"rendered":"http:\/\/really.zonky.org\/?p=1466"},"modified":"2010-11-26T21:48:54","modified_gmt":"2010-11-26T21:48:54","slug":"the-move-to-archlinux","status":"publish","type":"post","link":"https:\/\/really.zonky.org\/?p=1466","title":{"rendered":"The Move To ArchLinux"},"content":{"rendered":"<p>For some time now, I have been contemplating switching Linux distributions on my main workstation from <a href=\"http:\/\/www.ubuntu.com\/\">Ubuntu<\/a> to something a little less &#8230; user friendly ? Or perhaps that should be a little more Unix geek friendly. The distribution I chose was <a href=\"http:\/\/www.archlinux.org\/\">ArchLinux<\/a> for a variety of reasons. If you come across this blog entry looking for a solution to a problem, it may be worth reading through in case the solution appears later on &#8211; this is long, and searches may &#8220;hit&#8221; on something later on.<\/p>\n<p>First of all, let me point out there is really nothing wrong with Ubuntu for most users. It is a pretty useful distribution that is pretty good for the kind of users who have never compiled their own kernel. Nothing wrong with that, but it seems that Ubuntu is gradually becoming a little trickier to use for those of us who prefer to customise their desktop environment with something like <a href=\"http:\/\/www.enlightenment.org\/\">Enlightenment<\/a> &#8211; it seems that Ubuntu is really intended for those who want the Ubuntu way.<\/p>\n<p>Nothing wrong with that, and I&#8217;m intending to keep running Ubuntu on my netbook.  However I wanted a little more control for my main workstation. And what with an SSD to install as a new boot device, it seemed like a good time to try out ArchLinux especially as I could reboot into Ubuntu if things looked bad. As it happens I haven&#8217;t needed to do that!  This blog entry is going to get quite long as a place to record my notes on getting ArchLinux to do the things I want, and will grow over time.<\/p>\n<h2>The Install<\/h2>\n<p>I downloaded the <em>core<\/em> install image rather than the <em>net<\/em> install image &#8211; not for any good reason as I have done test installs from the net install image and it works well.  After installing the SSD into my workstation (stuck to the bottom of the case with duct tape &#8211; I should really get a 2.5-&gt;3.5&#8243; disk tray), I changed the boot order of the disks in my BIOS to boot from the SSD first. This was perhaps not the best idea as it made things a little trickier later, but it&#8217;s workable if you are prepared to juggle disk names (both Linux ones and BIOS\/Grub ones).<\/p>\n<p>First for the boring bit :-<\/p>\n<ol>\n<li style=\"font-size: 13.1944px;\"><span style=\"font-size: 13.1944px;\">Booted off the install CD<\/span><\/li>\n<li style=\"font-size: 13.1944px;\"><span style=\"font-size: 13.1944px;\">Selected CD as source<\/span><\/li>\n<li style=\"font-size: 13.1944px;\"><span style=\"font-size: 13.1944px;\"> <\/span><span style=\"font-size: 13.1944px;\">Set Europe\/London as timezone<\/span><\/li>\n<li style=\"font-size: 13.1944px;\"><span style=\"font-size: 13.1944px;\"> <\/span><span style=\"font-size: 13.1944px;\">Set hwclock as UTC<\/span><\/li>\n<li style=\"font-size: 13.1944px;\"><span style=\"font-size: 13.1944px;\"> <\/span><span style=\"font-size: 13.1944px;\">Prep hard drives-<\/span>\n<ol>\n<li><span style=\"font-size: 13.1944px;\">Manually configure hard drives<\/span><\/li>\n<li><span style=\"font-size: 13.1944px;\"> <\/span><span style=\"font-size: 13.1944px;\">Partition \/dev\/sdc (the SSD &#8211; identified by the fact it was empty)<\/span><\/li>\n<li><span style=\"font-size: 13.1944px;\">Created 256Mb partition \/dev\/sdc1 (for \/boot)<\/span><\/li>\n<li><span style=\"font-size: 13.1944px;\">Created partition with the rest of the space \/dev\/sdc2 as LVM<\/span><\/li>\n<li><span style=\"font-size: 13.1944px;\">Manually configure block devices<\/span>\n<ol>\n<li><span style=\"font-size: 13.1944px;\">By device name<\/span><\/li>\n<li><span style=\"font-size: 13.1944px;\">Created \/boot on \/dev\/sdc1 as ext2<\/span><\/li>\n<li><span style=\"font-size: 13.1944px;\">\/dev\/sdc2 becomes Volume Group<\/span><\/li>\n<li><span style=\"font-size: 13.1944px;\">\/ as XFS (16G)<\/span><\/li>\n<li><span style=\"font-size: 13.1944px;\">\/var as ResierFSS (4G)<\/span><\/li>\n<li><span style=\"font-size: 13.1944px;\">swap (4G) &#8211; Although I have a tendency to forget this one!<\/span><\/li>\n<li><span style=\"font-size: 13.1944px;\">\/opt as XFS (4G)<\/span><\/li>\n<li><span style=\"font-size: 13.1944px;\">\/tmp as ReiserFS (4G) &#8211; perhaps a bit too big.<\/span><\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<\/li>\n<li style=\"font-size: 13.1944px;\"><span style=\"font-size: 13.1944px;\">Select Packages<\/span>\n<ol>\n<li><span style=\"font-size: 13.1944px;\">Select Base + Development.<\/span><\/li>\n<li><span style=\"font-size: 13.1944px;\">Pick random additions that look like they might be useful (note that it may be necessary to pick all of the various <em>mkinitcpio<\/em> variations as I did that on the later attempts).<\/span><\/li>\n<\/ol>\n<\/li>\n<li style=\"font-size: 13.1944px;\"><span style=\"font-size: 13.1944px;\">Install Packages<\/span><\/li>\n<li style=\"font-size: 13.1944px;\"><span style=\"font-size: 13.1944px;\">Configure System<\/span>\n<ol style=\"font-size: 13.1944px;\">\n<li><span style=\"font-size: 13.1944px;\">Select &#8216;vi&#8217; as editor<\/span><\/li>\n<li><span style=\"font-size: 13.1944px;\">Made the following changes to <em>rc.conf<\/em><\/span>\n<ol>\n<li><span style=\"font-size: 13.1944px;\">UseLVM=yes<\/span><\/li>\n<li><span style=\"font-size: 13.1944px;\">HOSTNAME=scrofula<\/span><\/li>\n<li><span style=\"font-size: 13.1944px;\">eth0=&#8221;eth0 10.0.0.18 netmask 255.255.0.0 broadcast 10.0.255.255&#8242;<\/span><\/li>\n<li><span style=\"font-size: 13.1944px;\">gateway=&#8221;default gw 10.0.0.254&#8243;<\/span><\/li>\n<li><span style=\"font-size: 13.1944px;\">ROUTES=(gateway)<\/span><\/li>\n<\/ol>\n<\/li>\n<li><span style=\"font-size: 13.1944px;\">Made the following changes to <em>mkinitcpio.conf<\/em><\/span>\n<ol>\n<li><span style=\"font-size: 13.1944px;\">BINARIES=&#8221;\/sbin\/lvm&#8221;. This shouldn&#8217;t be necessary, but at one point I ended up with a miniroot shell which was unable to mount the root filesystem and with no LVM present, I couldn&#8217;t see what was wrong! This error could be related to the <em>raid<\/em> problems detailed below, but adding this won&#8217;t cause any harm.<\/span><\/li>\n<li><span style=\"font-size: 13.1944px;\">HOOKS=&#8221;base udev autodetect scsi sata lvm2 filesystems&#8221;. Note that &#8220;raid&#8221; is suggested as necessary for software RAID; that turns out to be incorrect as discovered later. Although I needed software RAID to mount my <em>\/home<\/em>, I left that for later after putting <em>raid<\/em> in here gave errors)<\/span><\/li>\n<\/ol>\n<\/li>\n<li><span style=\"font-size: 13.1944px;\">Made the following changes to <em>resolv.conf<\/em><\/span>\n<ol>\n<li><span style=\"font-size: 13.1944px;\">search inside.zonky.org<\/span><\/li>\n<li><span style=\"font-size: 13.1944px;\">nameserver 10.0.0.12<\/span><\/li>\n<\/ol>\n<\/li>\n<li><span style=\"font-size: 13.1944px;\">Made the following changes to <em>mirrorlist<\/em><\/span>\n<ol>\n<li><span style=\"font-size: 13.1944px;\">Select something from &#8220;Great Britain&#8221;.<\/span><\/li>\n<\/ol>\n<\/li>\n<li><span style=\"font-size: 13.1944px;\">Set root password.<\/span><\/li>\n<li><span style=\"font-size: 13.1944px;\">Done<\/span><\/li>\n<\/ol>\n<\/li>\n<li style=\"font-size: 13.1944px;\"><span style=\"font-size: 13.1944px;\">Install Bootloader<\/span>\n<ol>\n<li style=\"font-size: 13.1944px;\"><span style=\"font-size: 13.1944px;\">Grub<\/span><\/li>\n<li style=\"font-size: 13.1944px;\"><span style=\"font-size: 13.1944px;\">Installed to <em>\/dev\/sdc<\/em>! This is because although the SSD is the third by address, it is also the first boot device in the BIOS.<\/span><\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<p>This didn&#8217;t work the first time around. Firstly <em>grub<\/em> wasn&#8217;t setup properly as it wanted to boot the next stage from <em>(hd2,0)<\/em> which would be one of the hard disks rather than the SSD, as at this point the BIOS is still in charge (more or less). This was easily fixed on a temporary basis by editing the boot setting at the menu, and later on a more\u00a0permanent\u00a0basis by editing <em>\/boot\/grub\/menu.lst<\/em>.<\/p>\n<p>Secondly the first couple of times around, I found myself in what I term the &#8220;miniroot shell&#8221; which is the shell you get when the Linux install fails to mount the root filesystem. The only hint I had here was that a) it couldn&#8217;t mount the root filesystem, and b) the binary <em>\/bin\/lvm<\/em> was not present. On the third or fourth attempt (my notes aren&#8217;t sufficiently accurate) I managed to get past this stage by excluding the <em>raid<\/em> &#8220;hook&#8221; and including the <em>\/bin\/lvm<\/em> binary in the <em>mkinitcpio<\/em> configuration file.<\/p>\n<p>It would seem that at some point ArchLinux has changed the &#8220;hook&#8221; name from <em>raid<\/em> to <em>dmraid<\/em> and some instructions out there still refer to the hook as &#8220;raid&#8221;. My fault for not checking closely enough with enough sources! But there&#8217;s no harm in the ArchLinux people configuring both names &#8211; probably just a case of setting up a hard link somewhere!<\/p>\n<h2>Post-Installation<\/h2>\n<p>With a distribution such as ArchLinux, the easy part is the installation; things get a bit trickier with the post-installation configuration. This is simply because to allow you to do things your way, it needs to leave things alone and let you do your stuff. In other words this lack of default configuration is a feature and not a bug!<\/p>\n<p>The first thing to so after a core install (and probably a net install too) is to perform a full update :-<\/p>\n<pre>pacman -Suy<\/pre>\n<p>The &#8220;pacman&#8221; tool is of course the ArchLinux package management tool. This operation sits somewhere between a normal Ubuntu package upgrade and a full Ubuntu distribution upgrade. ArchLinux does not have distribution versions in the same way as Ubuntu &#8211; whilst the installation media is undoubtedly upgraded from time to time, once actually installed the command above will perform both upgrades to apply necessary fixes, and upgrade packages when new versions come out.<\/p>\n<p>This can lead to some surprises from time to time of course, but there is also never quite the same level of shock that comes with a distribution upgrade.<\/p>\n<p>In any case, I needed to run the command twice as <em>pacman<\/em> itself needed an upgrade.<\/p>\n<p>After doing that, I set CONSOLEFONT in <em>\/etc\/rc.conf<\/em> to &#8220;sun12x22.psfu&#8221; to improve the appearance of the console, although there are another couple of fonts based on that font that may well be a better choice. <em>Later I used the &#8220;consolefont&#8221; hook to set the console font at an earlier stage during the boot process &#8211; which is neater; however you should specify the font without the file extension &#8211; &#8220;sun12x22&#8221;, and of course add &#8220;consolefont&#8221; to the HOOKS variable in \/etc\/mkinitcpio.conf.<\/em><\/p>\n<p>I also edited <em>\/boot\/grub\/menu.lst<\/em> to change the line that specifies what kernel to load and it&#8217;s options :-<\/p>\n<pre>kernel \/vmlinuz26 root=\/dev\/mapper\/ssd-root ro vga=775<\/pre>\n<p>Specifically adding the &#8220;vga=775&#8243; to the end of that. This makes the appearance of the console not quite so overwhelming on a 30&#8221; monitor!<\/p>\n<p>Also added &#8220;dmraid&#8221; to the HOOKS variable in <em>\/etc\/mkinitcpio.conf<\/em> although reading more documentation hints that the right hook is actually &#8220;mdadm&#8221;. Run <em>mkinitcpio -p kernel26<\/em> to update things.<\/p>\n<p>Rebooted to verify that things are still working. Plus check that the CONSOLEFONT was ok, and that the old volume group:sys was visible.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>For some time now, I have been contemplating switching Linux distributions on my main workstation from Ubuntu to something a little less &#8230; user friendly ? Or perhaps that should be a little more Unix geek friendly. The distribution I chose was ArchLinux for a variety of reasons. If you come across this blog entry <a href='https:\/\/really.zonky.org\/?p=1466' class='excerpt-more'>[&#8230;]<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"_share_on_mastodon":"0"},"categories":[4],"tags":[720,485,486,61],"class_list":["post-1466","post","type-post","status-publish","format-standard","hentry","category-it","tag-archlinux","tag-lvm","tag-raid","tag-ubuntu","category-4-id","post-seq-1","post-parity-odd","meta-position-corners","fix"],"share_on_mastodon":{"url":"","error":""},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p1f2KI-nE","_links":{"self":[{"href":"https:\/\/really.zonky.org\/index.php?rest_route=\/wp\/v2\/posts\/1466","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/really.zonky.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/really.zonky.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/really.zonky.org\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/really.zonky.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1466"}],"version-history":[{"count":12,"href":"https:\/\/really.zonky.org\/index.php?rest_route=\/wp\/v2\/posts\/1466\/revisions"}],"predecessor-version":[{"id":1475,"href":"https:\/\/really.zonky.org\/index.php?rest_route=\/wp\/v2\/posts\/1466\/revisions\/1475"}],"wp:attachment":[{"href":"https:\/\/really.zonky.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1466"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/really.zonky.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1466"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/really.zonky.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1466"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}