Steve’s Ubuntu Weblog

Mainly (but not only) about Ubuntu

How to find out your Ubuntu release

If you’ve forgotten what version you’re using :-) type the following in a terminal:

lsb_release -a

The following information will be revealed:

Distributor ID: Ubuntu
Description: Ubuntu 7.10
Release: 7.10
Codename: gutsy

22 November, 2007 Posted by steveyoung | Ubuntu | | No Comments Yet

Ubuntu. Simple backup that works.

UPDATE 10.08.2009, please read comment at foot of this post

Having recently been let down by mondorestore in Gutsy (see below) I have been researching a new backup strategy. I didn’t want to again leave myself trusting in a tool which lets you down when you really need it, so the stategy had to use readily available and trustworthy software. The solution I have decided upon and tested by doing a complete restore is as follows:

Backing up.
Firstly you need to copy your home directory using sudo grsync (preserve time, owner, permissions and group) or

sudo rsync -r -t -p -o -g -v --progress -l /home/ /media/disk/home/

Keep a copy of this somewhere so that you can find it when your system dies ie on an external drive. Sync it regularly, rsync will only update changes to the original so after the first copy has been made, updates usually only require a few seconds.

Then make a list of all of the packages in your installation using the command

sudo dpkg --get-selections | grep '[[:space:]]install$' | \awk '{print $1}' > package_list

Copy this file together with /etc/apt/sources.list to the same medium you have used for your /home/ directory backup.

You could initiate a cron job to keep this list up-to-date using by putting the following script in /etc/cron/dailypackage_list and making it executable.

#!/bin/sh
sudo dpkg --get-selections | grep '[[:space:]]install$' | \awk '{print $1}' > package_list

Restoring.
First boot the live cd and install Ubuntu.

After Ubuntu has rebooted to the HD version set up your restricted drivers for your graphics card if applicable, there is no need to reboot yet. Then replace the existing sources list with the one from your lost system. assuming that it is on an external disk (together with the /home/ directory) you would use

sudo mv /media/disk/sources.list /etc/apt/sources.list
sudo apt-get update

Then update the packages using:

cat /media/disc/package.list | xargs sudo apt-get install

If you are using some unauthorized packages you will get the following warning

“WARNING: The following packages cannot be authenticated!
libxxx libxx libx xxxplayer
skype-common skype xxxcodecs
Install these packages without verification [y/N]? E: Some packages could not be authenticated”

for some reason you cannot answer yes or no to this, it’s a bug. So simply install all of these packages using

sudo apt-get install libxxx libxx libx xxxplayer skype-common skype xxxcodecs

When that has completed run

cat /media/disc/package.list | xargs sudo apt-get install

again and this time it should complete without problems.

Now copy your /home directory to the new system using sudo grsync (preserve time, owner, permissions and group) or

sudo rsync -r -t -p -o -g -v --progress -l /media/disk/home/ /home/

That’s it! You need to reboot and your system should be exactly as it was. I have tested this three times without problems.

UPDATE 10.08.2009
The method of building and restoring a list of installed packages described above no longer works. Instead to build the list use:
sudo dpkg --get-selections > package.list
To restore the packages use:
sudo dpkg --set-selections < package.list
sudo apt-get dselect-upgrade

19 November, 2007 Posted by steveyoung | Ubuntu | , | 17 Comments

Microwave link engineering with Google Maps

My webtool calculates the distance and bearing between two markers. It also calculates the Rx level, Fade margin, FSL and unavailability of a link between these two markers in % and minutes/year. Furthermore if you give a required availability it will calculate the maximum link length you can achieve using given parameters and shows this graphically on the map.

You can try out my webtool at http://members.chello.at/stephen.joung/indexMW_Distance20.html Here is a short description of how to use the webtool.

You can zoom in and out with your mousewheel or by using the control in the left top corner. You move the map about by clicking with the left mousebutton and holding the button down while you drag the map.

You can enter markers three ways:

  1. By clicking on the map where you would like to place a marker
  2. By entering coordinates in the boxes provided above the map.
  3. By entering an address in the box provided above the map. The resulting marker can then be dragged to the exact location required

The coordinates of the markers are then seen in DMS and Decimal degrees to the right of the map. Also the bearing from A-B and from B-A and the distance between the two markers can be seen. You can input Tx level, Rx Threshold, freq, polarization etc and the tool calculates the Rx level, Fade margin, FSL and unavailability of the link in % and minutes/year. You can change the parameters, ie Tx level or freq and the availability etc are automatically recalculated.

Toward the bottom of the form there is a box to input a required availability after you have done this you can press enter and the tool will calculate the max link length you can achieve with this availability and the freq, polarization, Tx level etc that you have chosen. Change any of the parameters and/or the availability required and the new max link length is automatically calculated. Click on either of the markers and the max link length is shown as a circle around the marker. Recalculate the link length with new parameters, ie horizontal polarization, new freq, Tx power etc and click on the marker again and a new circle is drawn representing the new link length. Click on any circle and info about this circle is given in a window. There is no limit to the amount of circles you can draw.

A new feature is dragable marker-B. Click on marker-B and the marker becomes dragable, drag it to a new location and release the button and all calculations are re-calculated for the new B location.

Any suggestions for improvement will be welcome.

19 November, 2007 Posted by steveyoung | Gmaps | , , , , , , , , , , , , , , | 32 Comments

Re-install Grub in MBR

All the problems I have had recently meant that the MBR also got corrupted and therefore Grub hung. I fixed it by booting from a live CD and opening a terminal. Then typing:
sudo grub This will give you a grub prompt
grub> find /boot/grub/stage1
grub> root (hd0,0) or whichever partition has the grub files, here first partition on first drive.
grub> setup (hd0)
grub> quit (hd0)

That’s it, Grub will be installed on the first hard drive.

17 November, 2007 Posted by steveyoung | Ubuntu | | No Comments Yet

Mondorescue is broken in Ubuntu

Mondo doesn’t work with Gutsy. Compare will tell you you have a good dvd but when you need to use it it will fail!

I have tried the suggestions here and downloaded the versions of Mondo and Mindi directly from the Mondorescue website, but there is then another issue preventing Mondorestore from working. With the versions downloaded from the Mondorescue website when I boot the dvd and choose nuke I get a “Kernel panic – not syncing. Attempted to kill init!”. Compare however shows the dvd as good.

I have now lost my system because of the original problem and by checking the Mondorescue dvds by trying a restore I have discovered that there are other issues preventing a restore of the data even though the compare function shows the dvds as good.

So after nearly nine years of using Mondo it’s goodbye.

I will decide on a new backup strategy and post here when I find a solution that works for me.

17 November, 2007 Posted by steveyoung | Ubuntu | | No Comments Yet

Mondorescue: from invaluable tool to piece of crap

I have used Mondo for almost nine years and up until recently it never let me down. Many times over the years I have restored my system using Mondo and in fact the reason I stopped using SuSE linux was when I couldn’t get Mondo to run because they messed with some dependent libs. I now use Ubuntu but still regularly backup my system with Mondo and always check the DVD using compare. Now I have had my first real problem with Ubuntu and thought, well I will just restore my latest Mondo backup. Remember these backups had been compared successfully. What happened was that nuke wouldn’t work at all, Mondo reported that sdb was missing or that there were gaps between sda1 and sda5 or other warnings depending on whether I partitioned the disc or whatever. So I tried interactive mode, something that I didn’t usually find necessary before. After I edited the mountlist Mondo partitioned and formatted the drive and then reassembled the large files. When it had done that it quit informing me that grub hadn’t been installed and “you will now edit fstab and grub.conf”. I was then left in an editor with an empty page.

I used a live CD to mount the disc and found out that only a very small amount of data had been restored, most folders were empty even though the had been included in the backup command.

How long Mondo has been in this useless state I don’t know because fortunately I haven’t needed to use it recently. But it is a tool I have trusted and now I find that my trust has been misplaced. I warn you to do attempt a real backup to a spare disc before you believe in your compared Mondorescue backup.

I don’t know why Hugo is no longer involved but I am aware that this would not have happened when he ran things.

10 November, 2007 Posted by steveyoung | Ubuntu | , , | No Comments Yet