Home Uniquely NZ Travel Howto Pauline Small Firms Search
Diary of System and Website Development
Part 14 (August 2008 ->)
 

 1st September 2008

Ubuntu Linux Presentation

Linux and Open Source
A Real alternative to Windows ?

Or, why settle for Windows when you
can have the whole house for free ?

The above was the title of a presentation I recently gave on the QE2 and the more time goes on the more I believe that Linux distributions such as Ubuntu have now reached the point that they are a practical alternative to Microsoft Windows for a normal user and offer considerable advantages. This was brought home to me the day we joined the QE2 when two of my friends, both extremely careful and professional, contacted me saying they were infected with Viruses on their Windows machines.

Dual Boot Apple MacBook Setup

It was rather appropriate that when we got to stay with sister in Guernsey to find that they had bought a and Apple Macbook to compliment their existing iMac. In fact the Macbook was mainly bought as a way to able to run a particular Windows program for a course my sister is taking whilst also being a backup to their other, now elderly Apple iMac. Apple now use Intel processors and have developed a piece of software called Bootcamp which enables Macs to run a Widows system. It works by partitioning the disk drive and providing boot manager so that one can load another operating system into the extra partition - this would normally be Windows XP or Windows Vista which needs one to pay for an additional Windows licence. Bootcamp sets up all the Windows Device drivers, software to control peripherals such as the touchpad and special keyboard commands and provides an update service for itself. This is a very practical, all be it expensive way to get a very good and fairly secure Apple system which can occasionally run Windows software which is unavailable on a Mac. In this case it would primarily be used under Windows as Microsoft Word, Internet access and browsing were said to be required at the same time as the learning package.

Firstly the Apple Macbook is a very elegant, well built and powerful laptop as you would expect taking into account Apple's reputation and the price of circa £700. The keyboard is a standard Apple layout which is not ideal for Windows nor is the trackerpad with a single button but it happily accepted a standard two button and wheel mouse under Windows and Mac making usage much much easier as 'right click' menus were instantly available. I however still found the lack of a separate Delete key as well as a backspace odd and inconvenient under Windows and it would have been very difficult without a two button mouse. When I got to the machine it had already been loaded with Windows Vista Home (OEM) the Learning Package and Office 2007 Student Edition by the shop which had advised the Macbook solution.

I loaded Firefox 3.0.1 as a more secure browser, Thunderbird as an email package and Open Office on both the Mac and Windows system but spent most of the setting up time on the Windows system as that was the one which would be used most of the time. I added the free AVG virus checker and Zonealarm as a Firewall. I also loaded SpyBot Search and Destroy as a malware checker but not the 'Tea Time' extension for checking charges in the registry as both it and Zonealarm need considerable user interaction initially and when new programs and updates take place. I loaded Skype so I could easily talk them through any problems, GoogleEarth and Picasa.

I had some problems in moving their address book from Entourage ( an Apple version of Outlook) to Thunderbird and eventually used a tab delimited export and import although I could not get a good match of fields and ended up having to use a spread sheet to change and copy across some of the fields to fill the Display Name from the First Name and Surname before the final import which turned a ten minute job into a two hour epic with thirty fields to transpose and several to adjust in a spread sheet. In contrast the favourites was no problem to export and import from firefox although every import turns up in the recent additions dropdown which worried me for a while. The big problem was that I cold not collect email from their account with Cable and Wireless Guernsey (also marketed as Sure - a play on words as their competitor is called Wave) . It all worked perfectly with all my own email accounts when I tried than in the same copy of Thunderbird. I did a lot of searching first on their web site where I first found a support page at the top of their problems list on:

Optimising TCP/IP under Vista for Cable and Wireless Guernsey Broadband: If has problems using CW/Sure email on a Windows Vista machines and Thunderbird, Outlook or Microsoft Mail one should change some of the Vista TCP/IP settings using a terminal in administrator mode and typing:

netsh interface tcp set global autotuninglevel=disabled

It seems that some routers and other machines can not handle the latest bright ideas from Bill to speed up Broadband under Vista and there is a lot more about it on the Microsoft support site where you can also find how to get access to a terminal window with administrator privileges if it means nothing to you! - if the link is no longer active search for the above magic string. This did no harm nor did it solve the problem in this case so I tried again using Thunderbird on my own machine with Ubuntu with the same problem - it was obviously a combination of CWGSY and Thunderbird. Much further search led me to find the problem affected many people including those upgrading to recent versions of Thunderbird and to the following solution:

Thunderbird and CWGSY Email Accounts If you use the Thunderbird email client CWGSY have produced this complicated procedure to make Thunderbird compatible with CWGSY email accounts:

  1. Backup your machine and your Thunderbird profile if you know how (My addition as this procedure could lose your emails if you get it wrong)
  2. Open up Thunderbird.
  3. From the Tools menu, Select Options.
  4. Click on the Advanced icon.
  5. Select the General tab.
  6. Click the Config Editor button. This should bring up an about:config window.
  7. In the filter box, type mail.server.server. This should narrow down the results to the section we need to see. You will be looking for the section which has your CWGSY account in.
  8. For people with a single email account it will be mail.server.server2 that has the CWGSY account details. If you have multiple email accounts the number may be different from 2 and all the CWGSY accounts will need the procedure applied. For the purpose of this instruction we will stick with '2' as the number.
  9. Right click within the main pane of the about:config window and from the menu, select ‘New – Boolean’.
  10. This should pop-up a prompt box asking you to 'Enter the preference name'. Type in ‘mail.server.server2.auth_login’ (remember if your account is not number 2 - put the right number in here). Click OK.
  11. When prompted for the Boolean value - select false. Click OK.
  12. Close the about:config window. Close the Options window.
  13. Click Get Mail if you know you already have mail in your inbox, or write yourself a test email. You should now be able to send and receive with a CWGSY email account using Thunderbird.
  14. Repeat for any further CWGSY accounts with next number (My sister and brother in law have several accounts and the CWGSY account numbers were 3 and 4)

I found the procedure through Googling but the CWGSY page which contained it does not seemed to be currently linked into the CW/Sure web site - I assume it is normally given out by their support team so I have reproduced it here almost verbatim for reference in case it disappears.

I then had to teach my sister who had only ever used Macs how to us not only use Windows Vista but a series of packages such as Word 2007, Picasa and Thunderbird. This was actually a steep learning curve for me as I reloaded XP on the only machine I had with Vista as it was so restrictive. As time has gone on Microsoft have applied more and more sticky tape to patch up the worst problems then wrapped it up in a extra layer of glitzy paper but the middle of the ball is still based on DOS. In Vista I understand they genuinely tried to go back and write it right from top to bottom but failed after thousands on man years of effort and ended up doing the same job as before. Fortunately my sister having suffered a late 'Road to Damascus' conversion to computers still seemed keener than ever and happy.

Virus Removal Techniques

Having spent most of a weeks 'holiday' setting up a computer ad training my sister I got back to the UK and the first evening was presented with a laptop which I had initially set up but was now riddled with Viruses. This further confirmed my assertion that it is now almost impossible for even a normal user even with an up to date and well protected machine to stay safe online using Windows software. It had the Norton antivirus package which automatically updated its virus definitions and a Zonealarm firewall both of which seemed to have been up to date at the time of infection and the XP operating system was likewise set to automatically update. It also had SpyBot Search and Destroy with TeaTime active which seemed to be the only package that reported anything. There was also virus checking at the ISP. The browser was Firefox and Email Thunderbird. The only difference on my own Windows machines is that I use the free version of AVG rather than Norton.

So how were the defences penetrated? The likely route was a trojan in an attachment which was not detected by Norton. It was in an email purporting to be from UPS and arrived at the time a delivery was actually expected. This installed a rootkit and downloaded and installed various other malware. These disabled the virus checking, firewall and security centre. Various dummy virus checking packages were installed and big screens came up during boot saying the machine was infected and to run them. All the browser failed to work. I tried using a USB dongle to bring programs across but they were inaccessible because Widows Explorer, My Computer etc were blocked.

So what was left? The command line 'Run' still worked so I could run the registry editor by regedit and the startup etc configuration utility msconfig. I also found that I could load a CD which did autostart so and gave me a route into Windows Explorer. I found I could also run an Ubuntu LiveCD to allow me to delete files etc from outside of Windows. Starting in Safe Mode also worked but gave me no network access. I could also turn Restores off which is unfortunately essential to prevent virus being reloaded at the next reboot or startup.

I first transferred a number of useful programs to a CD including McAfee Stinger, AVG Free and new downloads of SpyBot Search and Destroy and ZoneAlarm. McAfee Stinger which can be run in Safe Mode from CD found nothing. I was unable to load AVG and run it either under Safe Mode or full operation because it conflicted with Norton. Uninstalling Norton did not work - Norton always failed to uninstall fully with the built in uninstall and needs a download from their site.

I therefore started to look for alternative Free Virus checkers which I could run in parallel with Norton and found 2, first was Exterminate It! which ran happily with Norton and identified a number of the viruses and trojans but did not remove them in the free version - even so it told me where to start looking and what executables (.exe and .dll files to try to get rid of in safe mode or using Ubuntu. The real winner was Avast! 4.8 Home which also ran happily with the remains of Norton but also got rid of some of the trojans when it was run the first time and also ran at boot time to delete some more files. Many of the problem files were however replaced at each reboot.

I therefore used msconfig to selectively run the startup programs and looked up every suspicious .exe and .dll refereed to and then searched for them in the registry. This gradually improved the situation. I also deleted whole directories for programs such as the very realistic looking dummy virus checker XP SecurityCenter. I then reloaded Spybot Search and Destroy and updated its database. That identified several more trojans or parts of and took some of them out.

I continued the chase by searching for any new files in c:/windows, c:/windows/system and c:/windows/system32 which are the normal locations for executables. Note, make sure you can se hidden and system files and include them in your searches. I then did google searches for each one and deleted them if they were virus/trojan files and also took out their registry entries. Further runs of Avast and Spybot including its advanced registry tidy mode now got most of the problems under control and Firefox and Windows Explorer were now fully working and ExterminateIt was showing no problems. At the end I only had two programs which I could not find and were dependent on being inhibited from running in the startup list by msconfig . The only casualty of this cavalier approach was that Explorer started every time in My Documents at a reboot - a small feature which seemed acceptable and I had already spent about 10 hours.

So what have I learnt apart from the fact that it is almost impossible to be safe on the Internet with Windows.

Ubuntu Hardy 'WUBI' Setup on Toshiba Laptop (Satellite Pro A200)

The final stage in restore the machine to operation was to add a Ubuntu Linux option. I chose not to repartition the disk this time and do a full install. Instead I used WUBI which stands for Windows UBuntu Install. This installs an Ubuntu system in a single huge loopmounted file. This has some disadvantages over a full partitioning and install but is a lower risk approach if you are not certain you are going to be able to get every important piece of hardware working properly. In this case the WiFi did not work from the LiveCD and I needed a reboot to try the suggested fix - obviously impossible with the LiveCD so a WUBI approach which could be uninstalled as easily as it was installed under Windows seemed a sensible approach. In the event the WUBI install from the loader on the LiveCD under Windows, a full update, the fix below for the Wifi and installing Thunderbird took exactly 45 minutes - very favourable compared to the 10 hours disinfecting the Windows machine!

I transferred the Thunderbird profile with email and address books is another 30 minutes using a memory stick as initially I could not find how to access the Windows drive which was hosting the Ubuntu loopback system in places or under /media. I found latter that access the Windows drive is different to the other drives and it is mounted at /host. There is a useful WubiGuide - Ubuntu Wiki which explains a lot of the differences. I added a launcher (link) to the Windows C: Drive on the Desktop.

I finally changed to a normal dual boot setup but had a number of problems with freezes and a standard USB mouse slowed to a crawl so I eventually removed Ubuntu as I did not have time on somebody else machine to test fully. I will probably leave it with a Wubi system in a separate partition.

Installing Wifi Drivers using ndiswrapper ( eg Atheros AR5007EG on Toshiba Satellite Pro A200)

Many of the Toshiba laptops now use the Atheros AR5007EG possibly identified as aAR242x in Hardy. The restricted drivers which are automatically loaded do not work but an internet search revealed the following technique using ndiswrapper which is 'wraps' the existing Windows driver so it can be used in Ubuntu. This is now very easy to implement as there is now a 'GUI' (Graphical User Interface) and the tool is available using Add/Remove. The following technique should work for many other WiFi cards where a Windows driver can be found, perhaps from your original Windows setup or the CDs provided with the card/laptop.

Ubuntu Linux - How to reboot cleanly even when the keyboard/mouse are frozen

The WubiGuide - Ubuntu Wiki explains that Wubi based Ubuntu systems are more vulnerable to uncleanly shut down files systems as they use the Windows NTFS format which they can not repair. It is therefore important to shut down cleanly whenever possible. Even if a problem appears to have frozen the system there are still several ways to reboot cleanly using key combinations such as:

  1. CTRL + ALT+ F2 (get to a terminal, you can then run top/kill/pkill to discover and kill the offending process)
  2. ALT+ SYSRQ + R then CTRL + ALT+ F2 (as above, but first try to regain control of the keyboard)
  3. CTRL + ALT + Backspace (kills the graphic session and goes to a console, all graphical applications are terminated too)
  4. ALT+ SYSRQ + R then ALT + Backspace (as above, but first try to regain control of the keyboard)
  5. CTRL + ALT + DEL (reboot)
  6. ALT+ SYSRQ + R then CTRL + ALT + DEL (as above, but first try to regain control of the keyboard)
  7. ALT+ SYSRQ + R + S + U + B (forces a clean reboot even when the keyboard is not responding)

The last one is the most effective, but you could try the other commands first but make sure you understand the commands before trying the first and other methods using a terminal - 3, 5 and 7 are probably best for a beginner. I believe the final sequence means hold down ALT and SYSREQ (may be Print Screen on your keyboard) together then add R, S, U and B in sequence rather than need 6 fingers! There is some explanation in the Free Software Magazine at How to close down GNU/Linux safely after a system freeze with the SysRq key

Parted Magic, Download Checksums (md5sum) and CD/DVD cloning

Parted Magic is one of the best disk partitioning tools which can be downloaded and run as a live CD using a Linux Kernel.

When you download CD and DVD images it is prudent to check that they have no errors before and after making the CDs. Parted Magic provides an md5sum checksum to enable one to determine if there is even a single bit error, I tend to check after the download and after burning a CD. This is very easy if one is using Linux as there is a command you can run a terminal to produce it. The following examples assume a CD and a file on the desktop.

md5sum -b /dev/cdrom
md5sum -b ~/Desktop/temp.iso

It is also very useful to be able to turn a CD/DVD into an ISO file which can be burnt back to make an exact copy of a CD rather especially for bootable CDs (LiveCds)

The following sequence of terminal commands does that:

sudo umount /dev/cdrom
dd if=/dev/cdrom of=/home/pcurtis/Desktop/temp.iso

The file temp.iso can be burnt by right clicking temp.iso on the desktop and choosing open with "Brasero Disk Burning" after inserting a blank CD or DVD. The CD should again be checked by

md5sum -b /dev/cdrom

The above cloning technique is ideal for making the single backup allowed of most proprietary systems and for distributing Open Source software.

Disk Partitioning

The following is only a brief summary of a complex situation - it identifies a few of the key words which you will meet. Disk partitioning is the creation of separate divisions on a physical hard disk drive. On the Windows system which most people are familiar with the C: drive may be a whole physical disk drive or a partition within a partitioned drive. Likewise a drive D: may be a completely separate physical drive or on the same partitioned drive as the c: drive. It is impossible to tell in normal use.

Once a disk is divided into several partitions, directories and files of different categories and file systems may be stored in different partitions.The way space management, access permissions and directory searching are implemented depends upon the type of file system installed on a partition. The main purposes for partitioning are:

There are three types of partition: primary, extended and logical. A standard PC hard drive can have a maximum of four primary partitions, or three primary and one extended partition. . An extended partition is a 'container' for any number of logical partitions. All these partitions are described by 16-byte entries that constitute the Partition Table which is (normally) located in the Master Boot Record (MBR) .

Windows generally needs to start or boot from a primary partition which is usually the first drive on the operating system, the boot drive. This requirement has been relaxed for Windows XP and Vista but is still the best and conventional set up. Linux is capable of booting from a logical partition. The details of which drive is used for booting is in the MBR.

Changes can be made to the partitioning using a partition editor. Careful consideration of the size of the partition is necessary as the ability to change the size depends on the file system installed on the partition.

Using Parted Magic and Gparted LiveCDs

Gparted is a sophisticated graphical Disk Partitioning tool which runs under Linux. It is accessible using the Ubuntu Hardy Heron LiveCD and as a separate LiveCd download from the Gparted site. It is also incorporated into Parted Magic which is the preferred way to proceed although on some older systems the basic LiveCD may run when there are not enough resources for Parted Magic.

Parted Magic is a LiveCD which allows one to run not only the Gparted Partition Manager but also gives internet access via firefox and a number of other utilities. There is a simple file manager accessible via icons for all the drives with a simple text editor to allow one to make modifications to configuration files. There are also a number of recovery utilities which I have not used and require a lot of care, experience and background reading.

Gparted is fairly self obvious to use but there are some cautions - to quote: "If you are not very advanced using Linux or Microsoft Windows, DO NOT MOVE the beginning of your Windows System partition. Repositioning only the endpoint of the partition will minimize the chance of error. Shrinking an NTFS file system and its partition is a safe operation for GParted, but moving a large partition has proven to be fatal in too many cases. Moving large partitions with GParted also proves to be slower than just backing up the data and creating a new partition instead. GParted is a great program, but its move feature is too buggy to be trusted."

There is a good example of how to Reduce the size of a Windows Partition to make space for a Linux system on the Parted Magic Web site. Note Vista has a built in utility to reduce its own partition - if you use Gparted or almost any other partition manager you will have to use the Vista recovery CD (if you have one) to rescue your system - see http://www.howtogeek.com/howto/windows-vista/using-gparted-to-resize-your-windows-vista-partition/ for details of what to do.

Partitioning for Ubuntu Linux

Now we have to decide on how to partition our disk to make best use of the available space on a dual boot system. even most laptops have at least a 40 Gbyte drive these days so it is not too difficult. A standard (Master Block Record MBR) hard drive can have a maximum of four primary partitions, or three primary and never more than one extended partition. Windows needs a primary partition for the boot drive with the operating system. An extended partition is just a 'container' for any number of logical partitions.

Linux is capable of booting from a logical partition, so shrinking the primary partition and partitioning the remaining space as an extended partition is the best option and affords the opportunity of adding logical partitions for data and other Linux installations in the future.

Windows XP needs at least 10 Gbytes by the time all the system restore points, updates and other junk is taken into account so it is sensible to allow about 12 - 15 Gbytes, I have 12 Gbytes on our laptop which is workable. You should also make sure you have several Gbytes free. Ubuntu Hardy Heron uses only 3 Gbytes when initially loaded but again grows with updates, applications etc and again should have 12 - 15 Gbytes to allow for expansion. The linux-swap file will be another 1 Gbyte. This leaves about 10 Gbytes for a shared Data partition.

The following is a screen shot of Gparted for a laptop that I have just set up which has a 60 Gbyte drive. Both Windows XP service pack 3 and Ubuntu Linux have just been loaded and updated but and are at the minimum size possible. In contrast my own laptop has a 40 Gbyte drive and after two years Windows XP Professional is using 9.3 Gbytes and Ubuntu Linux 8.04 is occupying 9.0 Gbytes, both in partitions of 11.5 Gbytes.

Gparted screen

The order for the partitions is chosen to provide the maximum flexibility with the shared DATA Partition between the WINDOWS System Partition and The Linux Root Partition with the Linux-Swap Partition at the very top of the Extended Partition. This means that if you choose to return to only Windows or remove Windows completely you can just increase the size of the DATA partition to fill the empty space. If you do change the size of the Data partition copy it all to an external drive first. With larger hard drives I would split the extra 25% to each operating system and 50% to the shared area up to 20 Gbytes each for the operating systems. I always chose a FAT32 format for the shared area as it can be read by everything. The exception is for video processing when I would use an NTFS partition as it can handle files over 4 Gbytes in size and on drives of over 80 Gbytes I have a separate partition for Video to reduce fragmentation problems. You can create the ext3 root partition and the swap partition but it is perhaps best to just leave an unallocated area at the top of the extended partition.

A further improvement long term is to also create a separate partition for the /home directory under Ubuntu. This is where all the user configuration and data files live and enables one to back that up separately and also to reinstall a new distribution of Ubuntu without losing and data and with minimum changes to the configuration of the programs. It is certainly well worth doing if you have a large disk or multiple disks. In the above scenario I would probably add the extra ext3 partition for /home directory between the Data and the Linux Root / partitions to give flexibility if it needs to grow. The balance in size depends on where one choses to put the main data rather than 'settings', if it is only for settings it is best to be small and above the DATA partition, if it is going to be a multiuser machine almost entirely used under Ubuntu it needs to be bigger and probably below the FAT32 DATA partition. I have covered Moving an Ubuntu Home Directory to a dedicated Partition below and one will see that it is not trivial and there are many advantages in getting it right first time.

A Stage by stage change from Windows XP or Vista to Ubuntu Linux 8.04

 

I am going to try to divide this into a series of 'tutorials' which can each be carried out in an evening. Each one will end with a list of things to find out for the next one from finding and looking up something in the manuals or finding the CDs that came with the machine and making decisions about which way to jump - things that need time to find or brood over in the background. My aim is to keep it to four short evenings (1.5 - 2 hours). Costs should be low as all the software is free but you may want, or need to, get some hardware which will enhance Windows as well as make it easier to get set up on Ubuntu. Firstly a ADSL Firewall Router with Wifi to replace the USB modem from your broadband supplier (£20 generic -> £50big name from, Dabs) and secondly a pocket sized backup hard drive (eg. Western Digital Passport 160 Gbytes £45 or Freecom 250 Gbytes £41 from Dabs) . You may have both already.

The following stages will be 'filled in' in more detail as a background to my lecture(s).

Initial Checklist

Checklist of things you need to know and have available before you start:

Preliminaries - which also enhance Windows Security

Testing to see if you are compatible and want to make the transition

Middle ground - Adding a Data partition - an improvement even if you only use Windows

In this stage we create a separate partition for Data. The advantage is that one can reload the operating system without loss of data saved on the Data partition which can also be used for backups. This is the place to store documents and pictures and the whole partition can be backed up periodically to an external drive. I have always made a data partition even in the days when I did not use Linux

The final change to an Ubuntu dual boot system

The following stages will be 'filled in' in more detail.

15 September, 2008

ImgBurn

I have been looking for a free and flexible CD/DVD burning program for Windows XP and Vista, initially for my sister who has just obtained a Macbook which is dual booted (using BootCamp) to run Vista. She had to load the Windows system therefore it has none of the 'Lite' versions of Nero or Roxio. It needs to be simple to use but the flexibility to be able to back up her system without having to know explicitly the locations of all the important files ie it has to be able to make a copy of the Settings and Documents folder without falling over because some files are in use or the folder nesting is too deep or file names too long. The requirements overlap with mine to be able to make quick backups of machines I am working on in case virus removal or partitioning disks goes badly astray. In addition I wanted a program to tell people about for making LiveCD disks from ISO images for Ubuntu Linux and Disk Partitioning and to be able to verify the downloads and burning using the md5sum checksums which are provided these days with many large downloads. It is strange that I should be looking for Windows software to help people make the transition to Linux.

This proved more difficult than I expected - the main recommendations I found did not do all the above or did not run under Vista and in some cases did not seem to work on my system at all, surprising as it is an almost new HP Compaq DX2250. I then found ImgBurn which does all I require yet has a basic interface simple enough to make life easy for my sister. It will work 'out of the box' for most purposes yet there is the flexibility to set it up for bulk back-up of system folders and files. It has a brilliant 'drop zone' a small circular area area which is transparent and stays in front of all other windows onto which you can drag and drop files/folders from any program such as Windows Explorer to add them to the list of files for burning.

ImgBurn will handle every current type of drive including CD, DVD, HD DVD and Blu-ray. It is normally entered by a quick start task selector panel has has several 'Modes', each one for performing a different task namely:

ImgBurn supports all the Windows OS's - Windows 95, 98, Me, NT4, 2000, XP, 2003, Vista and 2008 (including all the 64-bit versions). The web site says that it should also run on Linux if you use Wine. I have tried it under Ubuntu Linux with WINE 1.0 and I only had to change the Interface method to ASPI from SPTI.

ImgBurn supports a wide range of image file formats - including BIN, CUE, DI, DVD, GI, IMG, ISO, MDS, NRG and PDI. It can burn Audio CD's from any file type supported via DirectShow / ACM - including AAC, APE, FLAC, M4A, MP3, MP4, MPC, OGG, PCM, WAV, WMA and WV. You can use it to build DVD Video discs (from a VIDEO_TS folder), HD DVD Video discs (from a HVDVD_TS folder) and Blu-ray Video discs. It supports Unicode folder/file names, so you shouldn't run in to any problems if you're using an international character set. It's a very flexible application with several advanced features that are often lacking in other tools, especially when it comes to burning DVD Video discs.

Whilst ImgBurn is designed to work perfectly straight out of the box, it is also very configurable for special purposes. I will give a detailed explanation of the settings I changed to enable me to backup all of the important 'system' files in one go.

Setting up ImgBurn for backing up system information:

We need to cahange some of the default settings to be able to back up system folders because:

  1. Some system files will be in use and should not be saved as they will always be different. However if you have programs open files you need to save may also be marked as in use so always close all programs especially your email and browser programs.
  2. The folder depth of nesting exceeds the defaults which are set to enable reading on every operating system
  3. The file names are longer than the defaults which are set to enable reading on every operating system
  4. You need to back up files which are hidden by the system to prevent accidental changes
  5. You need to be able to back up files marked as system files by the system to prevent accidental changes
  6. You may have files which have no extension if you have received them from a non windows system

Most of these changes do not affect normal operation so can be set the first time you want to save your system and left set from then on.

Start the program and you will find that there are are a number of tabs on the right which need to be set up.

General Tab

Options Tab (The first two can be set these once and for all - they are important to make sure you save the system information during backups)

Advanced Tab

Labels Tab (Give the CD/DVD a volume label each time which includes the date - so you can find out what is on the CD/DVD - the others do not matter)

Verify tick box - normally leave this ticked - the CD/DVD will be briefly ejected and pulled back in and the CD/DVD checked after the CD/DVD has been written.

In addition some of the most important settings need to be made from the drop down menus at the top and those below can also be set once and for all.

Settings from the Drop Down Menus

It is now time to Add the files and folders you want to burn to the CD/DVD. Use the buttons down the right of the source panel or use drag and drop onto the special area called the drop zone which allows stays on the top - see above for turning on and off.

When you have created a set of files for a regular backup you should save the project :

When you come to Burn again

You can now use the button at the bottom to start to burn the CD/DVD. If it is rewriteable it will check that you want to erase the existing data completely.

September 18, 2008

Dictionaries

I have been looking for the location of dictionaries to modify them and back them up. Firefox and Thunderbird have the additions you add in the file persdict.dat in their profile. Microsoft dictionaries are all in C:\Documents and Settings\<username>\Application Data\Microsoft\Proof\custom.dic . There is more information in http://labnol.blogspot.com/2006/11/firefox-2-spelling-dictionary-hacks.html and http://www.labnol.org/forums/topic/want-to-create-dictionary-add-on-to-firefox-3-any-simple-solutions-please-1 . It seems you can cut and paste the microsoft dictionary list into the firefox/thunderbird ones to add your old 'exceptions' . I do not know if it then reorders the list or if it matters! If you can not find where a dictionary is saved then try adding a word such as dwgobble to the dictionary, closing the program and then searching for a file which has changed in the last hour with that text string.

Downloading, Burning and Verifying your Ubuntu LiveCD

Lets now start for real and download the the .iso file, burn it to CD and verify the resulting CDs MD5SUM checksum to make sure that not a single bit is in error in the 694 Mbytes you have downloaded. The download page is Get Ubuntu and this has lots of useful links to keep you busy whilst the file is downloading, you want the standard desktop edition 8.04 LTS Hardy Heron. I have broadband in the up to 8Mb download speed class and the download took almost exactly 15 minutes.

Whilst the download is taking place it is also a good time to find out the MD5Sum for your download so you can check that you have got a perfect CD. They are on the UbuntuHashes page which you can get to by my link or via the various help pages which are linked on the Download page - I tend to just write down the last few characters to check.

When you have the .iso on your desktop (probably called ubuntu-8.04.1-desktop-i386.iso) you need to burn it to CD. How you do that and check the Md5Sum depends on your software. If you have Nero or Sonic the chances are that if you right click on the .iso file the menu will contain a link to your CD burning package - it is certainly true if you have downloaded and set up ImgBurn as covered in the earlier steps. It should then only be a click or two to start it burning. ImgBurn will also display the Md5Sum in the log file so you can check that both the download and the final verified version are perfect. If you have used an existing CD burning package then you need to load some more software to check the download and assume the CD is correct if it verified OK. I have used Md5Sum Portable which can be put on a USB stick to check Md5Sums in Windows - you donot have to put it on a stick, it will install into any directory and run without making any registry changes or make changes outside of its own directories.

Booting your LiveCD

We are almost there. We now have the LiveCD and we just have to persuade the machine to boot from it. Some computers require you to hold down or press a key to enable booting from the CD drive, the best place to find this information is in your computers user manual or the manufactures website. Common keys to try - Toshiba, IBM and others: press F12 while booting to get to the boot menu and choose CD-ROM. HP Asus and others: press TAB key while booting and select CD-ROM from boot menu. HP press F12 while booting to get to the boot menu and choose CD-ROM. The options usually flash up on the screen at the start of the boot process but you do not usually have time to catch it that time!

Older machines will need you to enter the BIOS (Basic Input Output System) often also called CMOS. The most common way to enter the BIOS is to press the DELETE key when the computer is first booted (this seems to be becoming standard). On other systems it could be a different key, or combination of keys like ESC, F1, F2 (Toshiba), F9 (HP) F10, Ctrl-Esc, Alt-Esc, Ctrl-Alt-Esc, Ctrl-Alt-Enter, Ins or even others. You might have to press, press and hold, or press multiple times. The best way to find out the details of that is to look in the users manual or search the manufactures website. You then have to navigate the very basic menus using the instructions at the bottom of the screen until you find the Boot order and change it so that the CD is first. Then exit saving your change. (you may want to change back after you have finished experimenting as it is easy to leave a CD in the drive).

In most cases you will get a couple of menus asking for your keyboard language and what you want to do, the default is what you want and then you have wait a few minutes while it loads most of the CD into memory then comes up with the Ubuntu desktop. There is a folder of examples so you can quickly find out if sound and video are working and you can try out the Word processor, spread sheets and presentations to name a few. If you are connect as I recommended via a ethernet connection to a router you will almost certainly have internet access via Firefox. In about 50% of cases you will also have Wifi subject to giving the WEP or WAP key, other machines will need the Windows Wifi drivers to be wrapped up and used with a facility called ndiswrapper but that really needs to be done on a full installation or a WUBI installation as there is no persistence and you may need a reboot even to try it out

30th September 2008

Moving an Ubuntu Home Directory to a dedicated Partition

This is based on Psychocats - Create a separate home partition in Ubuntu with quite a few modifications to get it to work for me using Ubuntu Hardy Heron. As an aside the original article is one of an excellent series which are well worth a look. The proceedures here are not very well tested as I have only done it for one machine and one should make backups of everything of value but the techniques are used in many places. Both the partitioning and the "copying" and mounting have risks but the proceedures here are designed to minimise the risk and provide some escape routes if it does not work. It is however best to think ahead and provide the separation of system and data when the initial installation is carried out.

The first stage is to make a new partition using Gparted from an Ubuntu LiveCD. This will usually involve shrinking an existing partition, probably the root partition with the home folder you are moving. In the following I have used as an example a new ext3 partition /dev/sdb8 - you need to substitute what it turns out to be for you from Gparted. I have covered Partitioning elsewhere so I will not do more here than suggest you make sure you have a sensible division leaving space for both the main system and the /home directory and enough working space so you can keep the original /home for a while until everything is debugged.

Assuming you have made a new partition you now need to go back into your normal system. If you are using Hardy heron you can mount the new partition using Places -> Removable Disk (check the mount point is /media/disk or modify the following suitably) then use cpio which is an archiving program to 'copy' your home directory to it by the following commands in a terminal:

cd /home
sudo find . -depth -print0 | sudo cpio -p0vud /media/disk

I initially thought doing this from a LiveCD would be more sensible as it would avoid problems with files being in use or changing but it does not work as the permissions end up being incorrect as the original root folder one mounts and uses for the "copy" does not have the original permissions when using the live CD. I found that out the hard way as it was not clear in the original article and I had to start again several times! It takes a while to realise that Linux is very different from Windoze and one can work on a live system without problems of files being locked and/or in use. The complexity and use of cpio instead of cp is to maintain permissions and the various links and comes from a variety of sources. It is worth doing a man cpio and a man find to understand the programs and parameters but I will try to explain some of basics of it step by step:

cd /home - this changes to the home directory.

sudo find . -depth -print0 - this provides a list of filenames. I am not sure if the sudo is desirable or essential, it is not needed for a single user system. The - printo parameter specifies "null terminated strings" which will work even if some of the files have spaces, newlines, or other dubious characters in them. The -depth parameter specifies processing each directory’s contents before the directory itself.

The results are written into a pipe by the | and the program reading them must be capable of using this list. The cpio archiving command has this feature.

| cpio -p0vd /media/disk - here's the tricky part. This uses the "passthrough" mode of cpio, an archiving program that normally copies files "in" or "out" but it can do "both" using this "passthrough" mode. The -p sets the "passthrough" mode for cpio which then expects a list of filenames on its standard input (which we are providing from the 'find' command). It then copies the corresponding file "in" from the path specified (as part of the input line) and "out" to the the path specified as the final one of cpio's arguments (/media/disk in this case).

The rest of the switches on this cpio command are: -0 - expect the input records (lines) to be null terminated, -v provides verbose output, and -d - make leading directories as needed. -u forces overwriting of any existing files but it is best to make sure that everything is deleted before starting.

We sould now have an exact "copy" of the /home folder on the new partition with the correct permissions (at least for the username you used when carrying out the cpio copy). It is prudent to mount the partition and have a look to see if everything is reasonable. It should be [still] be visible in Places -> Removable Media for you to check the permissions and ownership is correct for each user.

Now we need to mount this in the correct place at turn on. Automatic mounting is carried out by backing up then modifying /etc/fstab by:

sudo cp /etc/fstab /etc/fstab_backup
sudo gedit /etc/fstab

and adding an extra line at the end

/dev/sdb8 /home ext3 nodev,nosuid 0 2

In Hardy Heron one ought to use the UUID making the addition into two lines

# /dev/sdb8 
UUID=3b50dbce-28c8-46fc-bc63-f89bb06c54e5 /home ext3 nodev,nosuid 0 2

where your UUID can be found by:

sudo blkid

At the next start-up the modified fstab will mount the new home folder from the disk partition over the top of the existing one which is then invisible. A return to the old set up is as simple as restoring the original fstab or commenting out the new final line at which point the old /home is once more visible. At a point in the future when one is completely happy the old contents can be deleted to save space using the LiveCD.

An alternative is to rename /home to /home-backup using the LiveCD and create a new /home ready for the mounting with the appropriate permissions before changing fstab as in the original article. This is more complex and risky than mounting over the top but the 'backup' /home directory can be deleted without having to use the LiveCD.

The proceedure above was what finally worked for me with a single user setup, it is possible that permissions may need to be set up for other users. If the permissions are wrong, as happens if you do the cpio 'copy' using the LiveCD you get messages when you try to log in such as:

Users $Home/.dmrc file is being ignored. This prevents the default session and language from being saved. File should be owned by user and have 644 permissions.
Users $Home directory must be owned by user and not writable by others.

If you can get past this message, perhaps by changing permissions from the liveCD the following brute force procedure (which is a refinement of what I did in one of my early attempts) to set the groups and permissions can be tried on the other users:

sudo chown -R eachusername:eachusername /home/eachusername
sudo chmod -R 755 /home/eachusername
sudo chmod 644 home/eachusername/.dmrc

This needs to be done before each username is logged into the first time otherwise many desktop settings will be lost at the point the warning message appears - this means that the cpio 'copy' will need to be repeated and the permissions set for each additional user as above before logging in the first time.

The best way I believe now is to create a new user just before making the change and logging into that user to carry it out. The overhead in size of a the new user's directory in /home is only about 28K and it makes sure that there is very little going on and no important files are missed or changed during the copy - I worry about programs with Daemons running such as Picasa and Skype. The new user can be removed after the change has taken place. The new user is easy to creat by System -> Administration -> Users and Groups. The new user needs a name, to have the Profile of an Administrator set in the box and the passwords input, nothing else matters and can be empty or default. The new user will automatically have the ability to Sudo if set up with the profile of an Administrator.

When you delete the user using the GUI you do not delete the /home directory or another few files - to also remove the home directory it is easiest to instead use the command line and the deluser utility:

sudo deluser --remove-home username

Alternatively all files owned by the user, including those in the user's home directory may be removed as follows:

sudo deluser --remove-all-files username

In summary there are many advantages in having ones home directory on a separate partition but overall this is not a proceedure to be carried out unless you are prepared to experiment a little. It is much better to get it right and create one when installing the system.

One possible improvement is to use rsync instead of cpio to do the intelligent copy by

rsync -avx /home/ /media/disk

you do not need to be in the home directory. rsync is an advanced archiving and copying tool which can work over ssh (Secure Shell) to other machines as just a simple intellegent copy. It is also useful for regular 'backups' as it will only copy files which have changed so it can be run on a regular basis to syncronise two machines

4th October 2008

UDF format CDs

I have found that anumber of my backup CDs which contained the pictures I had sent for printing were in the UDF format. I am not sure what software I used to write them, probably nero or possibly the built in simple CD writer in XP. It seems that Heron heron does not have the libary for reading and writing the UDF format installed by default so could not mount them and gave the error an error message which mentioned UDF. I had to use the Synaptic Package Manager to load the UDF routines by System-> Synaptic package Manager -> Search entered UDF and ticked libudf0 libudf-dev and udftools and then Apply. After that I could mount and read the CDs fine.

Unetbootin

Unetbootin This seens to be the perfect way to install Ubuntu on a machine without a CD. You can either download to the machine and install or you can create a LiveUSB. I created a LiveUSB of Hardy heron and tried it on the only machine which I have capable of booting from a USB stick and it behaved just the same. It looks as if it should be able to create a LiveUSB from an ISO of a LiveCD of other programs such as disk partitioners but I have not tried it yet. The impressive list of distributions is long and the list of utility programs that they have built support for downloading to a LiveUSB includes:

rsync, ssh and unison

I have done some preliminary investigations of backing up and copy directories over secure (Openssh) connections. I have added two packages using the Synaptic package manager namely, ssd and unison-gtk. I have so far been able to log into another machine where ssh has been installed so it has the server daemons running using the IP address. This should mean it is possible to use rsync to transfer a home directory to another machine and use unison to syncronise say the documents folders - watch this space. There is a lot about it in "Ubuntu Hacks"

MSI Wind

I did a lot of preparation whilst waiting for the Wind to arrive by looking through various forums and blogs and found several itmes which were of interest.

The MsiWind.net wiki on Ubuntu Hardy Heron 8.04 Installation and Post Installation Guide and Tweak was probably the most useful overall.

MSI Wind Wifi

There were several forum articles as well as the guide above covering Wifi but sources I used for background and drivers were:

All I had to do was to Install Ubuntu 8.04 from a LiveUSB, set up the repositories, update using a ethernet connection and then run the .deb file and after a reboot I had Wifi and was able to set up my WEP key.

The rest has moved to a new MSI Wind U100 Netbook and the new Wordpress Diary

Epson Perfection V200 Scanner under Ubuntu Linux

This howto describes the steps necessary to use the Epson Perfection V200 Photo scanner with Ubuntu Hardy Heron. It is closely based on an excellent Howto in Uellue's Blog.

Other Epson scanners should work in a similar way, there is a list of supported devices on the Epson web site below. The driver provides support for 8 bit and 16 bit color depth and 300, 2400 and 4800 dpi resolution when used by GIMP through Sane .

Firstly a number of Ubuntu packages need to be added via System -> Administration -> Synaptic package manager and Search for each package and Install it. The packages are:

The drivers are available on the Epson Japanese vendor's site. Choose your scanner and your distribution, fill out the small questionnaire and submit the form. You are directed to a download page. There are no Debian (.deb) packages but if you get the RPM packages for "gcc 3.4 or later" you can use utility called Alien to convert the packages to the .deb format in order to install them. In a terminal:

sudo alien --scripts iscan-2.8.0-1.c2.i386.rpm
sudo alien --scripts iscan-plugin-gt-f670-2.0.0-1.c2.i386.rpm

To install the generated .deb packages use dpkg:

sudo dpkg -i iscan_2.8.0-2_i386.deb
sudo dpkg -i iscan-plugin-gt-f670_2.0.0-2_i386.deb


Now plug in and switch on the scanner and use lsusb in a terminal which should show the scanner. The output will look like:

pcurtis@triton-ubuntu:~$ lsusb
Bus 004 Device 003: ID 04b8:012e Seiko Epson Corp.
Bus 004 Device 001: ID 0000:0000
Bus 003 Device 001: ID 0000:0000
Bus 002 Device 001: ID 0000:0000
Bus 001 Device 001: ID 0000:0000
pcurtis@triton-ubuntu:~$ ]

Now use the utilities from sane-utils in a terminal. First use sane-find-scanner to check whether Sane finds the device. With scanimage -L you can find out if the driver is properly installed. The output looked like this:

pcurtis@triton-ubuntu:~$ sudo sane-find-scanner

# sane-find-scanner will now attempt to detect your scanner. If the
# result is different from what you expected, first make sure your
# scanner is powered up and properly connected to your computer.

# No SCSI scanners found. If you expected something different, make sure that
# you have loaded a kernel SCSI driver for your SCSI adapter.

found USB scanner (vendor=0x04b8 [EPSON], product=0x012e [EPSON Scanner]) at libusb:004:003
# Your USB scanner was (probably) detected. It may or may not be supported by
# SANE. Try scanimage -L and read the backend's manpage.

# Not checking for parallel port scanners.

# Most Scanners connected to the parallel port or other proprietary ports
# can't be detected by this program.
pcurtis@triton-ubuntu:~$ sudo scanimage -L
device `epkowa:libusb:004:003' is a Epson Perfection V200 flatbed scanner

Depending on your exact installation only root may have access to the scanner although my original user was already in the scanner group. To allow other users to access the scanner, they must be members of the scanner group. You then either need to reboot or restart udev after adding the extra members. The terminal output looks like this:

pcurtis@triton-ubuntu:~$ sudo adduser peter scanner
Adding user `peter' to group `scanner' ...
Adding user peter to group scanner
Done.
pcurtis@triton-ubuntu:~$ sudo /etc/init.d/udev restart
Stopping the hotplug events dispatcher: udevd.
Starting the hotplug events dispatcher: udevd

It has also been reported by some users that a line has to be added to a sane configuration file - mine was OK and the line had been appended automatically but for completeness check and add a line containg epkowa to the end of /etc/sane.d/dll.conf if you have a problem.

After that my scanner works fine and can be accessed most easily via GIMP but can also be accessed directly by xscanimage or xsane.

Vodafone Huawei Modem and Vodafone Mobile Connect Broadband package.

Vodafone now offer a package with a USB broadband stick preloaded with 1 Gbyte of data for £49 reduced to £39 for Xmas. Top up are £15 for 1 Gbyte. The stick I received has a micro SD reader built in and is type Vodafone K3565 which is detected as a Huawei E220.

I had been reading Linux Format which had an article on Mobile broadband which pointed me towards a control application writen by the Vodafone Group - it is not officially supported but is an Open Source development which can be used for many USB 3G sticks and service providers. It is succintly named the vodafone-mobile-connect-card-driver-for-linux which everyone appreviates to vmc. The vmc installation details are at https://forge.betavine.net/projects/vodafonemobileand www.betavine.net/bvportal/web/linux_drivers and there are also a series of support forums. It took me a little while to work out exactly how to install the software and there were a few things that I wish I had realised in advance which I will cover:

VMC Dependencies: A number of extra packages have to be installed to satisfy dependencies before running the vmc installer. I did realise about these and installed all the following packages - I used System - Administration -> Synaptic Package Manager. Note that you may have to enable some extra repositories. The other way used in their install scripts is:

sudo apt-get install python-dbus python-twisted python-serial python-glade2 python-pysqlite2 wvdial
sudo apt-get install python-notify python-gnome2 python-gnome2-extras python-serial hal python-tz
sudo apt-get install python-setuptoolsbluez-gnome python-gnome2-desktop

Installing: The package is installed by downloading the Auto Install file , copying to your home directory, changing the permissions to make it executable and then sudo ./vmcfilename.net . I took a while to realise the obvious and change the permissions to make the file executable. I installed the latest version 2.0 beta3 - they seem to update every couple of months so you may well find a final version 2.0. I had satisfied all the dependencies so I do not know what happens if you have missed any. Part way through it asks for you to give a list of users who need to run it - I latter found that the list should contain root to avoid the following problem.

VMC Permissions - when I had installed the Vodaphone the VMC software and ran it the first time it complained about the permissions for the opt/vmc/etc/ppp folder which I set to 777 as the easy way by gksudo nautilus to change their properties as root. I actually set all the subdirectories at the same time which caused further complaints about pap-secrets and chap-secrets which I had to set back to 660 after which there program ran happily. They all belong to group vmc.

I found latter in a conference posting that during the install when it asks for users who have permission to run the device one should include root and then the permissions problem disappears. You can uninstall vmc to repeat the install by (both untested):

sudo /opt/vmc/usr/bin/uninstall-vodafone-mobile-connect

Multiple instances of the device: The modem is detected when you plug it in but it ends up with multiple installations of the devices unless it is plugged in before you start to boot the machine. This seems to be to do with the fact that it changes mode - initially it looks like a CD so the drivers can be automatically installed under Windows then switches to a modem mode. You can check what you have with

lsusb

you should only have two or three devices /dev/ttyUSB0 /dev/ttyUSB1 and possibly /dev/ttyUSB2 as it also has a built in card reader for a micro SDC card. If you have more it will not work. At one time I had 12 devices listed!

The vmc program adds a link to the Applications list under Internet and can also be run from the command line. There is a debug option I have not tried under the command line. The Modem needs to be plugged in before the machine is booted and the program is run and the first time it asks for set up information. The set up I had to use was

Username: web
Password: web
APN: pp.internet

The APN is unusual as vodafone usually use pp.vodafone.co.uk for PAYG and internet for contract but I got it from the default under Windows and only that seemed to work when I tested in a normal phone as well as in the dongle.

Once I had found out the APN it worked immediately.

I had also spent a long time experimenting with Gnome-pp without success which is why I tried the vmc software. As soon as I found that the APN was pp.internet and that it needed to be set up explicitely I just added the string to set up the default APN for (CID 1) and it also worked immediately. I now use init strings like:

Init2 = ATZ
Init3 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
init4 = AT+CGDCONT=1,"IP","pp.internet"

I am not sure that the init3 is needed - it is the standard set up for a fax modem as used through a mobile phone .

The 'number to dial' is set to be *99# or *99***1# and I use stupid mode to get a quick connection. There is a lot more about Gnome-pp on my main Ubuntu Mobile page including some changes I have made to a file for more reliable connections which I will not repeat as this diary entry will be moved to that area when it is finished. I also tried modifying the /ect/ppp/options file to add an extra delay before connection connect-delay 5000 as I was sometimes not getting a correct DNS delivered. The vmc software did not seem to have that problem.

I have looked at the codes sent by vmc and tried the codes there to set GPRS prefered as an init code. It does not seem very effective but for completeness the codes I have extracted from the vmc source are:

For GPRSONLY set Init5 =AT^SYSCFG=13,1,3FFFFFFF,2,4
For 3GONLY set Init5 =AT^SYSCFG=14,2,3FFFFFFF,2,4
For GPRSPREF set Init5 =AT^SYSCFG=2,1,3FFFFFFF,2,4
For 3GPREF set Init5 =AT^SYSCFG=2,2,3FFFFFFF,2,4

I tried the small program to switch between CD boot mode and Modem mode but it did not recognise the device so I am still into having to check if the devices are correct with lsusb if it does not fire up correctly and pluging in again and rebooting if still a problem.

Overall the VMC software seems to be the way to go and offers reception of TXTs, sending seems to be blocked in the SIM provided. Topup via a vouchure is only available under the Windows VMC or telephone and credit card.

This has now moved to Ubuntu Linux on the Move

Valid HTML 4.01 Copyright © Peter & Pauline Curtis
Content revised: 2nd August, 2020