Monday, April 28, 2008

Installing windows on a laptop that had linux

At my office, most of the people use macs, and of the people that don't, most use windows but some use linux.

I don't really care what people use, but when someone wants a windows laptop and the only available hardware in our inventory used to have linux on it, I need to pop in the old windows installation cd and get windows installed, right?

Problem is, the windows installer CD will not install by default onto a hard disk that has linux on it.

Why not? I have no idea. I'm fine with it obliterating all the data - I want it to actually. But it will say "Setup is investigating your something or other..." then get stuck on a black screen. The installer doesn't really start.

The solution? Boot the machine with some linux install cd (or something similar that you have handy) and zero out the first part of the hard disk. The first 800MB did it for me (it did that before I could even hit ctrl-c, probably just a few MB is enough). It is not enough to just re-partition the drive without zeroing out some data. (specifically I popped a fedora core install CD into the drive, typed "linux rescue" at the boot prompt, told it to skip networking and skip finding linux installs, then at the root prompt said 'dd if=/dev/zero of=/dev/hda bs=1M', let it run for a second, then hit ctrl-c, then when the prompt came back, said 'exit' and rebooted)

After that, you can use the windows installation cd with no issues.

Wednesday, April 16, 2008

$PATH issues on windows

If you're busy perl-scripting on a windows machine, and you're getting unexpected behavior from the command-line utilities your shelling out to (say, 'find', or something), it may be because instead of getting the utility you think you're getting (/usr/bin/find, for example, from cygwin) you're getting something totally different (dos find, for example)

This can lead to a lot of confusion when you try to figure out why you aren't getting consistent results between systems you're working on.

Solution? Use full paths. If you want the cygwin find, say "/usr/bin/find" or you just can't be sure.