Nov 202010
 

For some time now, I have been contemplating switching Linux distributions on my main workstation from Ubuntu to something a little less … 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 looking for a solution to a problem, it may be worth reading through in case the solution appears later on – this is long, and searches may “hit” on something later on.

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 Enlightenment – it seems that Ubuntu is really intended for those who want the Ubuntu way.

Nothing wrong with that, and I’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’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.

The Install

I downloaded the core install image rather than the net install image – 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 – I should really get a 2.5->3.5″ 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’s workable if you are prepared to juggle disk names (both Linux ones and BIOS/Grub ones).

First for the boring bit :-

  1. Booted off the install CD
  2. Selected CD as source
  3. Set Europe/London as timezone
  4. Set hwclock as UTC
  5. Prep hard drives-
    1. Manually configure hard drives
    2. Partition /dev/sdc (the SSD – identified by the fact it was empty)
    3. Created 256Mb partition /dev/sdc1 (for /boot)
    4. Created partition with the rest of the space /dev/sdc2 as LVM
    5. Manually configure block devices
      1. By device name
      2. Created /boot on /dev/sdc1 as ext2
      3. /dev/sdc2 becomes Volume Group
      4. / as XFS (16G)
      5. /var as ResierFSS (4G)
      6. swap (4G) – Although I have a tendency to forget this one!
      7. /opt as XFS (4G)
      8. /tmp as ReiserFS (4G) – perhaps a bit too big.
  6. Select Packages
    1. Select Base + Development.
    2. Pick random additions that look like they might be useful (note that it may be necessary to pick all of the various mkinitcpio variations as I did that on the later attempts).
  7. Install Packages
  8. Configure System
    1. Select ‘vi’ as editor
    2. Made the following changes to rc.conf
      1. UseLVM=yes
      2. HOSTNAME=scrofula
      3. eth0=”eth0 10.0.0.18 netmask 255.255.0.0 broadcast 10.0.255.255′
      4. gateway=”default gw 10.0.0.254″
      5. ROUTES=(gateway)
    3. Made the following changes to mkinitcpio.conf
      1. BINARIES=”/sbin/lvm”. This shouldn’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’t see what was wrong! This error could be related to the raid problems detailed below, but adding this won’t cause any harm.
      2. HOOKS=”base udev autodetect scsi sata lvm2 filesystems”. Note that “raid” is suggested as necessary for software RAID; that turns out to be incorrect as discovered later. Although I needed software RAID to mount my /home, I left that for later after putting raid in here gave errors)
    4. Made the following changes to resolv.conf
      1. search inside.zonky.org
      2. nameserver 10.0.0.12
    5. Made the following changes to mirrorlist
      1. Select something from “Great Britain”.
    6. Set root password.
    7. Done
  9. Install Bootloader
    1. Grub
    2. Installed to /dev/sdc! This is because although the SSD is the third by address, it is also the first boot device in the BIOS.

This didn’t work the first time around. Firstly grub wasn’t setup properly as it wanted to boot the next stage from (hd2,0) 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 permanent basis by editing /boot/grub/menu.lst.

Secondly the first couple of times around, I found myself in what I term the “miniroot shell” 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’t mount the root filesystem, and b) the binary /bin/lvm was not present. On the third or fourth attempt (my notes aren’t sufficiently accurate) I managed to get past this stage by excluding the raid “hook” and including the /bin/lvm binary in the mkinitcpio configuration file.

It would seem that at some point ArchLinux has changed the “hook” name from raid to dmraid and some instructions out there still refer to the hook as “raid”. My fault for not checking closely enough with enough sources! But there’s no harm in the ArchLinux people configuring both names – probably just a case of setting up a hard link somewhere!

Post-Installation

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!

The first thing to so after a core install (and probably a net install too) is to perform a full update :-

pacman -Suy

The “pacman” 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 – 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.

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.

In any case, I needed to run the command twice as pacman itself needed an upgrade.

After doing that, I set CONSOLEFONT in /etc/rc.conf to “sun12x22.psfu” 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. Later I used the “consolefont” hook to set the console font at an earlier stage during the boot process – which is neater; however you should specify the font without the file extension – “sun12x22”, and of course add “consolefont” to the HOOKS variable in /etc/mkinitcpio.conf.

I also edited /boot/grub/menu.lst to change the line that specifies what kernel to load and it’s options :-

kernel /vmlinuz26 root=/dev/mapper/ssd-root ro vga=775

Specifically adding the “vga=775″ to the end of that. This makes the appearance of the console not quite so overwhelming on a 30” monitor!

Also added “dmraid” to the HOOKS variable in /etc/mkinitcpio.conf although reading more documentation hints that the right hook is actually “mdadm”. Run mkinitcpio -p kernel26 to update things.

Rebooted to verify that things are still working. Plus check that the CONSOLEFONT was ok, and that the old volume group:sys was visible.

Nov 022009
 

So I quickly install the CD in a virtual machine, login, get delayed by doing something with a passphrase, install the “guest additions”, and reboot. But why doesn’t Ubuntu include the drivers for various different virtual machine environments ? It would certainly make it easier to quickly setup a machine to test the feasibility of switching or upgrading.

One tiny little niggle with the first boot – the passphrase request to “unlock” the encrypted drive (I wanted to say “unencrypt” there but of course it doesn’t actually do that) is a little less than obvious. It should perhaps be a little more “in your face” – a popup. And of course the new Ubuntu boot straight into X might look a little prettier than the previous mechanism, but it isn’t quite “geeky” enough for me (my OSX machines are set to boot in verbose mode to scare those who think the command line is scary). This new startup is supposedly significantly quicker than previous releases; I’m afraid I didn’t notice. Perhaps it is of concern more to others than to me, but I rarely restart my machines – my somewhat less than totally reliable main machine has been up for 7 days, so a faster boot time is not of great significance to me.

I couldn’t seem to find anything to tweak the desktop effects settings. Perhaps not that important, but sort of peculiar. I dare say there’s an addon to do that.

I next dove into “Software Centre” to find a couple of applications that I use, but couldn’t. Admittedly they are somewhat towards the geeky side of things, but they are not that unpopular (zsh and enlightenment). Dropping to a terminal window and they were quickly found using apt-cache. Perhaps the Software Centre intentionally hides things to make the default list of new application choices a little less scary ? Maybe, but it needs an easily found button to say “show more”. Of course the Synaptic package manager can still be found, so this isn’t a real problem although having two ways of installing/removing software could be.

After I installed my favourite window manager (Enlightenment for now), I went on to try setting it up in my usual way with a .xsession file. No luck! It seems that Ubuntu’s version of gdm has accidentally (?) removed this functionality. This is quite a serious problem for those who like to run seriously customised environments. Perhaps not Ubuntu’s major audience, but it seems rather unfortunate to remove this functionality as it will seriously annoy those like me who prefer their own environment.

Going back to the default environment, I take a quick look at Firefox to realise that there is no Flash plugin. A dive into the Software Centre fixes that, although it would have been nice to be taken through a “wizard” when starting Firefox for the first time to suggest installing a number of proprietary extensions (and explain why they are not installed by default). Not that it does not install with a good selection already, but a browser without flash is perhaps not what people are expecting (although there are advantages in not having flash or turning it on only for those pages you want it turned on for).

Browsing through the settings, and I find the theme browser which does not really offer much choice by default – you have to install some additional themes. The choice of backgrounds is fine, although I’m not too sure why the frog was included (I chose the falling coffee). The most obvious improvement here, would be to include a hint on how to include your own photos as a background – quite possibly the first thing that many want to do! At least the Font tab defaults to using a method of rendering suitable for LCD panels (I’m not sure if this is new with the Koala).

In the keyboard preferences, the Layout options are somewhat confusing. Admittedly the number of options here is bound to make it more confusing, and those who choose “Layout Options” are likely to be self-educated to some degree. However it may be worth looking again at how the options are described. Oddly enough the Mouse preferences shows an option to “Show mouse pointer position when Control is pressed” but does not allow you to enable it!

Going through the applications, most (without extensive testing) seem fine. However Empathy (the replacement for the Pidgin instant messaging client) does seem a little on the flaky side with a few “misfeatures” – for instance the “Room” dialog box is a little immature and it is not obvious what you should do with it. Are you supposed to know some sort of “server name” ? Seems a little odd.

This may get added to when I find the time and patience to do more, but I am sure there are plenty of other far more complete looks at Ubuntu 9.10 out there!

Apr 162009
 

Unfortunately I have to run Microsoft Office 2007 for work purposes. No criticisms please! I have tried OpenOffice 3.x and it is just a little too disruptive to the documents in question (although part of the fault may be sub-optimal document templates). Personally I would much rather use LyX which is little feature light, but absolutely brilliant for pure writing.

Anyway, when I first tried running Microsoft Office with WINE, I couldn’t get past the installer and I had to come up with the following recipe for getting it installed.

First of all, remove all traces of wine from your system (I’ll be assuming Ubuntu 8.10 which is what I’m running) :-

sudo apt-get --purge remove wine wine-dev
rm -rf ~/.wine

Note that I am removing the old ~/.wine directory which you may choose to keep if you wish (you may have installed something else after all!). However this document assumes that you are only installing Office and may not work if other software is also installed.

The next step is to download the right version of wine from WineHQ. Unfortunately the latest version of wine isn’t compatible with the installer. The version I tried (after reading numerous problem reports) was 1.1.16. The archive page can be found here.

After downloading, install manually with :-

sudo dpkg -i wine_1.1.16\~winehq0\~ubuntu\~8.10-0ubuntu1_amd64.deb

After this has been installed, you can mount the Office 2007 CD and start the installer. Incidentally it is well worth creating an image file from the real CD if you are going to be spending any time tinkering with this – which is why I’m using a CD image!

sudo mount -oloop,unhide /cdimages/office2007.iso /mnt
wine /mnt/setup.exe

The installation process should be fairly straight forward although you will need to ignore a few warnings about being unable to obtain some updates.

Once this has finished you can run Word with :-

wine ~/.wine/drive_c//Program\ Files/Microsoft\ Office/Office12/WINWORD.EXE

Enjoy!?!

No guarantees that everything works properly of course, but it is a start.

At this point it may well be worth taking a backup copy of the wine directory with the installation of Office 2007. This can be done quite easily with :-

cd
tar cvf ~/wine-drive-c-with-office.tar .wine
bzip2 ~/wine-drive-c-with-office.tar

If you no longer need to run the installer, it may well be worth removing wine again to install a later version of Wine. This can be done by repeating the first step (but not removing the .wine directory) and downloading a different version of wine from the archive page as given.

Feb 262009
 

Yes I know everyone and their dog has already written a review of the Intel iMac, but I have not done so yet. This is a review of the 24″ iMac (and I’m already hating that incorrect capitalisation) with the specific intent of putting Ubuntu on. This is not some kind of weird anti-OSX statement; I already have a laptop with OSX installed on it and it does seem like a fun operating system.

But this is a replacement for my main desktop, and I really want a “proper” Unix on it, and Linux will do in the meantime.

First Thoughts

First of all, the screen stand should allow adjustment in the vertical direction; already I can see myself getting out an extremely old and manky tape drive to sit underneath to raise the screen to an appropriate height. Apple ? Your lack of foresight in not including height adjustment is ruining the look of the system!

Nice keyboard! If you do not type much. I am aware that some people really like the skinny Apple keyboards, but it is not for me even though they got off to a good start by not including Windows keys. Back to the Das Keyboard for me I think. The mouse is similar – there’s this nice funky ball on top which is an improvement over the usual scroll wheel (although I am not too sure how well it would work at speed), but just not enough buttons.  Or at least it does not feel like enough buttons. The “one button” with two effects method as appears to be the case here is a little odd and off-putting.

Perhaps Apple needs a special country kit – “Special Clicky Keyboard And Mouse With Too Many Buttons For The Unix Geeks”. How many people end up using a non-Apple keyboard and mouse ? Perhaps not many, but why not cater to them with alternative keyboards and mice ? My Apple keyboard and mouse will be mostly unused.

Where are the memory card slots though ?  It would make things a bit more complete (and the iMac is about one box doing everything) if there were a sensible selection of memory card slots.

In terms of software (and not OSX itself), one thing becomes immediately apparent when booting (and on previous occasions when trying to boot from CD, diagnosing booting problems, etc.). The Apple firmware breaks the first rule of user interface design! Not something you expect Apple to do.

The firmware needs to be just a little bit more expressive about what is going on. You may well be thinking that as a hardcore Unix geek I want to see inscrutable messages from the firmware about initialising that chipset, addresses of where adapter cards are, cpu values, etc. And of course you are right.

But basic messages about starting the hardware would still be helpful.

More importantly however, the Apple firmware should be letting you know what keystrokes are needed to do “unusual” things like boot from a CD, an external hard disk, start the hardware diagnostics, etc. One of the most irritating things about Apple hardware is the need to provide secret incantations to boot from CD  – you hold the “C” key down for “a while” (how long anyway?).

The Install

At this point the “unusual” choices of Apple bite you when it comes to installing a version of Linux intended for use on mainstream PCs. First you have to install rEFIt, then you install Linux off CD (and mess around with the MBR partition table), then have to remember to “resync” the partition tables.

Seems there’s an EFI partition table and an MBR partition table that need keeping in sync. Having two partition tables immediately strikes me as a dumb idea. When Windows is involved, there is probably no fix for this problem, but why is Linux still not doing things properly ? Or at least not doing the sensible thing by default.

It also means there is effectively a two step boot process – first rEFIt starts, then then starts grub which finally starts Linux; this is not a quick system to boot.

Fixing The Niggles

In any install, there are always little niggles that need fixing. The most obvious is a way to control the brightness of the screen which by default is far too bright. There may well be better solutions out there, but a bit of C coming from http://www.felipe-alfaro.org/blog/2006/09/11/basic-backlight-support-for-macbook-pro

A quick compile and install in /opt/bin/bl and root can set the backlight brightness with :-

bl (1-15)

Adding this in an appropriate way to /etc/rc.local ensures that the backlight is set on every boot.

It also appears that we need to do a bit of hacking to support the sound properly. Adding an option to /etc/modprobe.d/options specifies the “model” of soundcard we are using to get sound working :-

options snd-hda-intel model=imac24

A quick reboot and sound is working (microphone not tested!).

For some reason the module that is used to gain access to the iMac temperature probes is not loaded automatically. Adding applesmc to the end of /etc/modules gets this loaded (after a reboot or manually with modprobe applesmc). Unfortunately there does not appear to be an immediately obvious way of using this except from the command line.

The wireless network controller apparently works after the addition of the proprietary driver that shows up after doing an update. Admittedly I cannot say for sure because I use a wired setup.

Lastly the IR receiver. I will admit this has currently defeated me although that is partially because I am not that interested. I will of course update this if I get it to work.

Later: Screen Calibration

I later took a look at setting up the screen properly. Proper controls for the screen would have been nice, but configuring from the system turns out to be relatively easy.

First of all I used the OSX screen calibration tool in “expert” mode to generate in ICC file containing the screen profile. Doing this may well be possible inside Ubuntu; I just happened to know where the tool was in OSX.

I then installed xcalib :-

apt-get install xcalib

This could be used to set the monitor profile from the earlier generated ICC file.

Conclusion

It works. After a week or so using it, I am no longer thinking of the iMac as a system being installed and tested but as my standard desktop.

Nov 082008
 

Well I decided it was time to upgrade my main workstation to Ubuntu 8.10 from 8.04. This was a somewhat nervous upgrade because the SATA disks are connected to a controller that gives me trouble when booting … the last few times I rebooted the machine I have had to re-assemble one of the mirrors at the “miniroot” (the shell you get from the initrd environment).

Given the trouble I wanted the option to revert back to the current install if everything went wrong … something I have described in the past.

Environment

I have four SATA disks in my main workstation that are mirrored and encapsulated into a single volume group with numerous logical volumes. So /dev/md0 is constructed of a mirror of /dev/sda2 and /dev/sdb2 and /dev/md1 is constructed of a mirror of /dev/sdc1 and /dev/sdd1. /dev/sda1 is used as /boot and /dev/sdb1 is “spare”.

The volume group datavg has two “physical disks” in it – /dev/md0 and /dev/md1. In that volume group are (amongst others) two logical volumes of interest – 804root and 804var.

Preparation

First I ensured that /dev/sdb1 contained an up to date copy of /boot :-

mkfs -t ext2 /dev/sdb1
mount /dev/sdb1 /mnt
star -copy /boot /mnt
umount /mnt

The next step was to create two new logical volumes to be used (eventually) for the new release of Ubuntu :-

lvcreate --size 12G -name 810root /dev/datavg
lvcreate --size 3G --name 810var /dev/datavg
mkfs -t xfs /dev/datavg/810root
mkfs -t xfs /dev/datavg/810var

The next step was to copy the filesystems across – at this point no further non-upgrade activity took place :-

mount /dev/datavg/810var /mnt
star -copy -xdev /var /mnt
mount /dev/datavg/810root /mnt
star -copy -xdev / /mnt
(edited /mnt/etc/fstab to change references to 804 to 810)
umount /mnt

At this point the remaining task (or so I thought) was to change the references in /boot/grub/menu.lst so that Grub would boot the kernel with 810root as the root filesystem.

I then rebooted to check the functionality and discovered that for some reason /var/run/network had not been created on the new /var but that seemed to be the only issue. I re-created this directory and rebooted to be sure (and Linux without a loopback device behaves very strangely!).

I then in theory had an environment I could revert to with a bit of fiddling with grub so was happy to attempt the upgrade.

The Upgrade Itself

I then started the upgrade (sudo update-manager -d) only to be told I did not have enough disk space with the suggestion that I run sudo apt-get clean to free up enough space. I tried this and the update started on the next time through. Why doesn’t the upgrade process automatically run apt-get clean ? In fact why doesn’t the upgrade process realise that it is on a system with LVM available (with plenty of free space) and create a new LVM especially for the upgrade files ?

Anyway the second attempt to run update-manager did start downloading files so I settled down for a well earned beer.

After the files had downloaded the actual upgrade process began. At some point the process stopped whilst a certain upgtade (libpam) asked whether it should restart certain services (including gdm which is the graphical login). Unfortunately it did not explain clearly what it was doing, why, or even if restarting gdm would terminate the current X session. Perhaps it is something that would only “worry” someone with a dangerous amount of knowledge, but perhaps the prompt could be improved slightly.

As a later example of how it should be done, the dialog warning about changing the ssl certificate was ideal … basically saying “if this doesn’t mean much to you, don’t worry about it”.

The use of dialogs during the upgrade does raise a couple of issues though :-

  1. Apparently not “stopping the clock” whilst waiting for the user to respond to dialogs caused the estimate of how long the upgrade would take place to increase dramatically. Just after dealing with that libpam prompt I was slightly alarmed by the estimate of 6 further hours to complete (as it was already 21:30) only to be reassured by the rapid drop to 2 hours.
  2. From a users perspective it would be preferable to ask all questions at the beginning or at the end of a long process. Keeping an eye on the upgrade whilst it was churning through the bulk of the upgrade (which took place without user intervention) was somewhat tedious.

The unfortunate thing was that at this point, the upgrade process ran out of space. It also left my machine in an unbootable state … from what little investigation I made it would appear that the initrd file was not created. Perhaps because of the lack of space, but others have also encountered this problem.

Obviously the Ubuntu upgrade process should be a little more careful about estimating the amount of space available. It would also be nice if it would notice that it was installed on an LVMed system with free space available … it could create a new LVM of an appropriate size and use that.

Recovery

Fortunately my preparation left me with a root filesystem that I could revert to by selecting one of the older kernels in the grub menu, editing the command used to boot, and by replacing the root filesystem with “804root”. This resulted in a system almost identical to that before the upgrade process.

I re-tried the “Preparation” stage, ensuring that /var was a little bigger and restarted the upgrade process …

Upgrading (The Second Attempt)

The second upgrade went through pretty much the same process as the first … except that it did not run out of disk space. This let it complete apparently normally with a warning about removing several hundred packages (!).

Finally it suggested rebooting to finish the upgrade.

The First Boot

The first boot was a triffle problematic … firstly I still had to manually assemble /dev/md0 and the process that built /boot/grub/menu.lst hadn’t noticed that an invalid root filesystem was specified. Whilst the later was my fault, it would be nice if it had realised that it was invalid and had warned me. The former is a long standing problem and is not the result of the upgrade.

Apart from that, the standard user interface looked ok, but it had messed around with the Enlightenment window manager. I had to re-install the package, my settings and menus had disappeared. Whilst I am an “unusual” user in not using the standard user interface, this was not something I was happy with!

WP2Social Auto Publish Powered By : XYZScripts.com