Partition Creation

P

Pascal Bouchard

The problem i enconter regards NTFS partition creation with diskpart.

My target uses a IDE Disk On Chip (iDOC); it is booted with WinPE from a RIS
Server (PXE Boot).

When booted, i use 'diskpart' to create the partition; i then deploy my sdi
image with sdimgr.wsf /writepart...

The system cannot boot from the boot sector of the created partition;
however, if i insert the iDOC in a running XP Pro system and format it with
"Disk Management", deploy the same sdi file onto the partition and replace
it to my target, it will boot properly.

What sort of bad thing do i do ?
 
K

KM

Pascal,
The problem i enconter regards NTFS partition creation with diskpart.

My target uses a IDE Disk On Chip (iDOC); it is booted with WinPE from a RIS Server (PXE Boot).

When booted, i use 'diskpart' to create the partition; i then deploy my sdi image with sdimgr.wsf /writepart...

The system cannot boot from the boot sector of the created partition;

What error message you saw?
Do you get to ntldr? (set timeout to non-zero value in boot.ini to see the ntldr menu)

KM
 
P

Pascal Bouchard

No error message, only a blinking cursor (even with timeout or selections
from boot.ini)

The problem occurs only if i writepart a sdi file created from a sdi loader
drive; if i 'readpart' a running partition and 'writepart' it back, it works
perfectly;

I suppose it is related to the way i construct my sdi file from sdi loader;
here's how i do it.

1st- With sdi loader program, i create a sdi file with a 256Mb size
2nd- With Disk Management, i 'initialize the disk'
3rd- When asked to, i refuse to convert my new disk to a dynamic disk
4th- I create a primary partition full size (251Mb) with a assigned drive
letter 'G' in NTFS compressed format
5th- I mark the partition as active

6th- With the target designer, i build my new image
7th- I copy all my images files to my G drive
8th- I uncompress ntldr file
9th- I create a new sdi file manually (sdimgr.wsf file.sdi /new)
10th- I read the partition (sdimgr.wsf file.sdi /readpart:g:)

11th- When my target is booted with WinPE, i use diskpart to create the
256Mb partition
here are my commands :
select disk 0
clean
create partition primary size=256
select partition 1
active
assign

12th- I write my sdifile with 'writepart' (sdimgr.wsf file.sdi /writepart:c:
/yes)

..... then on boot... blinking cursor...

Looks like the boot sector has bad behaviors...
 
M

Mark K Vallevand

I can't offer the code to do this, but I needed to write a program that
patches the boot record. My company is absurdly paranoid about proprietary
information.

Here is a textual description of the patch.

In the Partition Boot Record, change the number of Heads ( uint16 at offset
0x1a ) from 255 to 16.

For some reason, some BIOSes will work with the number of heads == 255, but
others expect it to be 16. I think heads == 255 means: use logical
addressing or something. Anyway, my process is very similar to yours, and I
must make this patch. If I don't, I see exactly what you describe. A
blinking cursor when I'd expect the BIOS to start booting the partition.

I found this by doing a binary comparison of the boot records of disks that
would and would not boot.

If you download the eval copy of WinHex (www.winhex.com) you can examine
(not change) the boot records of the target disk.
 
K

KM

Pascal,
No error message, only a blinking cursor (even with timeout or selections
from boot.ini)

The problem occurs only if i writepart a sdi file created from a sdi loader
drive; if i 'readpart' a running partition and 'writepart' it back, it works
perfectly;

I suppose it is related to the way i construct my sdi file from sdi loader;
here's how i do it.

Yes, it is.

You will need to construct the right boot sector.
You can do this either by capturing the working image off the target device, or manually hacking the boot sector parametrs as Mark
described.

Also, you can "patch" the bootsector with a free utility (a bunch of such tools available on the Net) but you will have to capture
the right boot sector anyway.
 
P

Pascal Bouchard

In my sdi file, in the PBR Section, this value is presently 255, i compared
it with a functional sdi file, the value was 0x20; i modified it and... yes,
it works now.

I suppose there is no other way but a proprietary program to set this
value... not even sdimgr.wsf.

Thank you verymuch!
 
D

Desi

Pascal,

I had the exact same issue. What I came to find out is that you must
reboot the machine after you create the partition and set it active -
Then boot to RIS and install your image. It is not enough to run the
diskpart creation, set the partition active, assign the letter and copy
the image.

It is now working every time for me.

Desi
 
S

Slobodan Brcin \(eMVP\)

Hi Mark,

What about MBR?

Anyhow PBR geometry can be written trough format command.
Use switches:
/T:tracks Specifies the number of tracks per disk side.
/N:sectors Specifies the number of sectors per track.

Regards,
Slobodan
PS:
Some people use fdisk and format from DOS to place valid MBR, PBR.
 
M

Mark K Vallevand

No problems with MBR. Just the PBR with the one difference. I'll try the
PBR geometry with format. I'm doing a format at one point and this might be
an easy change to eliminate the patch.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top