Making ServWise
50% off all hosting at servwise

Archive for the ‘windows’ Category

Windows the Boot

Tuesday, March 27th, 2007

Yeah, Windows sucks. It is truly awful. But a necessary evil for myself and many others.

One of the suckiest things is how it refuses to accept that there can be in existence any other operating systems in the world but itself.

So I have a PC, and had a Windows and Linux install for some time running together, with grub in the MBR handling the booting both Linix and Windows. Or at least passing booting off to ntldr to bring windows up. No problem.

But then I wanted to reinstall Windows in another partition. It is always good to do a reinstall of Windows into a fresh partition so that you can copy over bits and pieces of the old install as you need them (notably stuff in the Application Data folder in your profile). So it was time. My Windows installation had gotten slow and bloated after only six months, as I randomly install software to make the experience more palatable. My new strategy was to run everything from Linux primarily, and do Windows stuff from a windows VM on my server, and just use native Windows for games.

I did try and use VM Server as a way of reinstalling Windows into the partition without having to leave Linux, by creating a partition based disk for the vm. VM Server reports that the partition table is invalid if you do this on my install. There are a few people who have experienced this before, but none seemed quite the same as mine, and I didn’t get to the bottom of it.

So it was time for a native install. So a PC fairly useless while Windows gets on with copying itself. Except it didn’t work. This was new – most of the problems you get with Windows I have encountered one time or another but this one I hadn’t seen.

The CD would boot, and do the “Checking Hardware configuration” message that precedes the blue install screen, but it never got to the blue. It just cleared the screen and hung.

So.. a bit of a googling (sorry Google for using your name as a verb, but seriously, it is one now) and I discover that Windows XP install will not work if there is a boot sector that it doesn’t know. Ie, if there is one present, and it isn’t a Windows one. Either that or the partition tables aren’t aligned the way it expects.

So a bit of monkeying around later – reorganising the partitions in a way that I did not want, and having to boot the disk with no hard drives connected, I finally got Windows installed. Of course my boot sector is now trashed with the Windows one instead of grub.

But clearly putting grub back is only going to give me problems next time I want to wipe windows.

The good news is that you can boot Linux – essentially chain grub – from NTLDR – the windows boot manager. There are a stack of articles about it around, and from my experience GRLDR doesn’t work – this is the grub4dos boot manager that should be able to read and process a standard menu.lst file. The documentation is erratic, and says that it must on the boot drive, but cannot be on ntfs. Not sure how you resolve that if your boot drive is ntfs.

So the other way is to get a copy of the grubbed boot sector, make a file out of it, put it in the root of your boot drive, and just add it to boot.ini.

You need to understand which is your boot drive. In my case grub was installed in the MBR of the primary disk /dev/hda. After all this stuffing around, that had been wiped, so I reinstalled it into another drive:


# grub
grub> root (hd0,7)
grub> setup (hd0,7)

This will install grub into /dev/hda8 (the eighth partition of the first ide drive – grub itself numbers partitions from zero). If your first drive is SATA, then this may refer to /dev/sda

Now make a copy of the first 512 sectors:


dd if=/dev/hda8 of=linux.boot bs=512 count=1

Copy this to your primary Windows partition – wherever boot.ini resides (usually c:\). Then edit boot.ini and put in the line:


c:\linux.boot="Linux"

Reboot, and this will appear in the standard boot menu for Windows.

Windows Symbolic Links

Tuesday, October 31st, 2006

Just found out about “junctions” which is NTFS speak for linux style symbolic links.

There is always a battle with Windows with getting stuff installed where you want it.

Documents and Settings, and Program Files, default to the system partition. This is exactly where they shouldn’t be. The system should be on the system partition, and the rest of your stuff should be elsewhere, partitioned off sensibly.

And where is the “advanced” button in Windows to specify where you want the default locations? Doesn’t exist. The best you can do is modify the setup.inf on the cd – which means burning it of course. I must do this at some point, but several installs later I cannot be bothered fixing something that should not be broken.

So after each install it is a case of moving stuff and hacking the registry to make it all work. And does it all work? No. Moving Documents and Setting is *hard*. My last install I caved. 2004 was my last rant about it. So right now it is sitting on the system partition.

But now I find that auto-updates don’t work. And this is because I have moved Program Files, along with the contents, and fixed the registry so it knows. And yet Windows Update insists that it cannot do what it has to because it has moved. Why? WHY?

So what if there was something like symbolic links for Windows? Then you can move stuff wherever you like and just link it, and windows will think everything is where it is “supposed” to be.

Well, of course, there is. Called “junctions”. There is a utility over at sysinternals to allow you to create them, and it works a treat.

I consider this a compromise rather than a solution.

Windows Redefines "Don’t Delete"

Thursday, June 29th, 2006

Finally it was time to build Windows from scratch again. I had been using the same Windows XP installation for the past three or four hardware platforms. I know, this is sheer lunacy, but Windows takes such an effort to get together, and after all these years I had it working how I want it, and to start over always seemed too daunting a task.

Except for all the bluescreens of course. A few too many, and a windows build of several years old almost takes as long to boot up – so a bluescreen is a double wammy. I lose whatever I was working on, plus have to wait 15 minutes boot time before it is usable again.

But the point of this story is user account deletion under Windows XP. At one point in my migration from old to new, I needed to delete the account on my old windows install and recreat it on the new. This was carried out in the new Windows installation on a new partition, but the user account profile I wanted to delete was pointing to the old Windows installation on the old partition. If that makes any sense.

Nevermind. So I just wanted to delete the account. Just the userid. And when you attempt to delete an account, Windows says “do you want to delete it all, or just the account and leave the files?”

Which is great – I just wanted to delete the account. And leave the files. So I agreed to this with good old windows, which then informed me that it would move all the files of the user to a folder on the desktop. And off it went. Now the old profile and the current profile were on different partitions, so this move would actually be a copy and delete – so would take forever to move the 4gb profile I had accumulated (thanks Google Desktop Search). So I waited.

Then bing it was finished. So the account was gone and the files were in this folder here, and I could start moving them to my new account. Except of course they weren’t. Oh the folder was there, and in it was another couple of folders, containing my old desktop icons, my documents, my music and my photos. But nothing else.

So where was the Application Data folder? Where was the Local Settings folder? Gone. Deleted. Deleted even though Windows promised me that it wouldn’t. Because now I discover that what it meant was: “I’ll copy every thing that I think you should be concern with, but delete the rest.” And of course, why would I want to concern myself with all those system folders? Apart from the fact that the Application Data folder contains my email. And my bookmarks. It also contains a whole ton of other data that the various applications I use rely on.

And I’ll bet bottom dollar that if I was using outlook, it would have saved the pst, and if I was using ie, it would have saved the bookmarks folders.

But no, apparently “don’t delete” means, delete most things, but leave the documents. The moral is to not use the control panel account management for this, but to get into the Users and Groups MMC plugin and delete from there.