Thursday 3 July 2008

Ticking Dell Laptop - its a power saving thing

My Dell Vostro 1700 laptop ticks like a noisy old clock. It ticks roughly every 30 seconds when on mains power but more than once a second when on battery. Its loud enough to be very irritating to other people in a quiet room (as several people have pointed out to me). Its been there since I got the machine and is the same under Vista and Ubuntu. Its not a normal working disk noise that you might hear on any make of laptop. Its like the noise of a floppy having its cover opened or like the insistent ticking of an old clock or watch. The ticks are in time with the disk activity light which flashes briefly on each tick.

As it happens the drive that came with my laptop has errors; after a couple of weeks it developed bad sectors that wiped the Vista install out. But I'm pretty confident that its not the noise of a drive dying.

There's quite a lot of people posting the same problem and asking if their disks are damaged and about to fail, but the consensus is that they are not and its the way the machine is handling the drive as part of its power saving settings. This fits in with the fact that the noise is frequent when I'm running on battery power.

Suggestions for solutions are:
  • use hdparm to change the power saving parameters for the drive. This should stop the ticking but will reduce the great battery life of the machine (i'm getting just under 4 hours surfing on this Vistro with its 8 cell battery).
  • consider installing Powertop to see what is spinning the disks. (There may not be much you can do about it though unless you are willing to download patches for the programs you use).
This thread on ideastorm explains the problem and suggesting hdparm. Hdparm is already part of your ubuntu distribution (and presumably on many other linuxes as well). Theres also a Windows port of hdparm that the people on the 'clicking Dell' threads report works and takes the same arguments.

The hdparm argument we are interested in is -B. Man hdparm tells us:
-B Set Advanced Power Management feature, if the drive supports it.

A low value means aggressive power management and a high value means better performance.

Possible settings range from values 1 through 127 (which permit spin-down), and values 128 through 254 (which do not permit spin-down). The highest degree of power management is attained with a setting of 1, and the highest I/O performance with a setting of 254.

A value of 255 tells hdparm to disable Advanced Power Management altogether on the drive (not all drives support disabling it, but most do).
Everything that follows assume you have a hard drive called sda.

To find out what your drive(s) are called open a terminal and type:
sudo fdisk -l
For me this gives:
Disk /dev/sda: 160.0 GB, 160041885696 bytes
and then lots of other info listing the partitions. But the key point is my drive is indeed /dev/sda

I cant find any way of seeing what the power saving settings are for the drive. You can get some info with sudo hdparam -i /dev/sda but its not enough. Among other info I get told it has AdvancedPM=yes: unknown setting which is great but not very helpful.
To see if altering the power settings changes the ticking noise type:
sudo hdparm.exe -B 254 /dev/sda
this sets the disk to some minimal power saving with no parking. The clicking should stop instantly. It does for me and others report the same.

Setting to anything smaller than 254 does nothing to reduce the rate of clicks.

The implication of the original thread is that you should set the disk back to 128 as soon as you can bear to hear the clicks again because its safer as it allows the OS to park the disk. Not what I would have understood from the man page; I would have assumed a number below 128 was needed.

The original poster also believed that the value would reset to the default 128 on the next reboot and hence start ticking again. This is not what my machine does. So I assume that what you set with hdparm survives a reboot making it more important to set the value back when you have finished.

edit: Correction to the above. The settings do revert after the machine is shutdown and then booted back up. But they didn't reset after a simple restart.

Thursday 29 May 2008

Why Firefox is more that just the browser

As I commented in the last post, I could not see any reason why the new Ubuntu version would use the new Firefox beta.

I've since read peoples suggestions that it was a good decisions because Ubuntu 8.04 will be supported for several years because its a long term support (LTS) version. This means they will support it for three years, and it will be two years before the next LTS release. Over that period of time Firefox 3 which is currently a beta will be the main release and Firefox 2 will disappear. So it makes sense to include v3 not v2 in the new Ubunutu release.

This is a reasonable argument. And I have to say that Firefox 3 appeared finished and stable even if its still a beta.

However this ignores the fact that addons mean that Firefox is more than just a browser in a way thats not true of say Internet Explorer (because their addon market is less mature and crucially its mostly commercial whereas the Firefox market is mostly free). The fact that there is a healthy use of addons in the tech savvy Firefox user base, and that this is going to be even more widespread in the even more tech savvy Ubuntu/Firefox user base, means that the maturity of these addons are almost as important as the browser itself. If you upgrade the browser and this breaks the addons this effectively breaks browser for a large number of users.

I think the Ubuntu decision to include the beta browser is wrong for this reason. They have forgotten that Firefox is more than just the browser, its now a platform of sorts and you cant upgrade a platform until the stuff that runs on it is broadly ready.

Monday 26 May 2008

Ubuntu 8.04: Downgrading Firefox and Enabling Extensions

Using Ubuntu had been a painless experience until I upgraded to 8.04 (codenamed: hardy). This new version uses Firefox v3 rather than v2 which is a strange decision by Ubuntu in my opinion. Firefox 3 itself is working fine but I think they forgot that a lot of firefox users use add-ons (also known as extensions). Just because Firefox 3 is working well does not mean add-on authors have updated these extensions yet.

Most of mine stopped working and resisted my efforts to get them going again. I uninstalled firefox 3 and installed v2 thinking this would solve the problem. But, although I could click the enable button on each add-on it did not actually enable it. Then I read Firefox extensions errors - Howto fix. The solution is to remove the extensions.rdf file. Its as simple as that.

WARNING: other people have posted that removing firefox 3 and then installing version 2 will drop all the extensions. All I can say is it worked for me.

And please don't do as some have suggested and delete your entire profile and configuration with rm -rf ~/.mozilla

Anyway here's what I did:

Remove Firefox 3
  • Start the package manager (menu > System > Administration > Synaptic Package Manager)
  • Search for 'firefox'.
  • Mark the old firefox for uninstall. I removed: firefox, firefox-3.0, firefox-3.0-gnome-support and ubufox. Apply those changes.
  • At this point I also removed the shortcut I has on my ubuntu shortcut bar which had just turned from a firefox icon into a black box that did nothing. I right clicked on it and chose Remove From Panel.
Install Firefox 2
  • Return to the package manager and mark firefox 2 for installation. I marked: firefox-2, firefox-2-gnome-support, firefox-2-dom-inspector and ubufox.
  • Including the packages already installed the full list is: firefox-2, firefox-2-dom-inspector, firefox-2-gnome-support, firefox-themes-ubuntu, flashplugin-nonfree, libmozjs0d, libxul0d, libxul-common, mozilla-firefox-locale-en-gb, mozill-plugin-vlc, openoffice.org, totem-mozilla, ubufox, xulrunner-1.9. Some of them are not essential and others not relevant, but thats what the search for 'firefox' shows.
  • I did NOT mark firefox, thats the version 3 install thats now the standard in ubuntu 8.04.
  • Apply the changes.
  • Open a terminal and run firefox by typing firefox-2.
  • Firefox should open and Help > About should confirm its version 2. However the addons still wont be enabled.
  • Close firefox.
Reregister the extensions to enable them
  • Go to /home//.mozilla/firefox and rename extensions.rdf to something like extensions.rdf-old (you could delete it but this way is a bit safer - just in case).
  • Restart firefox. It will re-register all its addons.
  • Firefox appeared with all the plugins back including the buttons I had placed on my toolsbars.
Phew!

Add Launch Icon
You might want to add a launch icon to the Ubuntu desktop toolbar.
  • Right click on the toolbar and select Add To Panel.
  • Pick Custom Application Launcher, the command should be firefox-2.
You should now have a firefox icon on the desktop toolbar.


Wednesday 23 April 2008

Cleaning Your Drive

I had a disk failure on the drive of my shiny new Dell 1700 which wiped out the Vista partition. Now I'm only running with Ubuntu (which is working well - thanks for asking). The drive is going to have to be replaced so I'm searching for info on cleaning the drive.

Of course, with physical errors on the drive I'm expecting most utilities to fail; but we'll see.


I've downloaded Darik's Boot-and-Nuke and burnt it to a CD. It allows you to create a bootable floppy, USB device or CD then boot from it to run a utility that will securely erase your drives.

I downloaded the iso image then wrote it to a CD using
> cdrecord dban-1.0.7_i386.iso

It was easier than I expected, cdrecord just worked - another tick for ubuntu.

Since DBAN can be used from a bootable device it will fine work from any OS, which is nice.


DBAN will be my second line of attack. Since I'm running Linux I intend to start with Secure-Delete.

Installation and use are described in this summary Howto Delete Files Permanently and Securely in Linux.


I can't run them yet. First I need to add another drive so I have a working machine when the duff drive is taken out. Then we will see.