Lost your Windows/Office install key?

Image representing Windows as depicted in Crun...
Can't reinstall?

I’ve located a very useful piece of freeware. When re-installing Windows on a machine, the only things you need are a working CD/DVD (or USB version) and the installation key. The key is supposed to be stuck onto the machine which is fine is a) it is and b) it’s not been rubbed off by wear and tear.

Such is the case with both my laptop and my netbook.

Thankfully, a company called Mayhem Development have a handy utility available for a free download that, in seconds, presents you with your Windows install key. It states that it works on XP, but I gather it’s also useful if you’re stuck with the bulbous penile pustule of operating systems that is Vista. It may even work with Windows 7.

In addition, it will also recover your Office install key for versions up to and including (to a Beta level) 2010.

The package can be downloaded from Mayhem’s website. It’s tiny, portable (i.e. it doesn’t install – you just run it) and as mentioned, completely free.

Enhanced by Zemanta

Messing with hard drives

Hard disk dissection
Copying these isn't that simple

I’ve been randomly offline a lot over the last few days. Partially because I’ve been visiting friends and family, partially as I’ve been migrating hard drives in my laptop. Again.

Currently I run Windows XP and Ubuntu Jaunty Jackalope (9.04) – predominantly the latter, though I keep the former around for a couple of utilities and for checking things when I’m doing support. I’ve also decided I want to install the Windows 7 release candidate I downloaded. However, disc space wouldn’t let me do that without ditching one of the other OS‘s so I turned to Amazon and ordered a 160Gb ATA drive (the largest available in 2.5″ format, I think) and an external caddy into which to place the soon-to-be-spare 120Gb device.

The procedure should be simple with the right tools:

  1. Attach new hard drive via USB
  2. Mirror internal 120Gb onto USB 160Gb
  3. Use some partition software to increase the size of data partition, leaving space for Windows 7 install
  4. Remove 120Gb and swap it with the 160Gb which becomes my internal drive

Of course, these are computers. So it wasn’t going to go smoothly. Especially with the mixed operating systems.

First up, the hard drive enclosure I bought didn’t seem to like the 160Gb drive. If I connected it under Ubuntu, it detected it fine. Windows, however, did not. It “bing”ed to say a USB device had been attached, then never let me see it. Not even through Disk Manager so it wasn’t the fact that it was empty. I couldn’t even create a partition. If I rebooted the machine while the device was attached, the reboot stalled on the BIOS screen.

I disassembled another enclosure I have and tried that with more success. Reboots were fine and the drive was detected under both OSs. Hopefully the new enclosure would have more success with the older 120Gb drive I was soon to have spare.

Next step was to mirror the drive. I tried Paragon Partition Manager’s imaging (which has worked for me in the past), but it kept getting partway through and then rebooting with only a fraction of the drive copied. I began to worry about the new disc, but an attempted surface scan looked like taking 24 hours+.

Instead, I downloaded the (simple and free) Easus Disk Copy program. Burn the ISO onto a CD, reboot with the disc in the drive and away you go.

Slowly. Very slowly indeed.

The initial estimated time was around an hour. The copy eventually took a smidgen under 21 hours.

I had planned on using GParted to shift the partitions around, but it seems it’s not capable of doing this. What I needed to do was to alot roughly half of the increased 40Gb to my FAT32 data partition and leave the rest unallocated so that Win7 could use this when I installed it. So, back into XP and Partition Manager Pro for this task.

Before the repartitioning would complete, I had to run checkdisk on the two FAT32 source drives. On my copy run, it had to come up with read errors. In all, there were 200 and PMP would not continue until these were cleared.

So off I went to play Lego Batman and Guitar Here while the checks and the data migration occured. Finally I had a hard disc with everything organised as required. Phew.

Out with the old, in with the new, reboot… and a screen full of flickering “GRUB“s. No boot menu, no progress. Ah. By moving all the partitions around, I’d shafted GRUB. And possibly the MBR on the boot drive. Here’s where it got technical.

Step one was to repair the MBR and this is where having a bootable CD/DVD with your operating system on is very useful. Laptop manufacturers can burn in Hell if they don’t supply these. If you don’t have one, download it via a Torrent. You’ve paid for a license, there’s nothing wrong in having a copied disc with the software on in case you need to fix it.

Quickly boot off the Windows CD, go to the recovery console, boot into the Windows install on the C: and run one command:

fixmbr

It takes less than a second and on reboot, the PC went right into Windows. A step forward, but still no GRUB so I couldn’t access Ubuntu. Out with the 8.10 CD that I have kicking around, and into a Live session. With a terminal open, the commands to fix things weren’t too hard (thankfully).

sudo grub
root (hd0,5)
setup (hd0)

Well, it would have been nice if it were that simple. First of all, finding the correct partition to use in “root” takes a little digging.

As I’d jiggled things around, what had been (0,4) in my old setup had been changed to (0,5) – this can be discovered by running the command:

sudo fdisk -lu

Assuming you only have one Linux install, only one of these will be labelled “Linux”. Take the number “x” from the left column “/dev/sdax”.

That gave me (0,5) as I used. However, I then got an “Error 12: Invalid device requested” when running the “setup” command. A lot of digging online got me a solution to this. First “quit” out of the grub program to the command prompt again. Then:

sudo fdisk /dev/sda

At the prompt that comes up, enter “w” (no quotes) and hit return. Then repeat the grub commands listed above.

Finally:

sudo gedit /dev/sda/boot/grub/menu.lst

And ensure all the menu entries are correct. As I said, I had to change all my (0,4)s to (0,5)s.

Save, reboot, clap with glee.

Next step is to install Win7, which is tomorrow’s little job. I fully expect to have to repair GRUB again afterwards. Windows (all versions) has a habit of deciding that all other boot loaders are “wrong” and places itself before them. At least I’m expecting it!

Reblog this post [with Zemanta]

Windows or SAMBA – who do you blame?

Ubuntu (Linux distribution)

WARNING: very dull techie post coming up. You have been warned.

Had a problem yesterday trying to get a SAMBA share on our Ubuntu box to allow access to one of the PCs. The solution is very simple and I notice a lot of other people online had this issue so I’ll detail it here. Hopefully someone might find it and it’ll be of use.

Our scenario is one Ubuntu machine running as a file-sharer / backup box / web server and several Windows XP desktops. SAMBA controls around half a dozen shares, all bar one of which are publicly read/writeable with no logins required. The other requires a login because it contains accounts data. If anyone wants to see the smb.conf for that, then just ask.

The problem I had was just after I copied all our accounts data from a shared desktop drive to the Ubuntu share. The idea is to get rid of those constant cries round the office of “is anyone in the accounts share? Can you log out because it won’t let me in!” and also to provide some security as well as data redundancy. I copied said files, then went to one of the desktops to access the share and ensure it worked. This PC had already attached with no issues to a handful of the other (insecure) shares.

I added a Network Place of \servernameaccounts and double-clicked. Up popped the password prompt, username and password entered… the usual Microsoft networking pause… and:

Multiple connections to a server or shared resource by the same user, using more than one user name, are not allowed.

Bugger. I went back to the server and checked the permissions. Then I looked at the message. It’s telling me about users. So I created another user with similar permissions and tried to log on again. Same problem. Then I looked at the error again. Carefully.

It’s a Windows error, not an Ubuntu or SAMBA one. It’s complaining that this user – the one on the XP box – is trying to access the server twice with different usernames. Which he (in this case) isn’t allowed to do. He’s connected as “nobody” to access the insecure shares, and now I’m trying to connect him as “accounts” to get to the secure one. This has to work as some staff will need simultaneous access to both types of share. Windows has no functionality to “log off” network shares – even a reboot doesn’t always disconnect it, though I’m aware of a registry key fix that solves this.

A dig on the internet offered a few clues, most relating to deleting permanent net shares and mapped drives. Then I spotted something ridiculously simple. Windows itself is what’s preventing you doing this. It stores the name of the server you’re accessing and the user name you’re connecting with. If you make another connection to “servername” with a different “username” without ditching the first, then the error appears.

Thing is, it’s very literal how it stores the server name. And it seems there’s no genuine reason why you shouldn’t be able to connect twice. Windows just stops you. I assume you need a “better” version of Windows to be allowed to do it or something (like the inbuilt crippling of filesharing in the desktop versions, limiting the number of connections so you have to move to a server OS).

So you should be able to connect, but Windows stops you. So how do you get around it? It’s stupidly simple, really. Refer to the server differently.

For all the insecure shares I’ve now got all the PCs configured to go to \servernamesharename.

For the secure share it’s \server-IP-addresssharename.

Easy as that. Same server, two ways to refer to it, error ignored, two fingers up at a pointless restriction. I’m curious to see if mucking about with the hosts file would allow infinite connections to the server, by providing multiple aliases for the same IP address.

Anyway, problem solved and another step closer to heading home in a couple of weeks.