Jump to content

Hard Drive Partitioning during an Unattended Build


Recommended Posts

Team,

I am wanting to know how to do the following:

i) Partition the remainder of my single hard drive to the D: drive

ii) Change the CDROM drive letter to R:

iii) How to script this into the unattended build ie. Cmdlines.txt

Also, I believe the CDROM drive letter mapping will need to occur late in the build process so that it doesn't interfere with the current CDROM drive letter used during the install.

I know about gdisk but I think this requires a Ghost licence. I have also heard of diskpart ??? Prefer to use a Microsoft solution.

All help appreciated.

Rgds

Yokozuna

Link to comment
Share on other sites


Yokozuna,

Hajimemas***e. You can use AEFDisk to partition the remaining space on your hard disk as a D: drive. I do this all the time in DOS prior to the beginning of my XP install.

If there is unallocated space on your hard disk, you can use a little script I wrote:

@echo off

AEFDisk 1 /freesize

AEFDisk 1 /log:%freesize% /ext:%freesize%:0B

AEFDisk /formatfat:5:Hard_Disk_D /reboot

That batch file will create a new drive from your HD's free space, formats it as FAT32, and reboots. You should run it in DOS, if possible. AEFDisk is free and available at http://www.aefdisk.com/

You can also use AEFDisk just to get the freesize variable, if you are bent on using Microsoft products (FDISK):

FDISK 1 /log:&freesize% /ext:%freesize% /actok /q

You'll still have to format it, and FDISK does not format anything over 64GB.

JP

Link to comment
Share on other sites

JPamplin,

Thanks for your reply. I will try what you have given me.

However, I need to have the CDROM unattended build to do everything without any end user interaction.

Your approach would require me to prepare the disk manually before proceeding with the unattended build.

Are there any other approaches to this subject ?

Rgds

Yokozuna

Link to comment
Share on other sites

Although not knowing much about diskpart, I have used it with Bart's Windows PE and have found it to work great.

It also supports batch files that you can load and it will do all the work for you. Have a look at it as I think it might do what you want.

Sorry, I can't be of anymore help.

Link to comment
Share on other sites

I am still looking for some assistance with this problem.

I am wanting to know how to do the following:

i) Partition the remainder of my single hard drive to the D: drive

ii) Change the CDROM drive letter to R:

iii) How to script this into the unattended build ie. Cmdlines.txt

Also, I believe the CDROM drive letter mapping will need to occur late in the build process so that it doesn't interfere with the current CDROM drive letter used during the install.

I know about gdisk but I think this requires a Ghost licence.

It appears the Microsoft solution is to use their diskpart tool but I have difficulty getting it to work through the unattended approach.

Here is what I have ...

Here is the launching Batch File DDrive.cmd

diskpart /s test.txtecho y | format d: /fs:ntfs

Here is the calling script test.txt

select disk 0create partition primaryassign letter d

The problem is that this script fails to run in the cmdlines.txt file or in the [GUIRunOnce] section of the winnt.sif file. I think this is because the CDROM drive is already mapped to D: drive during the install process.

I tried changing the CDROM drive during the install with the following script but that didn't work.

@Echo offrem -------------------------------------------------------------------------------------------rem This script is used to change the CDROM drive letter from E: to R: for Windows 2000 system.remrem It changes the registry key value from "\DosDevices\E:" to "\DosDevices\R:" underrem HKLM\system\mounteddevices. rem rem Refer to Microsoft Technet Q223188 - How to change System/Boot Drive Letter in Windows.rem -------------------------------------------------------------------------------------------
rem Copy the "\DosDevices\D:" value to "\DosDevices\R:"  Reg query HKLM\system\mounteddevices >~t1 Gawk '/DosDevices\\D:/{printf("reg add HKLM\\system\\mounteddevices \/v \\DosDevices\\R: \/t %%s \/d %%s\n",$2,$NF)}' ~t1>~t.bat Call ~t.bat
rem Delete the "\DosDevices\D:" entryReg delete HKLM\system\mounteddevices /v \DosDevices\D: /f
 del ~t*rem clsEcho %computername% has to be restarted enforcing CD drive to R:

Any suggestions ?????

Rgds

Yokozuna

Link to comment
Share on other sites

This script will change the first 4 CD drive letters to R:, S:, T: and U:. It will also keep the current drive letter for the remainder of the session. I use it from SVCPACK.INF: as it leaves an "alias", it does not interfere with setup's use of the CD.

@ECHO OFF
SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION

SET NEWCDROM1=R:
SET NEWCDROM2=S:
SET NEWCDROM3=T:
SET NEWCDROM4=U:

SET CDCOUNT=0
FOR /F "TOKENS=1,2,3 DELIMS= " %%A IN ('REG QUERY HKLM\SYSTEM\MountedDevices ^| FINDSTR "DosDevices"') DO (
SET TEMP1=%%A
SET TEMP2=!TEMP1:~26,32!
IF "!TEMP2!"=="5C003F003F005C004900440045002300" (
 SET TEMP3=%%A
 SET TEMP4=!TEMP3:~12,2!
 SET /A CDCOUNT=!CDCOUNT!+1
 IF "!CDCOUNT!"=="1" SET CDROM1=!TEMP4!
 IF "!CDCOUNT!"=="2" SET CDROM2=!TEMP4!
 IF "!CDCOUNT!"=="3" SET CDROM3=!TEMP4!
 IF "!CDCOUNT!"=="4" SET CDROM4=!TEMP4!
)
)


IF "%CDROM1%"=="" GOTO NOMORECDS

FOR /F "TOKENS=1 DELIMS= " %%A IN ('MOUNTVOL %CDROM1% /L') DO SET VOLINFO=%%A
MOUNTVOL %CDROM1% /D
MOUNTVOL %NEWCDROM1% %VOLINFO%
SUBST %CDROM1% %NEWCDROM1%\

IF "%CDROM2%"=="" GOTO NOMORECDS

FOR /F "TOKENS=1 DELIMS= " %%A IN ('MOUNTVOL %CDROM2% /L') DO SET VOLINFO=%%A
MOUNTVOL %CDROM2% /D
MOUNTVOL %NEWCDROM2% %VOLINFO%
SUBST %CDROM2% %NEWCDROM2%\

IF "%CDROM3%"=="" GOTO NOMORECDS

FOR /F "TOKENS=1 DELIMS= " %%A IN ('MOUNTVOL %CDROM3% /L') DO SET VOLINFO=%%A
MOUNTVOL %CDROM3% /D
MOUNTVOL %NEWCDROM3% %VOLINFO%
SUBST %CDROM3% %NEWCDROM3%\

IF "%CDROM4%"=="" GOTO NOMORECDS

FOR /F "TOKENS=1 DELIMS= " %%A IN ('MOUNTVOL %CDROM4% /L') DO SET VOLINFO=%%A
MOUNTVOL %CDROM4% /D
MOUNTVOL %NEWCDROM4% %VOLINFO%
SUBST %CDROM4% %NEWCDROM4%\

:NOMORECDS

That should take care of ii & iii. I use Partition Magic / Drive Image Scripting to format my disks, but requires a seperate stage (too risky to mix with setup ... for me), as well as a licence.

Link to comment
Share on other sites

Thanks for your reply to the CDROM drive mapping. I will try this.

In relation to the partitioning of a the hard drive during the unattended build process, I still need to resolve how to do this.

I am wanting to use a single hard drive and create two NTFS partitions during the unattended build process with C & D drive mappings.

The C drive needs to be 8GB and the D drive the balance.

Am I right in saying that the only method known to members of the forum, is to create both these partitions prior to commencing the unattended build ????

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...