Ubuntu – Ubuntu 11.10 (Oneiric Ocelot): Install Windows on logical/extended partition — dual-boot

11.10dual-bootgpartedpartitioningwindows

I have three primary/basic partitions:

  • sda1. Ubuntu 11.10 root drive (40 GB)
  • sda2. FreeBSD root (20 GB)
  • sda3. Windows XP root drive (4 GB)

I have a logical/extended partition, sda4 of 234 GB, divided into five disks (sda6~9).

The primary partition #3 (sda3) has only 4 GB space, which is quite insufficient (I need Windows only for MS Office, and a few odd engineering software; so I wish to use the least possible, but efficient, space for it).

Can I install Windows XP to one of the disks (sda6~9) on the logical/extended partition without damaging the partition table structure and the in ANY of the primary and logical partitions/disks?


Partitions structure: /dev/sda

/dev/sda1   ext4   /       Oneiric-Ocelot       40G
/dev/sda2   ufs            FreeBSD              20G
/dev/sda3   ntfs           WinXP Pro            4G      #This will be formatted 'ext4' & contents of '/Mix' will come here
/dev/sda4   extended                            234G
    /dev/sda5   ext4    /Docs        Docs              34G
    /dev/sda6   ext4    /Multimedia  Multimedia        186G
    /dev/sda7   unallocated                            2MB
    /dev/sda8   ext4    /Mix         Mix               10G   #Windows XP is to be installed here
    /dev/sda9   linux-swap                             04G

Best Answer

I have another thing working, much more complex, but also works.

First a warning for this scheme: If you have only one HDD it is possible that you will not be able to install Windows as the scheme is (i did not tried, i used a previous windows that was installed on a MBR disk by cloning windows partition with GParted).

Musts i impose to my self (to make things really complicated):

  1. BIOS Only PC (no U-EFI, no EFI partition, etc) and only 32Bits support (no 64Bits allowed) to make things really hard
  2. Only one HDD present (as in most Laptops) and no other storage (no USB, etc)
  3. The HDD on GPT style (not MBR), here the warning, Windows can not boot from GPT in native mode (need one external or Virtual MBR disk to boot)
  4. Grub2 as main bootloader
  5. Multi-Windows 32Bits (Home versions), also to make things much harder
  6. Isolated all windows, just to complicate things a little bit more
  7. Main menu selection must make selected windows desktop appear (or at least the windows logon, that depends on how you configure the windows)
  8. 100% legal, so no copy any file from a different windows version, etc

Note: I let XP away (does not support GPT), just for Vista to 10.

Boot scheme is BIOS load Grub2 then memdisk is loaded and a VHD file (one per Windows) is mounted and chainloaded.

That VHD must be fixed size (just to allow memdisk lo loop mount it at boot), it is a virtual HDD that has a MBR scheme (needed to boot windows) with only one NTFS partition; the VHD itself is stored on a NTFS GPT partiton. This VHD files do the windows isolation, each windows has its own BCD, they do not use all the same BCD, so no need to present on boot a windows boot menu.

Inside that VHD, the partition is only used for nt60 boot code and BCD stuff. I used 32MiB for such VHD, and i get only near 2MiB free, so etter do not use less size or just do not put all locale BCD directories, etc.

To make all this work, you need to put nt60 code and BCD on that VHD file, so that VHD file must be mounted, that can be done with diskpart, and that can be also be done with install media.

I did not test to do a full install, must in theory, if at install you mount that VHD, put nt60 code and BCD there, the install must allow you to continue (it can see a MBR disk and think it is pre-configured with another windows).

I tried with a lot of 32Bits Windows Home versions (from Vista to 10) and they all boot correctly from a GPT disk, since they all see at boot a virtual MBR disk where boot nt60 code and BCD is.

Now i am trying a different aproach / test:

  • Same conditions as before but have only one MBR disk with only one Extended partition that is 100% of the disk, so no Primary partition at all is present.

I know, if no primary partition present, windows will not be able to boot, but again i will use the trick of having a virtual MBR disk with a primary NTFS partition where i put nt60 boot code and BCD stuff; one per windows.

Conceptually if must also work, since Grub2 can be booted from inside Logical partitions (as well as most Linux, etc).

Why i do all such complex things? Easy answer could be 100% encrypt, each windows with its own password, etc.

Complex answer:

  1. BitLocker send passwords to M$ and NSA servers and also has a Big Back Door that allows to mount them with no password at all.
  2. TrueCrypt & VeraCrypt does not support multi-windows, neither have them isolated (they use a common place for their work), so only one windows can be protected, etc; please remember BIOS only & 32Bit windows home only
  3. DiskCryptor allows to protect multiple Isolated Windows, also allow to protect GPT partitions (only data ones, no the system one)
  4. I do not trust any other encryption that does not let you use cascade algorithms, etc.; i do not trust encryption that does not let me see the source code (what they try to hide? back doors? etc.).

So with the GPT scheme, DiskCryptor is not working at boot, i read source code and it does not have code to mount GPT partitions at boot time, so :\Windows\System32\Winload.exe can not be found, so windows does not boot. I tested with two physical HDDs prior to download source code, i was getting mad, so i decided to download source code i could see missing source code for GPT mounting at boot time.

Since DiskCryptor can auto mount at boot more than just one MBR partition (all the ones that uses the same password will be mounted) now i am trying the 100% Extended partition way.

Why not putting a physical Primary partition and store there the nt60 boot ode and BCD stuff? That way all windows can be installed and booted in native mode, no need for anything extra; but they will not be 100% isolated, they will share that partition, so if one touches it badly, can occur no one will boot, and again encryption 100% of the disk (all partitions, not boot sector, not partiton table, etc). will not be possible in isolated mode, at least one password must be used for all windows at boot time.

Imagine a real scenario:

  • Multiply users, each one use its own Windows, so anything they do, they do it on its windows
  • If one user crashes its windows, they other users are not affected
  • Each user can have its own apps, also apps that requieres administrative privileges, etc
  • With isolated encryption, they can not read things of the other users.

Best aproach will be each one using an external sata disk (seen as if it where internal), that they carry with them selves.

But i want it to be internal, etc.

The real motive is i like do things hard, complex and not allready done; i love to test my own skills, also is a way to learn a lot.

Hope your minds, now are more open to alternative ways of booting windows.

P.D.: With Linux this things are much more easy, Windows make things mush hard than what is needed to be (nt60 code load bootmgr, that has a hard coded seach for only the MBR primary active partition where it will try to read winload.exe, etc).