How to tame Win 7 (written for eCS 2.0)

From OS2World.Com Wiki
Jump to navigation Jump to search

By Doug Bissett

Thanks to Sigurd Fastenrath, for his work to produce eCs-2-on-modern-laptop-win7-rev-1.zip (at HOBBES). It almost got me to where I needed to go. Some of his work is reproduced below.

WARNING: You MUST make the recovery CDs or DVDs for your system, before you start. That will be required, to be able to recover to the original system layout. Doing that will NOT back up any existing data that you mat have on the system, so you also need to back that up. I would suggest that you use the windows tool that is used to transfer data from an old system to a new system, but a second backup, using another tool is also a good idea. DO NOT use a clone tool, or a sector backup tool, because those will restore exactly what you have now, which may not be the result that you want.

These procedures worked for me to install eCS onto my Lenovo ThinkPad T510, with a 500 GB disk drive, and Windows 7 Home Premium installed. Hopefully, they will work for you too, but you use this documentation entirely at your own risk. These procedures should also work for VISTA, if you are using that, but they are completely untested in that case.

You will require a copy of the DFSEE 10.6 (or later) CD to do some of these procedures. Please register.

There are four problems, that I know of, that Windows 7 causes while attempting to install eComStation (and probably other OSs too).

  1. We need to shrink the windows partition(s), to leave room for eCS. To do that, see A) below. NOTE: When you attempt to install Windows 7 SP1, you MUST set the windows boot partition as the ACTIVE partition, or SP1 will error out. After installing SP1, make Boot Manager ACTIVE again.
  1. Windows 7 can (and does) create a disk layout (Geometry) that eCS cannot use. This can happen when the disk is larger than some (unknown) specific size. This size seems to be something larger than 200 GB, but happens, for sure, at 500GB. You can shrink the windows partition, leaving lots of room for eCS, but when you attempt to create partitions, using the Installation Volume Manager (MiniLVM), or LVM itself, they will complain about an invalid partition table, and they will refuse to let you continue. Again, we have a problem. Note, that DFSEE will, happily, create partitions, but the eCS installer will not be able to use them. I was also unable to restore any eCS data successfully, even though I could format the partitions as JFS. See B) for a solution.
  1. Windows 7 can (and usually does) take up two primary partitions, just for itself. Since there is almost always a “recovery” partition, which is also a primary partition, that makes 3 primary partitions, before you even start. Since eComStation requires a primary partition for Boot Manager, and another for the Extended primary partition, which holds the logical partitions, the total required is 5. Unfortunately, the way that the boot records are designed (thanks Bill), the maximum allowed is 4. We have a problem. See C) below for the way to work around that.
  1. Windows may be set up to only use SATA AHCI mode, while eCS can only use SATA compatibility mode. This problem should be eliminated, when the new AHCI capable driver is released. Meanwhile, those systems that can be manually switched, or those systems that will automatically switch, to compatibility mode, will work, while those that cannot be switched to compatibility mode will not work. If you need to switch manually, you also need to convince Windows to use compatibility mode. See D) for the way to do that.

I ran into these problems while attempting to install eComStation to my Lenovo ThinkPad T510. The solutions, that I have found are described below.

A) To shrink the windows partition, follow these steps:

  • Boot to windows.
  • Open the Control Panel.
  • Change the window to show small icons (upper right corner of the window).
  • Click Administrative Tools. A new window opens.
  • Double click Computer Management. Another window opens.
  • On the left side, click Disk Management. Now, you should see the current disk layout. That should consist of the hidden windows boot partition (SYSTEM_DRV), the main windows C: drive (Windows7_OS C:), and the recovery partition (Lenovo_Reco). You may not have all of them, depending on how windows was installed, and other manufacturers probably call the recovery partition by another name.
  • The partition that we will shrink, is the windows C: drive (Windows7_OS C:).
  • RMB click on the section that shows Windows7_OS C:. A menu will open.
  • Select the Shrink Volume entry. Wait for it to do it's analysis.
  • You will get a window, that shows the current Total size of the partition, the amount that you can shrink it, and the total size that it will be, if you shrink it using those numbers. DO NOT shrink it yet.
    • Remember that you want the Total size AFTER shrink to be big enough for windows to be happy. That will take a good size partition (at least 100 GB for Win7).
    • You also need enough room to create all of the partitions that eCS will need.
    • Consider the above, and if the shrink size is not big enough, leave this, and run the windows Defrag program, more than once. After that, come back to this point, and there should be more room (that does depend on what you have in windows).
    • If you still can't get enough room, you have a decision to make.
      • You can replace the disk with a larger one (or add a second disk, if possible).
      • You can use the recovery facility to re-install windows, as it came from the factory. You WILL lose everything in windows (remember the backup?), but you may need to do that anyway, if you have problem #3. Then, you should be able to shrink windows to a reasonable size.
  • Okay, so now you want to change the number that is in the “Enter the amount of space to shrink in MB” box. Just change the number until the “Total size after shrink in MB” box contains the number of MB that you want to keep for windows (1000 MB is about 1 GB).
  • Click the shrink button, and wait for it. Now, the Disk Management window should show your free space.
  • IF this is the final, desired, configuration, you are done.

B) If you have problem #2, you will need to reinstall windows, so that it creates a proper disk layout.

There is a trick to this, or you will end up back where you started. You need to move the recovery partition so that it is directly behind the shrunken C: drive, then reinstall windows, using the recovery partition.

  • Boot to DFSEE.
    • Go to File-> Open object to work with-> Partition-> and select Lenovo_Reco.
    • Go to Actions-> Move or copy a partition-> Move Part to freespace area, and select the free space following the Windows7_OS partition. This will take a while.
    • Go to Mode=NTFS-> Boot area fixes/updates-> Fix HiddenSectors/Geo value.
  • After that is finished, boot to windows, but interrupt the normal boot sequence by holding F8. That should give you a windows menu, where you can select to boot the recovery partition.
  • When you get the option, reinstall windows (the whole thing, not just the C: drive). This will install windows to a proper disk geometry, so that eCS can use it. It will also expand the recovery partition to fill up the drive. At this point, I believe that the recovery partition will be unusable, since it was created using the original disk geometry. You can now remove the recovery partition using the windows Disk Management, DFSEE, or the eCS Installation Volume Manager.
  • You now have windows at the front of the disk (probably using only one partition), and there should be lots of free space tor eCS.

C) You can do two things, to remove one, or both, of the extra windows primary partitions.

Because of the second problem, you may need to end up removing the recovery partition, but not yet. I also suggest removing the hidden Windows 7 boot partition, HOWEVER, if you plan on using some sort of Windows protection software, you may need the hidden partition. I do not know what effect that may have on the eCS installation, so use caution.

  • First, we will remove the hidden windows boot partition. We must install the windows boot support to the C: drive, so that it can boot, without using the hidden partition.
    • Open a Command line, by selecting Start-> All programs-> Accessories-> RMB click on the Command Prompt item-> Click on Run as administrator. The command line should open.
    • Type the command:
bcdboot c:\windows /s c:
    • It should complete successfully.
  • Now, go back to the Disk Management window.
  • RMB click on the windows C: drive section, and select Mark Partition as Active. Now, win7 will boot from the C: drive, without using the hidden partition. (test it).
  • When the boot happens, the windows boot manager will ask which windows to boot, Select the SECOND one. This will be fixed by a later step.
  • Okay, you can now remove the hidden windows boot partition, but that will leave an empty space at the front of the drive. Now, you can move the Windows C: partition to the front of the drive, using DFSEE. Boot the DFSEE CD, and do this:
    • You need to move the C: drive far enough back so that it will fit between the beginning of the drive, and the new location.
    • Okay, to remove the hidden partition (if you didn't already do that with windows), click Mode=FDISK-> Delete partition-> and select the one called SYSTEM_DRV. Reply to allow the deletion.
  • Now, to move the C: drive (Windows7_OS), do this:
    • Go to File-> Open object to work with-> Partition-> Select Windows7_OS.
    • Go to Actions-> Move or copy a partition-> Move Part to freespace area, and select the large free space (must be larger than the partition to be moved).Offset 0 will place it directly behind where it is now. This takes a while so plan on waiting for it.
  • Okay, that should leave a space at the beginning of the disk, that is larger than the partition.
    • Go to File-> Open object to work with-> Partition-> Select Windows7_OS.
    • Go to Actions-> Move or copy a partition-> Move Part to freespace area, and select the first free space.
    • Offset 0 will place it at the beginning of the disk. This takes a while so plan on waiting for it.
  • Now, we need to adjust the MBR pointer so that it will boot windows.
    • Go to File-> Open object to work with-> Partition-> Select Windows7_OS.
    • Go to Mode=NTFS-> Boot area fixes/updates-> Fix HiddenSectors/Geo value.
  • Now, windows should boot, using only the one partition, at the beginning of the disk. You should also still have the recovery partition (if it was there in the beginning).

D) Make windows accept running in SATA compatibility mode, if the machine will not automatically switch.

ECS needs to run in compatibility mode, until the AHCI driver is available.

  • Open the windows registry editor (REGEDIT).
  • Edit HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\atapi
    • Change the start value from "3" to "0" (Zero),
  • Edit HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Intelide
    • Change the start value from "3" to "0" (Zero),
  • Edit HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\pciide
    • Change the start value from "3" to "0" (Zero),
  • Close the registry editor.
  • Power off, wait 10 seconds, power on and interrupt the normal boot with the ThinkVantage key (blue key, which may be ignored, if you don't power off). For other systems, use whatever key gets you to the BIOS setup.
    • Do F1 to go to the BIOS setup.
    • Select Config-> Serial ATA (SATA).
    • Use F5 or F6 to change it from AHCI to Compatibility.
    • Press F10 to Save and Exit.
  • Windows will now boot, and discover that it has new hardware (SATA in compatibility mode). Wait for the message that the device is ready to use, and restart the computer when requested.
  • Reboot to windows, to be sure that it still works.

Summary

That should do the job, and you should be able to use the standard eCS install procedures to get eCS installed. Remember to use only Logical partitions for eCS. You will probably want to make a full backup of everything, so you can get back to this point. If you use the original recovery CD/DVD that you created, it will restore the system back to the way that it came from the factory, and you will need to start over.

Remember to make the windows boot partition ACTIVE, when installing Service Packs, or it will fail. I used DFSEE to do that:

  • Open DFSEE
  • Click MODE=FDISK
  • Click Set Partition status to
  • Click Active, BIOS startable
  • Select the windows boot partition

To reverse that (after installing the service pack), boot the DFSEE CD. When DFSEE opens do:

  • Click MODE=FDISK
  • Click Set Partition status to
  • Click Active, BIOS startable
  • Select Boot Manager