Tuesday, 5 January 2010

Grub Error 17

Yesterday i had a problem with my laptop caused by formatting a linux partition without first removing the bootloader. usually this is a simple fix and can be resolved by booting a windows xp cd, using the recovery console and doing a fixmbr.

This would have been great if i could get into the BIOS to change the boot order so i could set CD to boot before the hard disk. Unfortunately BIOS would not let me in as it was not accepting any keystrokes on boot. After exhausting almost every option and beginning to take the laptop apart to remove the CMOS battery in the hope the default setup has Cd boot before HDD i thought, i know, i reckon a Linux live Cd could sort this out. I had tried windows 7 and Windows xp CD's but neither would read the hard disk in the laptop

I had to remove the hard disk and put it in another laptop, then i could boot from a Live Cd and fix the MBR.

i used an ubuntu 8.04 cd in the end which had almost everything i needed. I had to install lilo to write the boot record as ms-sys was not accessible due to Microsoft making them pull it from the repository.

lilo can be installed with something like

sudo apt-get install lilo

after this is installed you need to find the partition with the mbr. This can be seen with the following command to list hard drive partitions

sudo fdisk -l

once you know the drive with the boot sector you can then do something like

sudo lilo -M /dev/sda mbr

This will overwrite the MBR. after this had run i put the hard disk back in the existing latop and it booted back into windows 7 with no problems.

thanks again Linux! so many times you have saved me!

Custom Globalization issues in deployment

I thought I should start my first post with a recent problem i have encountered.

I had a web application that used a Custom Culture to change the text of certain fields on the pages for a specific customer. For this I created a custom culture and created separate resource files for the pages.

This all worked fine on my development machine but when deployed to the production server the site would not run wit the following error...

Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS0101: The namespace 'Resources' already contains a definition for 'Global'

This was caused because there was no custom culture on the server so both resources were being compiled into the same class.

After a bit of searching I found Microsoft Locale Builder this would have been perfect but unfortunately it only works on windows vista!? This gave me the idea of creating my own.

Below is the code listing for the form, it can be used to create a custom culture based on a previous culture on the system. Custom Cultures can also be removed.