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!

Apr 272008
 

This entry is about upgrading a machine running Ubuntu 7.10 to Ubuntu 8.04 which is only just out. But not in the standard way which would be quite boring.

I have at least two computers running Ubuntu, both configured in a fairly complex way and both fairly important (in the sense I really don’t need to try an upgrade and end up with a broken system). Whilst Ubuntu frequently does upgrade without a hitch, it can occasionally choke; this is seemingly more common with more complex installations.

Why not preserve an old copy of the install around to revert to ? Well with LVM it is perfectly possible. Ignoring what happens underneath, I have an LVM volume group called “internal” (actually I don’t, but I would if I were to re-install) which has :-

  • var – 4Gbytes to be mounted as /var
  • root – 8Gbytes to be mounted as /
  • home – “enough” to be mounted as /home

Note I do not believe in allocating all available disk space with a storage management system like LVM available; I do a great deal of storage management work and the biggest mistake anyone can make is assuming that they know the storage requirements of a system throughout it’s whole lifetime. This applies in spades to a desktop machine. Without some free space, the suggested upgrade mechanism won’t work.

Now with modern hard disks, we are likely to have more than enough storage to allocate. For instance on this machine right away I have 138Gbytes of free storage (mirrored). And that it is on a two year old machine; a newer machine would have larger disks. Easily enough storage to have two or more “copies” of different versions of Ubuntu around.

It would be nice if Ubuntu could do much of the work for us, but for now it’s pretty much a manual process. As an aside, the Ubuntu developers should probably think about using LVM in the default installer to assist in the development of this kind of feature.

The first stage is to create new logical volumes and build filesystems on them. I chose to name the logical volumes after the operating system version they would be running …

lvcreate -n 804root --size=8G /dev/internal
lvcreate -n 804var --size=4G /dev/internal
mkfs -t xfs /dev/internal/804root
mkfs -t xfs /dev/internal/804var

Now the key here is not to look at the current size of your /var filesystem and decide you need a much smaller filesystem … or the upgrade process will refuse to start. You can always reduce it later if you really want to quibble over 1-2Gbytes.

The next stage is to copy the relevant filesystems across. At this point you should avoid running as much as possible and probably do this from a text terminal after shutting down GDM …

/etc/init.d/gdm stop
apt-get install star
     (If you don't have it installed already)
mount /dev/internal/804var /mnt
star -v -xdev -acl -copy /var/* /mnt
umount /mnt
mount /dev/internal/804root /mnt
star -v -xdev -acl -copy / /mnt

This stage will take some time to complete. You will want to do a quick check of the new / and /var to ensure they look roughly like the originals (I always seem to come up with the equivalent of /var/var when I do something like this). Notice that the new root filesystem is still mounted … you need to edit /mnt/etc/fstab to alter what devices are mounted for / and /var.

The next stage is a bit tricky because I didn’t do it “right”, so I will be suggesting something that I didn’t try myself. The task is to modify /boot/grub/menu.lst in such a way as to result in two separate menu entries that will boot either the old operating environment or the new operating environment.

I would suggest that you :-

  1. Create an entry outside of the “DEBIAN AUTOMAGIC KERNELS LIST” that essentially replicates one of the entries. It should not be modified to boot off the new root filesystem.
  2. Modify all of the entries in the “DEBIAN AUTOMAGIC KERNELS LIST” (it makes sense when you review the menu.lst file) to alter the “root=’ kernel parameter to point to the new root filesystem. This is not the “root (hd0,0)” part, but the kernel parameter “root”. It will specify the old root filesystem logical volume (something like “root=/dev/internal/root”) and you want to change this to “root=/dev/internal/804root”.

At this point you should probably reboot to check that both environments work. Just make sure you have a recent rescue CD knocking around before you do.

After you have done the checking you can boot the new environment and use ‘update-manager’ to upgrade the new environment to Ubuntu 8.04. This will probably work (it worked fine for me).

Undoubtedly the next time I try this, I will figure out how to make it work better, but it is good enough to have a “fallback” option in case an upgrade goes badly. For instance until last week, running Vmware Server under 8.04beta was pretty tricky and if it were still the case I would have to revert back to 7.10.

Apr 282007
 

This is intended to be quite a long piece and may be saved before it is fully completed. Some of the content will be more general ramblings on Linux in general rather than specific to Ubuntu 7.04

I recently installed Ubuntu 7.04 (not without a few problems that most people are unlikely to encounter) and thought it worth rambling through a few thoughts that occurred to me. Most of the ideas are related to how Ubuntu would come across to less experienced users although to be frank I find it difficult to put myself in their shoes. One point to make fairly early is that Linux distributions have conflicting goals … they need to appeal to the less experienced user without putting off the ones who have been running Linux for years, compiling their own kernels and generally getting used to the deeper levels of Linux. One idea here is to have two “sides” to every configuration screen … one for the easy options and one for the advanced options. This does not necessarily need to be implemented as a GUI window that can be turned over, although that is not a bad idea.

I installed using the “alternate” installation CD and did not bother with the “user-friendly” partitioning options, so I can’t say much about the normal installation CD or the partitioning experience. However it is worth noting that partitioning is a somewhat tricky concept to someone new to Linux who has not necessarily done much in the way of partitioning under Windows. Also selecting different filesystem types (ext2, reiserfs, xfs, jfs, etc.) is not something that the average user will be comfortable with.

Mind you Linux installation is not exactly difficult. Those who claim it is, are frequently overlooking just how difficult XP is to install. Either they are already used to it, or have never installed it in the past! Of course installing Linux is trickier than running the Windows that was installed in the factory on the average PC.

Incidentally, whilst I understand that setting up complex partitions and filesystems is inevitably going to take a while, my configuration took as long to setup as the rest of the installation! This is somewhat extreme!

So the ordinary user has managed to work their way through the installation routine and has rebooted the system. They are now faced with a blank screen with just a ‘username’ prompt in the middle. It would be nice here to have a one-off prompt in a seperate window here to explain that the user needs to login with the username and password they created during the installation and a brief explanation of why logging in is a wise mechanism

So the user logs in and is presented with a fairly typical GNOME screen which is quite blank. It would be quite nice to start a “What To Do Now” screen here. The GNOME help feature is quite useful when started, but it should be started for new users. However advanced users may prefer to “turn it over” to get a more complex default index with content that applies more to them. This could be nothing more than a single item on the help screen titled “Advanced Users” to give instructions on how to do it (something like dpk-reconfigure yelp advanced-view) … a command line command here is appropriate to indicate a barrier that should be climbed before it is appropriate to “turn this page over”.

One other thing on a series of documents explaining Linux to new users. It could explain some of the typically installed applications … which ones to use to do what, and where to find them in the menus. It could also explain the reason for the funny names … that many of the applications are created by programmers and named by them, and not to let their sometimes peculiar sense of humour be offputting.

Traditionally Ubuntu has avoided including proprietry codecs for common multimedia formats such as MP3. This is for genuinely legitimate reasons and I am not suggesting this changes, but the help screens should have a number of entries relating to this. “Playing Proprietry Encoded Music And Videos” should point to a help screen saying why these formats are not included by default and simple instructions in installing them. “Why Can’t I Play MP3s” and “Why Can’t I Play DVDs” should give a short explanation and point to the instructions on installing them. By all means make the point that priorietry formats are evil, but be helpful too.

Oh! And don’t lie in help screens. At one point Ubuntu claims that their package manager is the only way to install software. This is obviously not true to advanced users and could eventually be seen as not true to ordinary users too. Just say that it is strongly recommended to install software using the package manager as an obvious mistruth makes one wonder what else is wrong.

Ubuntu comes with a fairly easy way of enabling “desktop effect” with an appropriate warning about their stability. However it only enables compwiz and I wanted to have a quick look at beryl. This was acomplished fairly easily, and I suddenly had access to a great deal more desktop effects. Some very interesting eyecandy it was too, some of which I can see could be quite useful.

However the preferences screen was a little swamped with different configuration options. Whilst beryl is most definitely in an early phase of development, it would be wise to look at this. Not that all of the options should be removed, but going back to a phrase I used earlier, “turning over” the options screen to keep the advanced options hidden from most users should be considered. It also needs far more explanation of what all the options are. Perhaps a button to “grow” a simple explanation into a longer more detailed explanation.

What if things go wrong and the new user needs assistence ? Well there are two parts to this … problems during the installation that results in a system that cannot be booted, and problems that crop up after installation.

For the second, there needs to be a section in the help screens on obtaining assistence. This should assistence in obtaining information about the broken system (perhaps Linux needs a tool like “Sun Explorer” which generates a compressed archive containing the output of many different diagnostic commands such as fdisk -l, cat /proc/cpuinfo, etc). Also explaining how best to phrase support requests … anyone who has done technical support knows the problems that can come about because of badly expressed problem issues.

Ubuntu helpfully has pointers to sources for free online support, and to commercially available support. However it would be useful pointing out the basic difference between the two … free support can be of as high a quality as commercial support, but you cannot be certain of getting a response. Whereas commercial support has the downside that it costs money.

Finally (well … if you are lucky 🙂 ), Ubuntu comes with a fine graphical package manager called Synaptic; whilst as a crusty old Unix veteran I prefer the command-line equivalent, it does do a pretty good job. However a new user looking at Synaptic could be a little overwhelmed by the number of packages that are available. Synaptic has a series of ways of viewing the package repositories which can be helpful in finding what you want; why not add an additional default view (with a prominent button saying “See the rest”) that has just one (well perhaps up to five) “best of breed” package listed for each application.

A new user is less likely to be overwhelmed when installing software if they visit the package manager and see “3D Modeler” -> “Blender” instead of the current situation where “Blender” itself consists of half a dozen packages that they need to hunt through several hundred applications to find.