Showing posts with label windows. Show all posts
Showing posts with label windows. Show all posts

Sunday, June 03, 2007

Restoring Windows XP on a Toshiba Satellite running Fedora

Last week I posted an article describing my experiences converting over my new Fujitsu Lifebook over from Microsoft Vista to Ubuntu Linux. This week I talk about going the other way for my old Toshiba Satellite laptop, restoring it back to use Windows XP using the Toshiba OEM Restore disk. I need to do this because the laptop will now be used by my (elementary) school-going son, who uses Windows XP on the family desktop computer and at school, so we don't want him getting confused switching back and forth between Linux and Windows. There are also a lot of games and educational software which run only on Windows and Mac OSX. I suppose I could get him to run these over Wine, but when I last tried it couple of years ago, I could not get sound to work, so I did not even try this time. Finally, according to my wife, one Linux snob is one too many for any given household, and we don't want to argue with that :-).

Just sticking the OEM Restore CD in and restarting the machine should theoretically be all that I needed to do, but if that was all it took, I wouldn't be writing this up. What I got instead, at the end of the restore process, was a machine that, when switched on, came up with an empty black screen, with the word "GRUB" on the left top corner.

Searching on the net, I found instances similar to this situation, where the machine responds with "Grub error 17". The problem was that GRUB (The Grand Unified Boot Loader that most Linux distributions use for booting) is written on the Master Boot Record (or MBR). Windows also needs to boot using information from the MBR. But apparently, the restore process cannot write to the MBR if it is already occupied by GRUB.

The solution is to clean up the MBR somehow. I found a rather vitriolic but quite detailed article from a person who made the switch from Windows to Linux, and was describing his frustrations and switch back after an extremely unhappy few weeks with Linux. The article describes the problems with "Grub error 17", and mentions the Ultimate Boot CD (aka UBCD), which solved the problem.

The Ultimate Boot CD is a free collection of PC system software tools, which can be used to boot up a PC. It reminds me of my system software tool collection (an overflowing case of 5.25" floppy disks) when I worked in software support many years ago, but it is of course much more comprehensive. Its available as an ISO, and I was able to burn a CD-RW from my Ubuntu laptop by downloading the ISO to my Desktop, right clicking the file and select "Write to CD", then "Ok" to actually burn the image to the CD.

I then booted the laptop with the UBCD, selected Filesystem Tools, then Partition Tools, then XFDISK (Extended FDISK). I then removed the one single partition and exited. Restoring from the OEM Restore CD and restarting sent me back to the original GRUB prompt, although it did tell me that it was doing a quick format of the C: drive.

I tried again, rebooting from the UBCD, selecting Filesystem Tools, then Partition Tools, then MBR Tools. A menu comes up, and I selected "Wipe MBR". Restoring from the OEM Restore CD and restarting worked this time. I booted into the original Windows XP operating system that the machine came with.

Anyway, that was all I had this week. While it did not take that long to write, it did take me a while to come to this solution. Having destroyed couple of CD-Rs before on my Fedora system, I was not sure I would be able to burn the UBCD disk right, but ultimately I found an Ubuntu tutorial which described the process. I am also relatively clueless about Windows and DOS, having stopped using both regularly quite some time ago, so it was quite a learning experience. My biggest concern was to not destroy the disk by using a wrong command, so I was extra careful, which takes more time. But I guess things turned out OK at the end.

Tuesday, April 11, 2006

A defense of conformity

I have recently started using Jetbrain's IntelliJ IDEA Java IDE. This is a company standard; the employer pays for all the developer's licenses. Doesn't sound like such a big deal, except that I have been one of the few developers in the company who used Eclipse instead.

Before starting to use Eclipse, I used vim for a long time, since my first job many, many years ago. I continued to use vim even as the early adopters evaluated various IDEs and settled and grew comfortable with IDEA. I still think that IDEs dumb people down, at the very least an IDE user has less knowledge of the libraries he is using, only because he does not look at the Javadocs as often as someone using vim or emacs. However, IDEs are very useful for autogenerating large amounts of boilerplate code that have become part of J2EE programming (both classic and POJO based), and are useful to start writing code quickly using unfamiliar libraries. So after a particularly long and ardous project involving writing large quantities of JDBC code, I decided to give IDEs a try.

Eclipse was my first choice, because I do some open-source Java programming on the side, and I figured that way I could learn one IDE that I could then use both at home and at work without running afoul of any licensing issues. Soon I was using Eclipse quite competently, keyboard shortcuts and all, which made switching to IDEA all that more difficult. The one thing that Eclipse did not shine at was its JSP editor, so I purchased a yearly subscription to MyEclipse and installed the plugins at work and on my laptop. This was definitely a vast improvement, but I still problems with Eclipse crashing when I had to open multiple (large) projects in Eclipse.

Other developers have had a lot of success with IDEA and our large codebase - IDEA is quite adept at sucking in vast quantities of Java and JSP code and managing it all, so in desperation I just closed down Eclipse, and fired up IDEA on the same codebase. The first few sessions were pure hell as IDEA would freeze spastically every once in a while as it garbage collected, and I scurried around mousing through the menus, looking for my favorite Eclipse feature equivalents in IDEA. Giving IDEA the same amount of memory as I had allocated to Eclipse (512MB) alleviated the garbage collection freezes somewhat so they were less noticeable. It also helped that I had grown somewhat accustomed to these freezes. Its better now, I can code at a reasonable speed with IDEA now, using some keyboard shortcuts and some mouse clicks, still not as well as in Eclipse, but I guess that will come with time. It also helped that IDEA is an entrenched company standard, so there are standard configuration files that embody the coding standards, so I did not have to set them up myself. And of course, JSP support is phenomenal.

This got me thinking. My desktop at work and my personal laptop both run Fedora Core 2, where the supported company operating system standard is Windows XP Professional. I consider myself lucky that my employer allowed me to install the OS of my choice on their machine. My initial rationale in wiping out Windows XP and replacing with RedHat 7.3 was that Unix/Linux is a better program development environment. The people running Windows XP on their workstations have Cygwin or Putty installed, and they routinely log onto shared Unix machines over ssh. With a Linux workstation, I can do more work locally rather than on shared machines...or could.

With the growing availability of open source software on both Unix and Windows, that argument is not really very valid anymore. Sure, if I was doing Unix OS level programming (tools or system), then I can see why a Unix workstation would be a more obvious choice. The programming environment that my team uses Java, an open source web server, application server and a database, all of which install and run equally well on both Windows and Linux. I put all my code in my shared home directory, which is cross mounted over NFS on every development Unix machine, Windows users use a SAMBA mount instead. IDEA and Eclipse run well on both platforms. As a web application developer, a significant portion of the stuff I code is written for web browsers, and since Microsoft IE is still the browser of over 90% of internet users, the page must look good on IE, and IE is only available on Windows. Firefox, the other major browser, is available on both Linux and Windows. The two major scripting languages that I use, Perl and Python, run equally well on both environments.

And frankly, I don't have the time to administer TLC to my Linux workstation anymore. There's a reason that its still stuck at Fedora Core 2 while the rest of the world has moved to Fedora Core 5, or at the very least, the stable and mature Fedora Core 4.

I think the most compelling reason for me to run Linux is that I am more comfortable with a Unix-like OS. With a Unix like OS, I can use the command line and script things that happen repeatedly, unlike the point and click interface that Windows offers. I have used Cygwin for the command line interface on Windows in the past, using Perl to automate tasks. Unix also offers a hierarchical directory structure starting from the root, while everything above C:\MyDocuments is pretty much hidden from the Windows user. Of course, it is possible that enough time has passed for me as a Linux user to forget how bad it was using Windows, but I think that the time may be ripe for me to consider switching back to Windows.

Yet another argument in favor of this decision is to tally what I have to give up to continue to use my favorite OS at work. As I have mentioned above, Linux no longer provides me with a compelling advantage over Windows as a development environment. However, the job of a developer is more than just writing programs. It is also communicating over E-mail and IM, scheduling and attending meetings, creating and reading documents using Word Processors and Spreadsheets and creating the occasional presentation or architecture or system diagram.

I use Gnome's Evolution for E-mail and Calendaring and GAIM for Internet messaging with Yahoo's service. Evolution (I use version 1.2, the latest available on FC2) is competent for the most part, but routinely crashes when downloading from POP3 mailboxes. I read somewhere that its because Microsoft does not honor some aspect of the POP3 protocol, but I would think that Evolution would have provided an workaround for that, much like SAMBA did in a similar scenario. It does support Calendaring, but if I have to schedule a meeting, I have to go to my secondary PC with Windows XP installed, open up Outlook and issue the invitation. As for reminders, there have been quite a few occasions when the alert died but Evolution chugged on, which meant that it did not pop up the alert when it was time for me to get to a meeting, causing me to miss or be late. Not too good for the image, I can tell you that. I have had no problems with GAIM, but it does not offer functionality that is significantly greater than Yahoo's YIM program.

For creating documents, I use plain text most of the time, since it can be more effectively tracked on a source code control system. However, when the output needs to be read by business, or when filling out a standard template, I use OpenOffice Writer. Writer can read and write Microsoft Word files, however, there is some formatting information that is lost, especially if the some of the template format involves corporate logos. I use the OpenOffice Calc spreadsheet tool for doing project estimates and tracking times. Calc, like Writer, can read and write Microsoft Excel files. Unfortunately, I haven't figured out how to do graphs, although I confess that I haven't looked hard enough - I usually just switch to my secondary Windows PC and run Excel instead. I have also used OpenOffice Impress to create presentations, and I must say that it is almost as feature rich as Microsoft PowerPoint, at least the features that I use. So while each of these office suites are good in themselves, against an entrenched Microsoft standard, they come up short. It feels a little lame to have to apologize for your tools because the output does not look as good as that produced by an equivalent tool with the same effort.

I have created system diagrams in the past using Microsoft Visio, but I use dia nowadays, and I must say that I am quite happy with it. Of course, there is room for improvement, but its not too bad. I must say that I like it a little better than Visio, but that may be because of all the hassle I got about licensing when I requested that it be installed on my Windows machine in a previous job.

Of course, one advantage of Linux is often cited - it being immune to viruses. That is due in part to the stronger multi-user security model in Unix, but also due to the fact that there are not too many people writing viruses for Linux. And corporate IT support invests in various safeguards that make it quite unlikely that your work PC will be infected by viruses in any case.

So looking back, Linux on my desktop at work doesn't seem to offer many advantages anymore. I can see myself still preferring Linux over Windows if I was running my own company. I would have reduced software licensing costs and it would be easier to use just because I am more familiar with them. In such a case, I would have to pay (or factor in time) for support myself, so not having adequate support would also be a non-issue. I could also generate corporate documents that would go easy on the formatting, so that they would be equally at home in OpenOffice and MS-Office. The principal problem that makes Linux not such a great option at work is that most people do not use it, which means that services and resources are not geared to support this environment, even though in my mind, it may be the better one.

Monday, January 16, 2006

Windows XP - Reinstall and Network

Last weekend, I reinstalled the Windows XP OS on my wife's laptop. I have pretty much given up using Windows since about Windows 2000, when my employer allowed me to switch to a Linux desktop. My laptop had already been converted to Redhat 9.0 a few months before that, and now runs Fedora Core 2. I do have a secondary Windows XP Professional PC at work, although all I use it for is tp rdesktop to it about once a month to check if some Javascript code works on Microsoft Internet Explorer. At home, too, we used to be a more of a Linux than a Windows household, with 2 Linux and 1 Windows box, which changed recently with the purchase of a Dell Windows desktop recently for the kids to play games.

Well, anyway, back to the re-install. The laptop is a Dell Inspiron 1100, purchased new in 2002 for my wife when she decided to go back to school to get her business degree. Dell provided a 1 year trial subscription for McAfee's anti-virus, which I did not renew at the end of that time. So by the time I got to reinstalling the OS in 2005, it was pretty much dripping with viruses, adware and spyware. Fortunately, we did not use this computer (ever) to do financial or other internet transactions, so the most the spyware picked up were google links that my wife went to while doing her research.

Which brings me to a philosophical question. I understand how spyware can create zombie networks out of random computers on the internet and launch denial of service attacks or break cryptos for malicious purposes, and I am sure that this computer participated unknowingly in these, but what of the adware that pops up with "helpful" information to refinance your home and fix your bad credit? Over the last few months, the computer would routinely automatically open 20 or more Internet explorer windows, and slowing the computer down to a crawl. Not surprisingly, my feelings are not too favorable towards the companies marketing to me in this manner, and I am sure that was not the company's intent when they signed up for service with the adware vendor.

The last time I tried to re-install Windows 95 on my old IBM Aptiva, the restore disk did not work. The machine was out of warranty by the time I got around to doing the restore, and I had added RAM and disk to it, so I ended up installing Linux Redhat 9.0 on it. My first attempt in this case was to try to restore using the Dell application software CD, which did not boot. I then found that Dell provides a way to burn an operating system bootable CD using software preloaded on the PC. Not as good an idea as it sounds, especially when your PC is so infected that even pulling up your browser and going to a specific website is a 10 minute project of itself. Thankfully, I finally found the Windows CD that Dell had supplied with this PC. I had specifically requested this disk at additional cost when ordering the PC. I think that companies should provide the Windows CD by default, its the honest thing to do, after all, we are paying extra for the operating system, so we should get it. Supplying non-working restore disks and/or making the whole process of making one so complicated is one reason why customers end up dumping PCs which can be restored to their previous working state. Not so good for hardware/software manufacturers and arguably for the economy, but probably better for the environment and customer's pocketbooks.

Booting with the Windows OS disk and the installation was fairly painless, its just a matter of repartitioning the hard drive to one big NTFS filesystem (the Dell folks had a 9MB FAT partition which I blew away), and installing the drivers for the various peripherals (a Lexmark Z25 printer and a Netgear wireless card). The first thing I did this time was to install the McAfee anti-virus, firewall and privacy manager. These are free (or built into the price of monthly high speed internet access) for Comcast customers, so I did not have to shell out for these. I only wish I had known about the free offer sooner, then I wouldn't have had to reinstall in the first place.

Re-installing the Netgear wireless card involved having to set the SSID of my Belkin 802.11b wireless access point that hangs off on of the ports on my Netgear 4-port router. Since I use WEP, I also had to set the network key. I also use MAC address authentication, but that was not an issue since I was using the same PCI card that I had before. Fortunately, I had all the SSID and WEP key written down in my Belkin user manual, I would have a hard time figuring out the WEP encryption key otherwise.

Installing the Lexmark Z25 printer was a little more involved, I had to download the driver from the internet since I had misplaced the driver disk that came with the printer. Google was my friend in this case, and I finally found the version I required from the good folks at Soft32.com.

Other software I had to reinstall was Microsoft Office. I took this opportunity to not install the free stuff that came preinstalled with the original PC, such as Microsoft Money (I use GnuCash on my Linux box), and AOL and Earthlink free offers. I also installed Firefox, my wife is quite dependent on its tabbed browsing feature, and only goes back to MSIE for sites which require it, such as her university website.

My wife had pretty much given up working on the laptop for the past few weeks, which meant that I either had to copy over all the files she had created on the kid's desktop during this time, or just set up networking between the two Windows XP machines. I did the latter, since that was on my list of things to do, and now was as good a time as any.

To do this, I had to create a network connection on the laptop using the control panel and build the netsetup disk. I found this page from the geekgirls site very helpful in doing this. I then installed the netsetup disk on the Windows XP desktop machine. The share on the desktop appeared on the list of network shares available on the laptop automatically. However, I could not access the share. Turns out that Windows XP creates a bridge network between the two machines, which effectively turns off any network access. Deleting the bridge device and manually mapping a remote drive to the network share allowed me to access the files on the desktop from the laptop. Its important to remember to not have the mapping happen on login, since the desktop will not always be on, and the boot process will hang or have errors.

Next steps? Get my linux laptop talking to the windows boxes, and resurrect my old IBM Aptiva running Redhat 9.0 into a headless Debian desktop, and make it a Samba print and file server accessible from both my Linux and Windows boxes. Not going to happen for a while though, got too much going on at the moment, but I will write about it when I do.