Jump to content

Install windows 7 from ANY usb NTFS partition +grub2


ibach

Recommended Posts

Have 16 GB USB stick, need all sort of systems to boot from it. One of them is Windows 7 installation with WIM larger than 6 GB hence i need NTFS to put it on (or simply because I cann). First partition of USB is not an option for number of reasons (I do not want it to be) . Not using ISO because there is probably not enough RAM on host machine to extract it.

I've made it work after some exploration.

Used software:

Windows 7 ultimate 64bit desktop computer with WAIK and VmWare 7.1 Workstation installed

Plop Boot Manager (to boot virtual machine from USB)

Virtual machine with Windows Xp 32 bit (for partitioning USB, can be done in many other ways)

xpfildrvr1224_320 driver to see partitions on USB under XP

Software to partition USB, I've used Paragon Partition Manager™ 10.0 Server

Virtual machine with Ubuntu installed

GRUB, I've used GRUB2 for i wanted NTFS partition. Any other version works, but with FAT32.

Windows 7 installation disk (32 or 64 bit or both if you like it does not matter for this method, it can be AIO with all versions, what ever you want, works wit vista too)

soviet_direct_hooking_src.zip from http://www.911cd.net/forums//index.php?showtopic=22795 (read the article too!)

Setup TEST virtual machine with Plop Boot Manager plpbt.iso used as CD/DVD connected at power on.

When booted this will display selection screen for booting from USB.

1)

In Windows XP virtual machine:

Install Paragon Partition Manager™ 10.0 Server.

Install xpfildrvr1224_320 driver.

1) Extract the contents of “ xpfildrvr1224_320.zip” to a temp folder

2) Insert you USB pen drive that you want to turn into USB hard drive.

3) Right click on “my computer” -> properties -> hardware -> and click –> device manger;

Expand 'Disk drives', right click your USB drive, select Properties.

On the tab "Details" under XP the item "Device instance ID" is already selected.

Click on the ID in the list and press Ctrl+C, this copies the ID into the Windows Clipboard, now open notepad and paste the ID using Ctrl+V.

4) Now, go to the temp folder, and open the included INF file with notepad, and search for [cfadisk_device]

a. Now go to the notepad, where you’ve copied your USB ID, and copy the first part as shown under (see bold part)

Sample ID: USBSTOR\DISK&VEN_LEXAR&PROD_JUMPDRIVE&REV_1.30\K326441127040&0

b. Replace the bold part in following line with your USB ID that you’ve just copied in above step, and add under [cfadisk_device] heading:

%Microdrive_devdesc% = cfadisk_install,USBSTOR\DISK&VEN_LEXAR&PROD_JUMPDRIVE&REV_1.30

c. Save the file.

5) Open the device manager again right-click the USB drive, "Update driver...", then "No, not this time" -> Next -> "Install from a list or..." -> Next -> "Don't search." -> Next -> "Have Disk" -> browse to the INF file here. Now "RemovableToFixed" should be in the list -> Next -> Confirm the two warnings -> Finish.

Now the drive is redetected, as USB hard drive.

2)

In Windows XP virtual machine:

Use Paragon Partition Manager (or whatever) to partition USB disk.

1)GRUB is on first partition so it is labeled GRUB in FAT32 format. 135 MB is more than enough for GRUB2.

You can use more space if you want (for files you need to be accessible on all machines)

(Partition label is important for Ubuntu commands.)

2)In this case Windows will be Windows 7 32 bit so my second partition label is Win7_32 in NTFS format.

Make partition on the rest of the free space, you will re size it latter in Paragon Partition Manager.

3) mark first, GRUB partition, as active

4)Start CMD and go to root of Windows install DVD (D:\boot)

D: (enter)

cd boot (enter)

Type another command given below to update the USB drive with BOOTMGR compatible code.

BOOTSECT.EXE/NT60 E:

Where “E” is your USB Win7_32 partition drive letter.

Once you enter the above command you will see a success message.

5)Copy all the files from Windows install disk to Win7_32 partition (do not re size yet)

3

THIS is most important step!

Without it you will get ERROR installing Windows saying: "A DVD/CD drive device driver is missing. If you have a driver CD/Floppy please insert it now..."

This is because Windows installation is OS for it self and it does not have driver that can use USB as hard drive (just like we had to install one in XP machine)

OS that installs Windows 7 is placed in \sources folder on installation DVD called boot .wim ("DVD:\sources\boot.wim).

We have to install the driver there.

1)Go to home OS (Windows 7 64bit with WAIK in my case) and copy D:\sources\boot.wim to a folder on your computer.

(E:\Live_Usb\MOD_WIMS\boot.wim in my case)

Go to start>>programs>>Microsoft Windows AIK and start "Deployment Tools Command Prompt" and execute:

md C:\mount

imagex /mountrw E:\Live_Usb\MOD_WIMS\boot.wim 2 C:\mount

This will mount the image to C:\mount folder on the computer.

Do not close "Deployment Tools Command Prompt".

2)Extract soviet_direct_hooking_src.zip to a folder on your computer.

Rename dummydisk.sys to dummy.sys.

3)Start Notepad and paste following text in:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEMbla\ControlSet001\Services\dummy]

"Type"=dword:00000001

"Start"=dword:00000000

"ErrorControl"=dword:00000001

"ImagePath"=hex(2):73,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,44,00,\

52,00,49,00,56,00,45,00,52,00,53,00,5c,00,64,00,75,00,6d,00,6d,00,79,00,2e,\

00,73,00,79,00,73,00,00,00

"DisplayName"="USB Mass Storage Filter Driver"

"Group"="System Reserved"

"Tag"=dword:00000001

Click Save As and save it as dummy.reg in the same folder with dummy.sys

4)Run RegEdit select HCKY_LOCAL_MACHINE

go to File>Load Hive

select C:\mount\Windows\System32\config\SYSTEM and open it

when asked for Key Name input SYSTEMbla

Close Regedit.

Double click on dummy.reg and import it to registry.

Restart RegEdit , go to HCKY_LOCAL_MACHINE, select SYSTEMbla, then File>Unload Hive.

The SYSTEM hive in mounted boot image has been changed.

5)Copy dummy.sys to C:\mount\Windows\System32\drivers

6)Save changes to boot.wim by entering following command to "Deployment Tools Command Prompt":

imagex /unmount /commit C:\mount

7)copy E:\Live_Usb\MOD_WIMS\boot.wim to USB Win7_32 partition in sources directory and replace the old one.

To do this use XP Virtual machine (it can see the second partition on USB).

8)You can re size the USB Win7_32 partition now using Paragon Partition Manager (leave no free space, you do not need it no more).

You can also defragment the partition while you are at it.

4

To install GRUB2 on the first partition of USB:

1)Start Ubuntu virtual machine, attach USB to it, download latest GRUB2 and extract it on the desktop.

3)Check your USB device name using System>Administration>Disk Utility

It will be listed on the left side of the window, click on it and look on the right under Device: in my case it's /dev/sdb

2)Go to Aplications>Accessories>Terminal. This will start the window like CMD in Windows.

Enter the following commands:

cd /home/ubuntu/Desktop/grub-1.98

sudo grub-install --root-directory=/media/GRUB /dev/sdb

sync

GRUB is now installed.

3)Close Ubuntu vm. In home OS open Notepad and paste following text in:

color black/cyan yellow/cyan

default 0

timeout 30

title Install Windows 7 32bit

root (hd0,1)

chainloader +1

boot

title Restart The Computer

reboot

Save it as in USB GRUB partition \boot\grub\menu.lst.

APPENDIX 1

Plug USB in XP virtual machine again and mark boot.wim as read only to prevent adding registry changes to Windows PE registry

(it will be done in ram, and thus non persistent as it is on the install DVD).

It will also prevent disk fragmentation because all the files will only be read during the install.

DONE!!!

Boot in test virtual machine and install.

Add other stuff to your USB and

enjoy!!!

@bach

Edited by ibach
Link to comment
Share on other sites


Very good! :thumbup

GRUB, I've used GRUB2 for i wanted NTFS partition. Any other version works, but with FAT32.

JFYI, grub4dos can access NTFS partitions allright, since a few years:

http://reboot.pro/forum/66/

Your post is however very interesting :thumbup (apart the nice info about Windos 7 :) ) as you are basically saying that GRUB 2 can use menu.lst (which is the typical configuration file of GRUB legacy and grub4dos) besides it's "proper" grub.cfg file (which uses a different syntax):

http://www.gnu.org/software/grub/manual/grub.html#Shell_002dlike-scripting

Again JFYI, there is a more "generic" way to install the Filter Driver, see here:

I am confused :unsure: about the reasons why you use cfadisk.sys on XP and dummydisk.sys on 7, BOTH drivers should work on BOTH OSes, see here:

Another thing you may be interested in is the newish project, grub24dos:

http://reboot.pro/13282/

(which would avoid the need of Ubuntu)

I presume that with the above info you may be able to simplify a bit your nice tutorial, avoiding the need of three different OS to prepare the stick. ;)

Finally, you may want to explore this app (and optionally my batches for it):

http://nativeex.boot-land.net/Programs/WimCaptEx/WimCaptEx.htm

http://reboot.pro/9765/

that allow access to a .wim from XP wiothout need of the WAIK.

I am editing the topic title to specify that you are using GRUB2 (and not GRUB, intended as GRUB legacy, to reduce disambiguation needs)

jaclaz

Edited by jaclaz
Link to comment
Share on other sites

jaclaz! Thank you for your rich reply!

Yust the kind of mean i wanted to provoke with my post!

I've been reading your posts for a while now, and liked them.

About the reasons to use cfadisk.sys on XP and dummydisk.sys:

I did not know they exist until two days ago, i just wanted to try them both.

Second one was simpler to install in the image, because it does not care about the device name at all and works with all of them.

About using GRUB or GRUB2:

One can use either, but if you want NTFS, GRUB2 is the choice.

About nativeex.boot...x/WimCaptEx.htm and reboot.pro/9765/:

Great! Beautiful!

About using Ubuntu:

I was using Windows since 3.1 version and know it inside out.

This knowledge, however useful, kept me skeptical about Linux for longtime.

I've installed Ubuntu 10 the other day, and i loved it! It's in my tutorial just for people to have a look at it.

About my tutorial:

The only important thing in it is the implementation of the USB as HDD driver (any of them) into the boot.wim.

Everything else is irrelevant and subject to users will.

Me being only an architect (one that makes buildings, not computers), have had strange reasons to do this as i did it.

Me being only an architect (one that makes buildings, not computers), have had strange reasons to do this as i did it.

1) All things in one place for "little Pero" to use it at will.

2) Make it safe for "little Pero" not to destroy his home os.

3) Third, but most important: Your reaction to it! Beautiful comments and unifying knowledge in one place.

So, please, you being someone who know things, rewrite this tutorial in reply, in a manner of shortening the process to the minimum!

From your reply and posts I've read i know that you are more than capable to do it.

4) I need a job :) ...

PS: THANK YOU in advance!

Link to comment
Share on other sites

So, please, you being someone who know things, rewrite this tutorial in reply, in a manner of shortening the process to the minimum!

From your reply and posts I've read i know that you are more than capable to do it.

Well, no. :(

Most of what you wrote is ALREADY written (and the possible betterings been linked to - for people that needs an alternative), and we ALREADY have a nice, automated app to do that (actually more than one - for those too lazy to attempt manual methods).

AGAIN, if you want to boot a Microsoft system or install, the choice is grub4dos, NOT GRUB, NOT GRUB2. (as grub4dos, besides supporting NTFS allows for DIRECT CHAINLOADING - i.e. bypassing the bootsector - of most MS system files/bootloaders and is MUCH more "flexible" than the other two).

You did an excellent job with your tutorial :thumbup , and people can have it "as is" or - if they are curious/not lazy - experiment with the alternatives.

And JFYI, I am also in the construction field, as a free-lance consultant, project coordinator and project manager.

jaclaz

Edited by jaclaz
Link to comment
Share on other sites

Well when you put it that way.... yes, you are probably right. Let people discover things by them selves, things are out there, and they might stumble on some interesting topics in the process.

I was thinking (I should stop doing that...)

boot.wim seems to be windows OS. Or some small version of it. It should be possible to preinstall user software on it. Hence it could be possible to reprogram install procedure and customize it according to ones needs. Install other software maybe during OS install with selection screen in the beginning... Hm ...

I see I'll be making an other tutorial and another topic..

Link to comment
Share on other sites

I was thinking (I should stop doing that...)

Again, no. :(

Life is " trying things to see if they work"

;)

boot.wim seems to be windows OS. Or some small version of it. It should be possible to preinstall user software on it. Hence it could be possible to reprogram install procedure and customize it according to ones needs. Install other software maybe during OS install with selection screen in the beginning... Hm ...

Well, actually it is a PE 3.x (i.e. it is a Pre-installation Environment), you can think of it as a minimal, portable OS that is used to actually run the installers, and yes, of course it can be modified/customized.

The general idea is given in this topic (sticky):

(which is however seemingly abandoned by original Author and might use new ideas/contributions) ...hint, hint...:)

jaclaz

Link to comment
Share on other sites

jaclaz!

Help!

1) After doing some more tests I've noticed that after installing Windows for the first time from the USB boot time of installation gets much slower than the first time.)

I believe that is because Windows PE makes changes to the registry of the image instead in the memory while loading drivers (unlike DVD version, DVD is Read Only).

2)Disk gets fragmented. How to prevent it?

I'm testing for the solution. Making boot.wim Read Only in virtual XP machine at he end could do the trick...

Is that true?

Do you know the answer?

Edited by ibach
Link to comment
Share on other sites

  • 3 weeks later...

Nice job, works like a charm in windows 7 and windows vista :thumbup .

Anyhow I'm having problems to do it with Windows server 2k8, posting a problem that is not able to find dummy.sys (and I triple-check that the file is in \system32\drivers.

You know what could be the problem? maybe the registry key...

Link to comment
Share on other sites

it should work...

I do not know how does the Windows server 2k8 boot wim is built, it could be possible that it uses different PE than PE 3.x which is on win7.

Is it x64 bit system?

If all fails you can try using same boot.wim from windows 7 x32 install to deploy Windows server 2008 x32/64, it might work as a workaround.

I do not have any version of Windows server 2k8 at the moment, but if you upload boot.wim somewhere, I could take a look.

Link to comment
Share on other sites

With the windows 7 wim, I can reach the screen to select wich version I want to install (it´s an all in one), but after that I get an error saying "Windows could not display the images available for installation".

Here is was the wim of windows server I am using

PS. I am mixing your method with the one in here so I can get several installations in the usb drive and not in the first partition, so I have a normal usb stick but if you boot from it you get the magic, so far Windows 7 (All in one) and Windows Vista (All in one) are working, the only one I cannot get to work is the server.

Edited by jaclaz
Removed link to file containing NON redistributable files
Link to comment
Share on other sites

  • 2 weeks later...

With the windows 7 wim, I can reach the screen to select wich version I want to install (it´s an all in one), but after that I get an error saying "Windows could not display the images available for installation".

Here is was the wim of windows server I am using

PS. I am mixing your method with the one in here so I can get several installations in the usb drive and not in the first partition, so I have a normal usb stick but if you boot from it you get the magic, so far Windows 7 (All in one) and Windows Vista (All in one) are working, the only one I cannot get to work is the server.

Malope, you cannot share MS files.

If I get it right you are using a "mixed mode" approach.

In these cases, my *generic* advice is to do things in little steps: try first using ONLY that source, with ONE and with the OTHER method separately.

Only once you succeed with the single source, try using ONE (or the OTHER) method to add the remaining additional sources (that are giving you no problems).

Once you have the ONE or the OTHER method working with ALL the sources you want/need, then you can do "mixed mode" experiments.

jaclaz

Link to comment
Share on other sites

  • 2 years later...

has someone done similar thing without modification to of wim file?

Sure it has been done. :thumbup

Instead of adding dummydisk.sys another disk driver is added on the fly and the install is performed from an UNtouched .iso..

There are at least a couple of variations, start reading here:

My guess is that you can anyway install dummydisk.sys at the Shift + F10 command prompt. :unsure:

jaclaz

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...