2007-03-22

The horror! The horror! (Hiding Vista partitions from one another)

I'll cut to the chase. As you know, Vista's new bootloader is complate PITA, because it aims at taking control of all bootloading activities without asking (how rude!), and in typical Microsoft arrogance style, it thinks it can do a better job than you (how inconsiderate!).

Therefore, if you have any combination of XP, Vista, etc... that can be detected, you're pretty much screwed because Vista will insist on unifying the booting of all Windowses for you, which you might think is nice... until the day you remove the OS on which the bootloader is installed, and you realize that you can NO LONGER BOOT THE OTHERS. Don't believe me? Try that little experiment:
Install Vista. Then install another Vista on a different partition. The boot block for the second Vista will be written on the first partition. Now format the first Vista and do your darnedest to boot the second Vista. No way Jose: There's no boot block on that second partition and it will never boot. Well, if you don't mind me saying, that's a really gay way of operating a system.

So there's no way I'm gonna let that happen when I want to have a SINGLE bootloader under my COMPLETE CONTROL!

And it is a little know secret that, despite insisting on being ZE bootloader, Vista will happily receive the boot from another botoloader, as long as it has been installed on a machine where it thinks it is the only Windows OS, which is why it's a good advice to install Vista first, or unplug disks where you might have other Windowses installed. Unfortunately, that method of hiding Vista from Vista (I deem it likely that Vista is horrified from looking at itself in the mirror, hence the title) will not work in our case, where we want to have both Vista32 and Vista64 installed on the same disk. Oh, and you can try to change the partition type of the first Vista you installed, that won't work either. Windows is apparently able to detect itself regardless of the partition type We'll need much more powerful Maßnahmen gegen die Gewalt this time round.

Our solution then: Change the partition type AND fill the Windows partition bootblock with zeros. This is where we open our Swiss Army Knife of anything advanced: Linux.
Whatever you do, you should always install Linux before doing anything else (and be able to boot into it from a CD, floppy, whatever, even if the MBR is erased). Please chant with me now my brothers and sisters: "There is no salvation in the computing world but in Linux".

In my case, Linux is installed on HDD1 and the Vistas go to partition 1 & 2 of the RAID0 ICH8R array (HDD 2&3). You will need to have dmraid setup in Linux to access the ICH8R RAID partitions, but I'll post on that later. So the course of operations is:
  1. Unplug HDD1 and install Vista32 on the first partition of the RAID0 unit. I even let Vista do my partitioning on this drive. Probably not the best idea (cfdisk seems to have problems with how Vista partitioned the drive, but fdisk is fine and see nice primary partitions there). I tend to use the Vista partitioner when I don't really care because in Vista, Megabytes are Megabytes, and not these lousy 1000^2 Megabites cfdisk and others insist on using. Thus, when I enter 45056 MB for the size, I do get a 44 GB partition exactly
    While I'm at it, one piece of free advice. Don't reset your machine on Vista's first boot because you want to reinstall your bootloader or something. If Vista's first boot is interrupted, it will not be able to resume, so make sure that you can actually logon to Vista before you switch to doing something else.
  2. Re-plug HDD1 and boot Linux. Fire up dmraid (dmraid -ay) to gain access to your RAID partitions.
  3. Create a BACKUP of the Vista bootblock on RAID partition 1:
    dd if=/dev/mapper/isw_fhbagdjeh_Twix1 of=/backup/vista32 count=16
    Note 1: The reason I use 16 blocks (16 x 512 bytes) is because the BOOTSECT.BAK backup copy of the original drive bootblock done by Vista on installation is 8 KB big. If it's good enough for Vista, it's good enough for me
    Note 2: The reason my RAID0 array is called Twix has everything to do with the French rebranding of the famous caramel bar from "Raider" to "Twix" a few years ago
    Needless to say, if you ever lose that backup copy of your bootblock, you're screwed
  4. Now we'll ERASE the backed up bootblock with:
    dd if=/dev/zero of=/dev/mapper/isw_fhbagdjeh_Twix1 count=16
    This makes sure that sneaky Windows will not be able to recognize this partition as one of its siblings
  5. fire up fdisk (fdisk /dev/mapper/isw_fhbagdjeh_Twix) and unactivate the first partition, change its type to 'af' (how ironic, this is a MacOS partition type!) and activate the second partition (if the partition on which you plan to install Vista is not set as active/bootable, Vista will refuse to install!)
  6. Unplug HDD1 and install Vista64. Vista will see the first partition alright, but not recognize it, so it will install a second bootloader on the second partition, which is what you want
  7. Re-plug HDD1, boot Linux, issue the dmraid command, and restore the Vista32 boot record:
    dd if=/backup/vista32 of=/dev/mapper/isw_fhbagdjeh_Twix1 count=16
    Fire up fdisk again, and restore the first partition type to '7' (NTFS) and activate it (so that the 2 first partitions are marqued as bootable/active
  8. Use the bootloader of your choice to boot these 2 Vistas independently from one another and be freed from Microsoft's Vista bootloader tie in. One more step into our "One bootloader to rule them all" brainwa^H^H^H^H^H^H^H program...

No comments:

Post a Comment

Note: only a member of this blog may post a comment.