IPB

Google Frontpage Forums Unattended CD/DVD Guide
 Forum Rules Unattended CD/DVD Guide Homepage · MSFN Forum Rules
 
Reply to this topicStart new topic
> Diskpart scripting question, Please review for errors
Tripredacus
post Mar 26 2008, 09:20 AM
Post #1


K-Mart-ian Legend
******

Group: Members
Posts: 1208
Joined: 28-April 06
From: Buffalo, NY
Member No.: 94953
OS: Server 2008 x64
Country Flag


Currently I am evaluating the use of WDS to deploy images that contain a recovery partition. ATM I am imaging a test machine from which I will be testing out capturing methods, so I wrote up this quick script (yes literally wrote it on a pad of paper) for how I can structure my diskpart scripting during the deploy phase. Please review the following and LMK if you see anything I should revise or be aware of. The Volume IDs are the real ones I need to use.

Pre-image Diskpart script:

CODE
select disk 0
clean
create part pri size='62220' id='0x07'
select part 1
active
assign letter='c:'
format fs='ntfs' quick
create part ext size='14096' id='0x12'
select part 2
active
assign letter=d:'
format fs='fat32' quick


Post-image diskpart script:

CODE
select disk 0
select part 2
active
attributes set hidden
attributes set nodefaultdriveletter
Go to the top of the page
 
+Quote Post
dim
post Mar 26 2008, 04:08 PM
Post #2


Newbie


Group: Members
Posts: 41
Joined: 7-August 06
Member No.: 106909
Country Flag


I don't see an issue with it. I am not quite sure why you are using the id=byte/guid. Please explain.

I assume you are doing desktops so you don't know need dynamically find the primary disk ID.
Go to the top of the page
 
+Quote Post
Tripredacus
post Mar 27 2008, 01:53 PM
Post #3


K-Mart-ian Legend
******

Group: Members
Posts: 1208
Joined: 28-April 06
From: Buffalo, NY
Member No.: 94953
OS: Server 2008 x64
Country Flag


Because we cannot use RE for XP recovery options, we use another method. This changes the drive ID to x12 instead of x07 so if we are to expect it to match previous computers we shipped out, we need to duplicate it as best as possible. We can already see the current ID with Ghost which shows the C drive to be 7 and the recovery partition to be 12.
Go to the top of the page
 
+Quote Post
Tripredacus
post Mar 28 2008, 11:09 AM
Post #4


K-Mart-ian Legend
******

Group: Members
Posts: 1208
Joined: 28-April 06
From: Buffalo, NY
Member No.: 94953
OS: Server 2008 x64
Country Flag


Alright I am manually testing this script and there appear to be some issues with it.

1. It won't let me assign the ID byte when creating the partition. I will instead set the partition ID during the cleanup phase by using 'attributes set id=0x12' instead.
2. When you create an extended partition, the default numbering for it is 0 (zero).
3. I cannot make part 0 active because it says it is not a data volume.

HELP: I need to insert the following after creating the extended partition?

create partition extended [size=n] [offset=n] [noerr]

I will try it out, or is it recommended to create the logical partition instead of the extended one?

Also, obviously my cleanup script needs to be changed from selecting part 2 to part 0.
Go to the top of the page
 
+Quote Post
Tripredacus
post Mar 28 2008, 12:08 PM
Post #5


K-Mart-ian Legend
******

Group: Members
Posts: 1208
Joined: 28-April 06
From: Buffalo, NY
Member No.: 94953
OS: Server 2008 x64
Country Flag


New Diskpart script (revised)

CODE
select disk 0
clean
create part pri size=62220
select part 1
active
assign letter=c:
format fs=ntfs quick
create part ext size=14096
select part 0
create part log size=14096
select part 2
assign letter=d:
format fs=fat32 quick
exit


Revised Cleanup script

CODE
select disk 0
select part 1
attributes vol set hidden
attributes vol set nodefaultdriveletter
set id=12


I Was about to attempt a second time imaging but I somehow broke my WIM... looks like I am SOL for the moment. I will get to do more work on it next week when I can do a recapture again.

Anyways, I found my ID changing cmd in another thread I made someplace on this forum:
http://www.msfn.org/board/Imagex-question-t103807.html
Go to the top of the page
 
+Quote Post
Tripredacus
post Apr 4 2008, 09:07 AM
Post #6


K-Mart-ian Legend
******

Group: Members
Posts: 1208
Joined: 28-April 06
From: Buffalo, NY
Member No.: 94953
OS: Server 2008 x64
Country Flag


So far this isn't cloning properly because I am still doing something wrong. I just dropped the source image again (with ghost) and checked everything with diskpart. The second partition is listed as OEM type, but I can't find anything online to say how to create an OEM part with diskpart.

List part results:

PART # - TYPE - SIZE - OFFSET
Part 1 - Primary - 61GB - 32KB
Part 2 - OEM - 14GB - 61GB

List vol results:

VOL# - Ltr - FS - TYPE - SIZE - Status - Info
0 - C - NTFS - Partition - 61GB - Healthy -
1 - - FAT32 - Partition - 14GB - Healthy - hidden

Detail Part 1
Type: 07
Hidden: no
Active: Yes

Detail Part 2
Type: 12
Hidden: yes
Active: no

Where can I find info to create a partition with the OEM type? Using the Extended and Logical partitions aren't going to work after all.
Go to the top of the page
 
+Quote Post
TheReasonIFail
post Apr 4 2008, 06:50 PM
Post #7


Member
**

Group: Members
Posts: 105
Joined: 8-April 07
From: Berwyn, Illinois
Member No.: 134809
OS: XP Pro x86
Country Flag


How about this?

CODE
SELECT DISK 0
CLEAN
CREATE PART PRI SIZE=14096
SELECT PART 1
ASSIGN LETTER=D:
FORMAT FS=FAT32 QUICK
CREATE PART PRI SIZE=62220
ACTIVE
ASSIGN LETTER=C:
FORMAT FS=NTFS QUICK
EXIT


Post:

CODE
SELECT DISK 0
SELECT PART 1
ATTRIBUTES VOL SET HIDDEN
ATTRIBUTES VOL SET NODEFAULTDRIVELETTER
SET ID=27

Go to the top of the page
 
+Quote Post
Tripredacus
post May 14 2008, 02:43 PM
Post #8


K-Mart-ian Legend
******

Group: Members
Posts: 1208
Joined: 28-April 06
From: Buffalo, NY
Member No.: 94953
OS: Server 2008 x64
Country Flag


OK thanks if I didn't say it before. I was able to faithfully recreate the recovery partition properly using imagex and diskpart. Now my situation is that I need to be able to boot into the recovery partition. It involves using a program called "MBRInst" by a company called XSS. I looked on the recovery program system builder CD that we are given but it does not have this program. It appears that the company is using a library that they interface from their application to write the bootcode into the MBR.

I've already talked to our rep and he basically said that the developers won't help anyone unless the corporate contract is over $1mil/year, which means we're not one of them.... And they would be the ones I could get this program from. But it also seems that this mbrinst.exe program is also used by HP and should be in their drive image. Is there a way someone could send me that program? PM me if interested or lock this thread if inappropriate.

Thanks.

This post has been edited by Tripredacus: May 14 2008, 02:43 PM
Go to the top of the page
 
+Quote Post
Tripredacus
post May 19 2008, 02:48 PM
Post #9


K-Mart-ian Legend
******

Group: Members
Posts: 1208
Joined: 28-April 06
From: Buffalo, NY
Member No.: 94953
OS: Server 2008 x64
Country Flag


**post removed

This post has been edited by Tripredacus: May 20 2008, 02:21 PM
Go to the top of the page
 
+Quote Post
TheReasonIFail
post May 19 2008, 03:34 PM
Post #10


Member
**

Group: Members
Posts: 105
Joined: 8-April 07
From: Berwyn, Illinois
Member No.: 134809
OS: XP Pro x86
Country Flag


Thanks for the link, I'll be playing with this all this week!
Go to the top of the page
 
+Quote Post
Tripredacus
post May 20 2008, 01:57 PM
Post #11


K-Mart-ian Legend
******

Group: Members
Posts: 1208
Joined: 28-April 06
From: Buffalo, NY
Member No.: 94953
OS: Server 2008 x64
Country Flag


**post removed

This post has been edited by Tripredacus: May 20 2008, 02:11 PM
Go to the top of the page
 
+Quote Post

Google Frontpage Forums Unattended CD/DVD Guide

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



Lo-Fi Version Time is now: 8th January 2009 - 11:50 PM
All trademarks mentioned on this page are the property of their respective owners
MSFN is not affiliated with Microsoft
Copyright © 2001-2008 msfn.org
Privacy Policy