Wednesday, December 14, 2005

Windows Blues

My computer has finally succumbed to my brash usage and Windows has crashed and it does not boot up anymore. Well, It was not me - it was the sudden power failure that did the damage. I tried booting with various options - safe mode, safe mode with command prompt, last good known configuration - none of them worked! I knew I had to spend a good one hour doing the repair installation. I got a bootable CD to start the repair installation - to my horror, the installer listed C: as an "Unknown" partition. Goddamn it - there was a very good NTFS partition there!

I decided to pursue this and booted to linux to see whether I could access the windows partitions. Viola - All the NTFS and FAT32 partitions are accessible from linux. I could copy documents and even edit files! If linux can read the partitions, why the hell windows can't?! I went about searching for an answer to this.

The answer most probably lies in the basic dual boot configuration. Having a dual boot machine with 2 operating systems is something like having 2 girlfriends! No - its not very pleasant if one of them gets to know about the other. Something very similar was the case here too. The windows installer probably looks for its signature in the MBR of the disk. It found that linux (the "other" girlfriend) had filled up the MBR with the bootloader - it just (grows jealous and) refuses to recognise the partition.

I'm just guessing that this might be the issue. I'll have to do some more experiments to confirm this.

Moral: Things always seem fine until something screws up! (Is'nt it always?! - DUH!)


  1. somehow a rather comforting post.. :-)

  2. Good one dude! :) The analogy was nice!

  3. Where did this happen? At home or office? I hope it's not your new laptop that got screwed up..

  4. afaik ,
    windows successfully detects all its partitions if they are not "corrupt". whats "corrupt" to windows need not be "corrupt" to the way linux ses a partition. when linux is up and running, and "mount" is issued, it loads up the ntfs driver, so it depends on how this driver is written.. and as is the case in most linux bassed implementations, missing details are usually assumed and somehow ur data is made available... but windows, as it always is, is very particular about data. so if it sees some minor abnormalities it flags it as an error. one reason may be cos this minor defect may later make ur day worse when u hav critical data in ur hard disk (linux does the same thing for ext2/3fs partitions).

    MBR is NOT made "corrupt" by GRUB or any boot loader..
    the bootloader software is put in the first 480 bytes of the MBR and the last whatevr chilre bytes (512-480 )will have the partition information.

    and when windows read this last 32 bytes of partition info, it may have got the wrong value for the partition "type" .. u can do
    "$ dd if=/dev/hda1 (primary disk) of=/root/mbr.out bs=512 count=1" . when this command is run, u'll get all weird characters output, do octal dump on the output file and u'll get human readable form.. there, the value of partition type in first 8 bytes of last 32 bytes will have become corrupt cos of power surge or invalid shutdown or whatever... u can also see that the grub bootloader has some error messages stored in case grub's stage 1 could not initialise and load the boot loader's stage 2.

  5. Sanjiv - comforting? Man?! I'm dying here to save every byte of my precious data!!!!

    Keshav - Guess whose idea it was...

    VV - Thank god no! Its my desktop! Laptop is my only saving grace now!

    Girz - Agreed that lilo or grub do not "corrupt" the MBR/boot sector. BUT, to windows IT IS "corrupt". Now, we can start talking about what corrupt is and what its not. But just follow this link and see if anything makes sense.
    I want to do this test. Once I have a running Win XP and linux dual boot setup with grub/lilo, I want to start the windows installer and see if it detects the C: partition as an NTFS volume. That would probably clear my doubt whether the linux boot loader was the culprit or the power failure!

  6. learn to let go dude...

    there's no joy like starting your collections from scratch...

    although god save the guy who'll cause my hard disk to crash ;)

  7. Sanjiv - "Learn to let go" : AH!! Where have I heard that before?! Dude it may be a joy to build one's collection from scratch (Actually I don't need to 'cos I have all of my music collection backed up on my laptop!) But its a real sorrow to lose some precious files! You know what I mean?!


What I want to say is: