Jump to content
Strawberry Orange Banana Lime Leaf Slate Sky Blueberry Grape Watermelon Chocolate Marble
Strawberry Orange Banana Lime Leaf Slate Sky Blueberry Grape Watermelon Chocolate Marble

MSFN is made available via donations, subscriptions and advertising revenue. The use of ad-blocking software hurts the site. Please disable ad-blocking software or set an exception for MSFN. Alternatively, register and become a site sponsor/subscriber and ads will be disabled automatically. 


Sign in to follow this  
simonking

VHD Native Boot with Junctions

Recommended Posts

You are seemingly mixing too many things all together without having (yet) a "full" view of the situation.

The term "bootsector" is to all practical effects exactly the same thing as PBR (Partition Boot Record) and as VBR (Volume Boot Record).

Getting more "picky" there are slight differences:

On a FAT12/16 filesystem the bootsector is actually one single sector.

On a FAT32 it is usually three sectors (of which only the first one contains "dynamic" data, i.e. what changes on the specific volume).

On a NTFS it is 16 sectors (of which only the first one contains "dynamic" data, i.e. what changes on the specific volume, but also the second contains some OS dynamic data: the name of the OS loader, i.e. NTLDR or BOOTMGR).

Ove the years there has been a lot of confusions on the terms used.

What gets a drive letter in Windows is a Volume.

A Volume may be a (primary) partition or a logical volume inside extended.

A Partition (extended) does not start with a PBR, but rather with EPBR or EMBR (which is similar to the MBR, and not to a PBR/VBR/bootsector).

Volumes are accessed as \\.\LogicalDrive.

The disk (which is the "whole" thing that contains Parititons and Volumes) is accessed as \\.\PhysicalDrive and it's first sector is always the MBR.

There can be several reasons why a sector is "locked", particularly under Windows 8 or 8.1, it is well possible that you need to use another tool (Clonedisk might do, or, as said *any* hex/disk editor) or that you will need some "trick" to get access to the MBR.

What we have not yet talked about is the exact nature of the .vhd, i.e. is it "static" or "dynamic" ( or "fixed" vs. "sparse")?

Have you checked the "Connectix" appended sector?

Why don't you try leaving (for the moment/tempoorarily) the Paragon thingie you are using alone and try using Clonedisk instead?

Clonedisk being "common ground" may allow me to try replicating the procedure (though I don't run any of the 7/8/8.1 OS's featuring "native" .vhd booting) and I may be able to spot something "queer" in the image.

As an alternative, non-native .vhd booting, by making use of grub4dos and one among Winvblock and Firadisk, is on the other hand more or less documented and never caused issues of the kind you are now reporting.

But again, since I cannot understand what you are actually up to, cannot say if it could be suitable.

What I may do for you could be to create a "static" (fixed size) .vhd that works normally, post it and you could try to populate it with the files you see fit.

Of the two set of files you sent:

The "drive P" has 2048 sectors before and is 123672575 sectors in size i.e. around 63 Gb in size :w00t: (+1 for the NTFS BootMirr+1 for the "Connectix" footer) and has the $Mft starting "normally" @786432

The "drive Z" has 2048 sectors before and is 25161727 sectors in size i.e. around 63 Gb in size :w00t: (+1 for the NTFS BootMirr+1 for the "Connectix" footer) and has the $Mft starting "strangely" @87210

These differences should not cause any problem, however, and the partition size/location in the corresponding MBR are valid.

If you tell me which size you want a static .vhd (and if you want it with Windows 7 or 8 MBR and VBR code), I can make one for you with my "normal" tools/procedures and post it, so that you can try it in your environment.

jaclaz

Share this post


Link to post
Share on other sites

I have tried both static and dynamic VHDs.

 

What is the Connectix appended sector? I have no idea what that is.

 

I could use Clonedisk too for the cloning procedure and let you know if it works. I also have not yet tried grub4dos, which I plan to soon. Fairly exhausted now from all of the hard test work.

Edited by simonking

Share this post


Link to post
Share on other sites

I can make only a "static" vhd (I may make also a "dynamic" one, but it would be more complex and more prone to errors, let's do the static one first).

Even a static one, once compressed with 7-zip will take little space.

A static vhd is nothing but a RAW image with a single "descriptive" sector appended.

This sector is called in jargon "Connectix" for two reasons:

  1. the format was originated in VirtualPC, which was made by Connectix before MS acquired it
  2. it contains the plain text Connectix ;)

Check Clonedisk, create with it a "plain" image, make a copy of it and convert it to .vhd, compare results, see also here:

http://reboot.pro/topic/18278-vhd-manager-basic/?p=168934

http://reboot.pro/topic/18740-drive-droid-boot-from-android/page-3

and given links.

And yes, the idea is that, IF I can manage to create a "valid" .vhd, I can document the procedure used and you can replicate it on your side and/or understand what is different.

So we need to agree to a fixed size.

Since the non-working dynamic one expanded up to 13 Gb, I presume that a 14 Gb would do.

jaclaz

Share this post


Link to post
Share on other sites

Sounds good. I have already started this route with the Paragon cloned VHD, but not successful so far.

Yes, I am well aware that Virtual PC was a Connectix product before MS acquired them. Nice to hear that their plain text name is present as a full-on string in today's world :)

I'll also check the links you provided. Hoping to hack this one eventually - thanks for all your help!

Edited by simonking

Share this post


Link to post
Share on other sites

Ok, let's see if we can go somewhat forward. :unsure:

Attached is the 14gb.vhd and a copy of the "no code" MBR I used (hand carved, with your F553EAA7 signature, a suitable partition entry with 2048 sectors before and the Magic Bytes, partition is NOT active).

I used the following procedure (under XP):

Used MakeSparsefile.exe:

http://jerome.hode.free.fr/opensource/

MakeSparseFile.exe create 14GB.vhd 14G
to create a sparse file.

Used dsfi (part of the dsfok toolkit):

http://members.ozemail.com.au/~nulifetv/freezip/freeware/

to inject the MBR in the image:

dsfi 14GB.vhd 0 512 MBR_14G_NOCODE.DAT
Converted the till now RAW image to VHD using Karyonix raw2vhd tool:

http://reboot.pro/topic/9715-firadisk-and-vhd-img-images/#entry83781

raw2vhd.exe 14GB.vhd
Mounted it with Total Mounter:

http://www.kernsafe.com/product/totalmounter.aspx

Used "normal" Windows XP disk Management to format the partition to NTFS (using quick format).

Ran the bootsect.exe from the WAIK 4 (i.e. the Windows 8 WAIK), see:

http://www.msfn.org/board/topic/156869-get-waik-tools-wo-downloading-the-huge-isos/

bootsect.exe /NT60 L: /mbr

If you want to replicate make SURE to use the "right" drive letter instead of L:.

Under my "standards/knowledge", this is to all effects a valid static vhd, with the Windows 8 MBR and VBR code.

Locally, you can also try to use directly Total Mounter to create and mount the .vhd, and since you already run 8, you can partition/format it through "normal" Disk Manager.

If you want to extract/examine the footer, you can use dsfo:

dsfo 14GB.vhd -512 512 14GBfooter.bin
Please let me know once you have downloaded the files so that I can remove the "large" .7z, around 2 Mb.

jaclaz

MBR_14G_NOCODE.7z

Edited by jaclaz

Share this post


Link to post
Share on other sites

Wow, thanks for those. However at my end the plot got substantially thicker today...

The Surface I was using for development may have been bricked. After draining its battery 100%, it just won't boot back up. Not really sure why.

I do have backups as recent as two days ago, so I have not lost much. Anyways, I should be up and running in a couple days. In the meanwhile, I'll keep doing more tests on the VMs that I have.

PS: I've already downloaded the files, thank you once again for having made them available.

Wow, all of this has been one amazing huge red herring!

First, the Surface started working again, after about 12 hours of idle time...go figure!

What gives? Is there any way to trace the boot process? I wonder what is stalling the boot for so long?

When I run bcdedit from the booted VHD, I get the following. Does this look normal? Is it OK for the device and osdevice to have changed from vhd=[e:]\myvhd.vhd into the below, could this be accounting for the performance crash?

Windows Boot Loader
-------------------
identifier {current}
device locate=\windows\system32\winload.efi
path \windows\system32\winload.efi
description My VHD
locale en-us
inherit {bootloadersettings}
isolatedcontext Yes
allowedinmemorysettings 0x15000075
osdevice locate=\windows
systemroot \windows
resumeobject {9ac1b3b6-bcc9-11e3-82d0-281878d2c336}
nx OptIn
bootmenupolicy Standard
detecthal Yes

Edited by simonking

Share this post


Link to post
Share on other sites

All Magicrar posts have been moved to the Software Hangout.

Share this post


Link to post
Share on other sites

Wow, on the brand new Surface replacement, everything works perfectly. Apparently my BCDSTORE got corrupted somehow and it manifests only when multiple boot entries are present on the old Surface. I'm real glad it stopped working yesterday, as it helped me ID the issue.

 

Thank you so much for all your help. It is sincerely appreciated!

 

Please don’t hesitate to ask me for <redacted> should you enjoy one :) [redacted per supermod request ref. rule #13]

 

Now, anybody up to troubleshoot Windows Update issues with junctions? ;)

 

[reposted my missing reply per request from the supermod]

 

PS: Additional redactions as have been advised across the thread.

Edited by simonking

Share this post


Link to post
Share on other sites

Thanks for the information. Here's some output I've taken from the VHD's and Partitions that work and fail.

Volume P: - works.

Volume Z: - fails.

Disk 1 - VHD for Drive P.

Disk 2 - VHD for Drive Z.

Does any of this provide any insight?

Here's advanced diagnostics on each drive:

Drive P: - boots

 

 

--------------------

 

 

Not sure you if you ever solved your problem, but this may help.

 

Boot to your OS on C drive and mount  VHD, and let's say it mounted as Z: 

So now you want to add the VHD to the boot menu and achieved this by using BCDBOOT

 

Open the COMMAND prompt as ADMIN.   A quick way is at the METRO start screen, type CMD, and when shows up, right mouse click it and Pick RUN AS ADMIN.  

type in at the prompt...  

 

z:

cd z:\windows\system32

bcdboot z:\windows

 

That's all I do, as I recall.. And it works for me.

 

Becareful using EasyBCD on windows 8 with uEFI , as of sept -2014,  it seems to screw up the system and renders it not bootable. And I advice you to make a bootable Recovery USB which is built-in Windows 8.

 

VISUALBCD is better, but requires knowledge and understanding of BCD store and ESP (uEFI system Partition), but I use it to do some basic stuff, although it is  powerful tool, so it seems..

 

 

---

MS reference :

Add a Native-Boot Virtual Hard Disk to the Boot Menu

http://technet.microsoft.com/en-us/library/dd799299(v=WS.10).aspx

 

Boot to VHD (Native Boot): Add a Virtual Hard Disk to the Boot Menu

http://technet.microsoft.com/en-us/library/hh825691.aspx

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...