Topic: Multi_VHD  (Read 4104 times)

0 Members and 1 Guest are viewing this topic.

Multi_VHD
« on: March 26, 2015, 07:21:08 AM »

KYHI

  • Code Baker
  • Sr. Chef
  • ****
  • Location: Kentucky
  • Date Registered: Jan 2015
  • Posts: 909
I used the zMulti-Wim script and made a few adjustments to add VHD files instead of wim files..

The multi-wim script refers back to the BCD entry of wim 1 for the other 3 possible wim entries..

I added the BCD entries for the VHD(s) [BCD_VHD]

Now I got to turn it over to somebody else, to make it work as intended..

I left the first wim entry for the wim file - which is the project boot.wim

Now got to get it to add the VHD's entries into the bcd after the project wim bcd entry..

I get Lost here > If,#1,Equal,2,Begin / If,#1,Equal,3,Begin / If,#1,Equal,4,Begin

Note: This is not a working script and has no use - other then for research..
« Last Edit: March 26, 2015, 05:40:02 PM by KYHI, Reason: removed attachment »

Re: Multi_VHD
« Reply #1 on: March 26, 2015, 08:34:19 AM »

Lancelot

  • Gena Baker
  • Grand Chef
  • *****
  • Date Registered: Sep 2010
  • Posts: 7241
I sadly can not join development....

I get Lost here > If,#1,Equal,2,Begin / If,#1,Equal,3,Begin / If,#1,Equal,4,Begin

If I understand correctly:
This is about parameter usage,
Giving example:
(you can easly test inside CodeBox and check result with Log)

Code: [Select]
[Process]
Run,%ScriptFile%,TestParameter,MyFirst,Second,ReallyThird

[TestParameter]
Echo,#1
Echo,#2
Echo,#3

Shortly:
 After main syntax, Parameters added after each comma
Run,%ScriptFile%,TestParameter,MyFirst,Second,ReallyThird

and these parameters used inside section [TestParameter] with #1 #2 #3


inside above plugin:
If,%pCheckBox2%,Equal,True,Run,%ScriptFile%,BCD_VHD,1
If,%pCheckBox3%,Equal,True,Run,%ScriptFile%,BCD_VHD,2
If,%pCheckBox4%,Equal,True,Run,%ScriptFile%,BCD_VHD,3

#1 assigned to 1 or 2 or 3 with If, .... ;)

(1 missing and 4 not exists inside plugin ;) )

I hope above helps :turtle:

Re: Multi_VHD
« Reply #2 on: March 26, 2015, 09:52:28 AM »

Lancelot

  • Gena Baker
  • Grand Chef
  • *****
  • Date Registered: Sep 2010
  • Posts: 7241
looking your plugin more,

If,%BcdEFIexist%%Wim#1_EFI_CheckBox%,Equal,YesTrue,Begin

I guess should be (there already exists If,#1,Equal,.....,Begin prior to these 4 lines)

If,%BcdEFIexist%%Wim_EFI_CheckBox%,Equal,YesTrue,Begin



*
and
line 232
Code: [Select]
End
should not exists

:turtle:

Re: Multi_VHD
« Reply #3 on: March 26, 2015, 02:41:41 PM »

KYHI

  • Code Baker
  • Sr. Chef
  • ****
  • Location: Kentucky
  • Date Registered: Jan 2015
  • Posts: 909
Got it to copy over the VHD's from location to target
And got it to add the BCD entries for the VHD's in both bootmgr and bootmgr.efi in addition to project ramdisk entry

Tested in a build and it seems the Multi-VHD selection works, copies VHD's, adds the boot entry in BCD, etc.

Just gonna need a little more testing to be sure..
« Last Edit: March 26, 2015, 11:40:15 PM by KYHI, Reason: removed attachment »

Re: Multi_VHD
« Reply #4 on: March 26, 2015, 10:53:14 PM »

ChrisR

  • Win7PE SE Baker
  • Grand Chef
  • *****
  • Date Registered: Mar 2011
  • Posts: 2897
Hi  KYHI,

For device and osdevice options in both BCD, don't you need to add the relative path %OtherOS_Folder%=Boot\IMG to the vhd file. I have not tested the startup.

Code: [Select]
ShellExecute,Hide,%BcdEditExe%,"/store %BCDStore% /set %VHD#1_GUID% device VHD=[locate]\%OtherOS_Folder%\%VHD#1_Filename%#$clocate=custom:12000002",%Tools%\%OSArch%\
ShellExecute,Hide,%BcdEditExe%,"/store %BCDStore% /set %VHD#1_GUID% osdevice VHD=[locate]\%OtherOS_Folder%\%VHD#1_Filename%#$clocate=custom:22000002",%Tools%\%OSArch%\

Re: Multi_VHD
« Reply #5 on: March 26, 2015, 11:37:13 PM »

KYHI

  • Code Baker
  • Sr. Chef
  • ****
  • Location: Kentucky
  • Date Registered: Jan 2015
  • Posts: 909
I did already find it was coping the vhd to that otherOS_ folder (early this morning) and now copies the vhd to otherOS_root

Was trying to avoid coping vhd into a project folder..

No problem pre-creating the VHD BCD Entries - but would like to copy VHD when writing USB BCD media (source to USB)

Problem being the VHD already gets copied 4 times prior to write (source fldr > program fldr > target fldr > wim fldr > to USB)

Another problem is when creating the ISO, which uses the wim folder > the VHD's are also included in the ISO

As good as that may be, three 15GB VHD's make for a very large ISO
« Last Edit: March 27, 2015, 04:50:43 AM by KYHI, Reason: removed attachment »

Re: Multi_VHD
« Reply #6 on: March 27, 2015, 12:47:10 AM »

KYHI

  • Code Baker
  • Sr. Chef
  • ****
  • Location: Kentucky
  • Date Registered: Jan 2015
  • Posts: 909
So, I believe our choices are limited..

This one being best option..

Create VHD BCD entries and add Option to manually copy VHD(s) to USB

Done!!

Here are the results:
In order to prevent multiple copy overs of vhd to folder - I added Option To "SaveTime" by manually coping the VHD to usb device.
When this option is selected the BCD Entries are created in the Project BootMenu - and are copied into the project ISO
If you fail to manually copy the VHD(s) to the usb device - The invalid VHD Entries are not displayed in the BootMenu
Tested in Win8.1 x86 VHD and Win8.1x64 VHD

SideNote: Used WinNTsetup to create VHD's and Generic USB's are SLOW to load a VHD


« Last Edit: March 28, 2015, 07:46:09 AM by KYHI, Reason: removed attachment »

Re: Multi_VHD
« Reply #7 on: March 27, 2015, 12:53:41 PM »

ChrisR

  • Win7PE SE Baker
  • Grand Chef
  • *****
  • Date Registered: Mar 2011
  • Posts: 2897
:thumbsup:
I will try next week, if I find enough time.

Another possible option, could be to create the VHD in PostConfig plugin by adding a Checkox + size,  in place of capture boot.wim.
I do not know if the VHD's creation can be done with WinNTSetup cmdline or if we have go through a batch.

If you fail to manually copy the VHD(s) to the usb device - The invalid VHD Entries are not displayed in the BootMenu
:thumbsup:

SideNote: Used WinNTsetup to create VHD's and Generic USB's are SLOW to load a VHD
I also noted using wimb's VHD_W8_Compact. It looks better with a USB Hdd or using USB3
With a Generic USB, the standard PE with boot.wim is probably more appropriate

Re: Multi_VHD
« Reply #8 on: March 27, 2015, 11:55:26 PM »

KYHI

  • Code Baker
  • Sr. Chef
  • ****
  • Location: Kentucky
  • Date Registered: Jan 2015
  • Posts: 909
Did a little search of compact 8  - seems to me the discussion kinda goes by way of loading a compacted vhd to memory, very similar to loading an already compacted wim..
I also see some of these other forums topics are way older (and feel I am now revamping or addressing older topics) which is not the case to me, seem to find out after the fact, though..
A lot of search topics get into Rufus, NTFS:UEFI, Grub, this that and every other program.. And multi-partition external HDD's.. For UEFI and MBR booting..

So far my testing has been done with Windows 8.1 and using Win8.1SE project > and I have found very little need for any other 3rd party apps..

Win8.1SE to write boot files and WinRE - WinNTsetup to write VHDs - EasyBCD to cover the slack of BootIce  > all using a Windows BCD Bootmanager

Win8.1SE x64 boots Legacy and UEFI > Windows 8.1 x64 VHD Boots Legacy and UEFI > Win8.1SE x86 boots legacy > Windows 8.1 x86 VHD boots legacy > all from a single partition external HDD connected to a UEFI x64 PC

I know windows 8 supports booting UEFI x86 and have not testing it yet using a trick I found in Multi-Wim..  But I will..
« Last Edit: March 28, 2015, 12:33:29 AM by KYHI »

Re: Multi_VHD
« Reply #9 on: March 28, 2015, 12:12:42 AM »

Lancelot

  • Gena Baker
  • Grand Chef
  • *****
  • Date Registered: Sep 2010
  • Posts: 7241
Problem being the VHD already gets copied 4 times prior to write (source fldr > program fldr > target fldr > wim fldr > to USB)
Maybe:
you can use hardlink to prevent some of copy steps  :wink:

*
To prevent winbuilder seen as hanging (yet another winbuilder bug), try using another utility during copy,
maybe xcopy, or copy, or something that shows a gui with bar, an idea:
http://ipmsg.org/tools/fastcopy.html.en


*
btw, I guess you are adding a newly created vhd via OtherOS ?

If so, you can create other plugins after creating of vhd to shrink down vhd.

ps: Let me know if there is an "empty vhd" utility to remove all deleted files....

Quote
Another way is adding SE to .vhd,
 which is not popular since .wim compression is a lot higher,

we have
Gena\Finals\2 Create Image\BootDI
which becomes unpopular after there becomes
Gena\Finals\2 Create Image\WimBoot

unpopular but I still like it  :wink:


just reminding since not to mix adding "SE->VHD" with "New VHD->OtherOs (or Project)"

:turtle:

Re: Multi_VHD
« Reply #10 on: March 28, 2015, 01:00:28 AM »

KYHI

  • Code Baker
  • Sr. Chef
  • ****
  • Location: Kentucky
  • Date Registered: Jan 2015
  • Posts: 909
If,%SaveTime%,Equal,False,FileCopy,%pFileBox#1%,%OtherOS_Root%  - that is the cloned copy method used

I already have a script written to create the BLANK VHD - just got the figure out how to execute it..

And when you say empty - you mean Compact??

It is recommended that you defrag the drive in advance and unmount - then,

using windowspowershell(admin)

Mount-Vhd –path <full path the vhd file> -readonly
Optimize-Vhd -path <full path the vhd file> -Mode Full
Dismount-vhd -path <full path the vhd file>

using CMD(admin)

diskpart
select vdisk file=%D%:\%Name%.vhd
attach vdisk readonly
compact vdisk

or

diskpart
select vdisk file=%D%:\%Name%.vhd
compact vdisk

You can only compact a VHD that was setup as expandable - over time they gain in size - after removing files and defraging disk, unmount and compact

++
Quote
btw, I guess you are adding a newly created vhd via OtherOS ?
Yes, I have already tested the OtherOS Multi-VHD  BCD entries
I have the codebox to create blank VHD - codebox already tested as script - don't know how to execute it.. hint, hint

I feel using Multi-VHD - I could create a Blank VHD - using the BCD entry variables
Making a Blank VHD would copy over to usb faster (smaller) then one could apply the files to the USB's VHD
« Last Edit: March 28, 2015, 07:45:47 AM by KYHI, Reason: removed attachment »

Re: Multi_VHD
« Reply #11 on: March 28, 2015, 01:33:15 AM »

Lancelot

  • Gena Baker
  • Grand Chef
  • *****
  • Date Registered: Sep 2010
  • Posts: 7241
I already have a script written to create the BLANK VHD - just got the figure out how to execute it..
just create a .cmd and execute with .....cmd.exe,"/C ...."
re check:
\Win8.1SE\Components\FakeDisk
And when you say empty - you mean Compact??
yes same idea with compact,
 but on fixed disk, so to backup when 7z used to compress (fastest) deleted files won't be there ;)
  nothing urgent, I am lucky to have enough space , life goes  :thumbsup:

*
to defrag from command line,
check
Gena\WriteMedia\Tutorial Gena Disk Boot
Tip:
when I made this, df.exe could not report defrag was ok or not, so I used fragutil to check after df  :wink:


Have fun
:turtle:

Re: Multi_VHD
« Reply #12 on: March 28, 2015, 06:26:31 AM »

KYHI

  • Code Baker
  • Sr. Chef
  • ****
  • Location: Kentucky
  • Date Registered: Jan 2015
  • Posts: 909
Got it to create a blank vdisk

Problem 1 - need to execute > Create_VHD.cmd < from cmd(admin)
problem 2 - need to wrap %Name% and %Volable% in quotes

when running cmd - Name Volume label - split name fails  txtaddline needs to be added as "Name Volume Label"

Think I figured it out now... Attachment remove for now - testing..


I GOT IT !!!

 :w00t:  :w00t:  :w00t:
« Last Edit: April 07, 2015, 05:55:05 AM by KYHI »

Re: Multi_VHD
« Reply #13 on: March 28, 2015, 08:04:18 AM »

KYHI

  • Code Baker
  • Sr. Chef
  • ****
  • Location: Kentucky
  • Date Registered: Jan 2015
  • Posts: 909
Now to add a few more VHD options
« Last Edit: March 28, 2015, 06:34:13 PM by KYHI »

Re: Multi_VHD
« Reply #14 on: April 07, 2015, 05:57:06 AM »

KYHI

  • Code Baker
  • Sr. Chef
  • ****
  • Location: Kentucky
  • Date Registered: Jan 2015
  • Posts: 909
Well I added a compact feature and tweaked the interface as well. Also added some helpful tips.. still in testing too..
« Last Edit: April 11, 2015, 04:46:17 AM by KYHI, Reason: updated script »

 

Powered by EzPortal