Adding disk space Debian Linux on VMWare

This is for an installation of Debian Linux (Lenny) that is run as a VMWare virtual machine on ESX server. The Debian install is also using LVM Logical Volume Manager. Refs: Overview at WikiPedia and the detailed How-To at tldp.org.

We had to increase the physical drive space on the debian system and while I verified some of what I planned to do with other sites I found a number of steps missing if I wanted to be ‘sure’ of being able to repeat the exercise.

Once the VMWare virtual disk had been allocated/increased I could start with the work inside Debian so it could use the space.

The first step was to install parted to manage the partitions as it makes it easy.

[php]# apt-get install parted[/php]

Next, because I want to run in single user mode I cannot use my favourite tool, PuTTy to connect as the SSH daemon will not be loaded. So I use VMWare client vSphere to connect and open a console.

[php]# telinit 1 [/php]

will restart in single user mode – you will need the root password for the server.

Start parted
[php]#parted[/php]

and use the command print free to list your drive(s) / partitions.
[php](parted)print free[/php]

which should display a screen similar to my completed example below. Once you can see the details of the free space you can use the resize command to increase the size of the extended volume. In this example my original part #2 was 21.2GB in size and this process increased it to the 107GB that was now allocated. The following steps will need to be adjusted for the specific system details.

[php](parted)resize
(parted)Partition number?2
(parted)Start? [255MB]?255MB
(parted)End? [21.2G]?107GB
(parted)print free[/php]

For my change the result of line #2 in this is correct as the partition is now approx 107GB in size rather than 21.2GB. In the next step I setup so that the logical volume #6 will be added.

Parted console after completing the addition of sda6 space

Once the extended partition is configured the server will need to be restarted.

[php]#shutdown -r now[/php]

Still using the VMWare console, as the startup screen appears the option to select single user mode will come up. If you miss it and start up in multi-user mode just use the telinit 1 command that we used earlier to return as single user mode.

Use cfdisk to view the disk setup.

[php]#cfdisk[/php]

This screen shows the completed sda6 logical drive.

Screenshot of cfdisk with updated partitions.

To allocate the free space arrow down to the free space and press the letter T for type. Select the type of drive that is required. In this example I selected 8E from the second page of types to use with Linux LVM.

Select Write from the command menu and yes to write the allocation table information for the new volume. In this case it is allocated as sda6.

Quit out of cfdisk.

At this stage if you are not using LVM on the server you will need to format the drive and add it into fstab, etc., however this server is using LVM and these are the next steps.

There are three levels Physical Volume, Volume Group, and Logical Volume. Using the lvm shell (good with help screens) or commands direct at the prompt (if you know what you are doing).

[php]#pvcreate /dev/sda6
#vgcreate new_volume_group_label /dev/sda6
#pvdisplay[/php]

Adds the Physical Volume (pv) into LVM while the vgcreate adds a new Volume Group (rather than extending the existing VG) and pvdisplay just presents the confirmation that its all worked.

[php]#lvcreate -L -n
#lvscan[/php]

Once created the logical volumes then need to be formatted or have their file system created.

[php]mke2fs /dev/lvname[/php]

Which creates the file system and then to add the journal setup

[php]tune2fs -j /dev/lvname[/php]

After this add the new drive into /etc/fstab with the relevant entries and directory(s) added.

One last reboot (or two if its wrong!) to check that it will all start up in single user mode and then a full restart and test in multi-user.

SugarCRM Timezones for Australia Daylight Saving

The default timezones in SugarCRM are driven by the file /include/timezone/timezones.php

With changes to the Australian Daylight Saving settings this year, the timezones.php file is incorrect.

As a side note, Trivia: When was DST first used in Australia and in which states did it apply? A: below….

All states that observe DST are now consistent in the application of dates etc. So excluding Darwin, Perth, Brisbane the other capitals can all be set for starting on the first Sunday in October and ending on the first Sunday in April each year… until they change it again!

The format for each of the cities is currently set as follows (SugarCRM 5.2.0g):
[php] 
‘Australia/Adelaide’ =>
array (
‘gmtOffset’ => 570,
‘dstOffset’ => 60,
‘dstMonth’ => 10,
‘dstStartday’ => -1,
‘dstWeekday’ => 0,
‘stdMonth’ => 3,
‘stdStartday’ => -1,
‘stdWeekday’ => 0,
‘dstStartTimeSec’ => 7200,
‘stdStartTimeSec’ => 7200,
),
[/php]
For Perth it needs to be changed to remove all DST settings leaving just the
[php]
‘gmtOffset’ => 480,
[/php]
All the other capital cities need to have the start date to the first Sunday in October and ending dates changed to April which is done by changing three values.

[php]
‘Australia/Adelaide’ =>
array (
‘gmtOffset’ => 570,
‘dstOffset’ => 60,
‘dstMonth’ => 10,
‘dstStartday’ => -1, 0,
‘stdMonth’ => 3, -1, 0,
‘dstStartTimeSec’ => 7200,
‘stdStartTimeSec’ => 7200,
),
[/php]
The use of -1 in the day field indicates the last in the month rather than 1st in the month.

This should apply to Sydney, Melbourne, Hobart, Currie*, Adelaide, Broken Hill.

A final note that applying these changes to a copy of the timezones.php and placing that under /custom/include/timezone/timezones.php does not work and you need to replace the original file in /include/timezone/timezones.php

*Where is Currie? King Island. Off the coast of Tasmania and at one stage they did not observe DST while Hobart did so they had their own setting. Redundant now.

Answer to the trivia Q: Summer 1916-1917 and it was Australia wide. It then was dropped until trialling again in 1942 – 1945 and at various other times over the next 30 years until broadly accepted around 1970 across eastern states.

Windows XP Lost or Forgotten password

You would think that doing something to recover a password or clear a password would be simple. Reading through all the various offerings and comments accross the web it appears that it is not simple and certainly not cheap!

This open source linux based solution manages to combine free and easy.

PC Login Now is available from SourceForge

It’s an iso CD image that you burn to a CD.  Boot the offending computer with this CD and it loads a Linux shell with the PC Login Now application.

Select the operating system that you want to access – generally you will have only one – and click on Next. Select the user that you want to access and check the Password is Empty (i.e. blank) option box and click on Next. You can then select another user or reboot the computer.

Under Windows XP (although I expect this on other Windows versions as well) you will get a prompt to scan your hard disk. I am sure this is a side effect of making the back end system change and not an issue. Let the scan run and then access your Windows system using the local user account with a blank password.

IE8 install issue: ie4uinit ordinal 654 error

I had an issue with a Windows 2003 server today with these errors in sequence.
The ordinal 654 could not be located in the dynamic link library iertutil.dll.
The ordinal 654 could not be located in the dynamic link library iertutil.dll.

Followed by another 4 or 5 including references to ordinal 672 and IEDKCS32.DLL. 

It appears to be related to a failed install of IE8 and because there is no browser Windows update will not run. 

My remedy was to download IE8 installer for Windows 2003 server.

You might need to use another version from Microsoft Downloads.

I ran this installer which then indicated that it was updating IE8 rather than installing IE8 and a reboot was required.

After this Windows update will run but there are no icons for IE to click on, so I added IE8 shortcuts “C:Program FilesInternet Exploreriexplore.exe” to the desktop and all was working.