Jump to content

Create DOS boot from Winpe using diskpart & format /fs:fat


cswaters1

Recommended Posts

Hi,

This is a bit of a strange question but, well I'm using winpe to create a build process but I've reached a point where I can use all the winpe /win32 tools to create a partition < 2048MB and format it as a FAT16 disk, I would really like to just copy the COMMAND.COM, IO.SYS and MSDOS.SYS files across and then use some kind of utility MBR? kind of thing where I can make the partition bootable to COMMAND.COM all form within WinPE.

What do you think, am I mad? is this possible? It will be used to build quite a lot of servers so it needs to be command line based so I can perform this from a script?

I tried using MBRFIX and copying a .BIN from a disk/partition formatted using FDISK, FORMAT and SYS etc, and tried restoring this to the new winpe diskpart / format partition but no joy, any help would be really appreciated.

Many thanks,

Craig.

Link to comment
Share on other sites


I know someone is going to laugh, but to tell you the truth, I did it the most simplistic way possible... I keep a copy of GHOST32.exe on my PE image folder structure, along with an absolutely tiny image of a DOS bootable partition. The ghost image for a DOS boot is like ~200kb when compressed. This saves me from having to create partitions, format, blah blah blah -- I just "ghost and go".

If Ghost isn't an option, maybe make sure you're using DISKPART to set that primary partition active. Your diskpart script should be something like this:

SEL DISK 0
CLEAN
CRE PAR PRI SIZE=2000
SEL PAR 1
ACTIVE
ASSIGN LETTER=C:

Now you can format C: /q /x /fs:FAT

Now you can copy in IO.SYS, MSDOS.SYS, and Command.Com (in that order) and set the first two for attributes +S +H +R. That should fix you up.

Edit: I just tried my second method and it didn't work. Not sure exactly how you could do it manually, although I'm sure there's a way that I'm just not thinking of. I *think* you can do it that way, but I just don't recall how...

Edited by Albuquerque
Link to comment
Share on other sites

Thanks for the Ghost32.exe info, this does work!

I also found drvspace.bin is in the c:\ dos partition after fdisk and format /s is performed. I've tried using about 5 different utilities to tray and copy the MBR information from a working computer to this server but, nope not wanting to play, just get 'error missing operating system'...

This is really doing me in, I can go the ghost way, but would really just prefer to use a command line utility to sort the MBR out...

Any other suggestions please!

Cheers for your help!

Link to comment
Share on other sites

DRVSPACE.BIN isn't required unless you plan on eventually using Microsoft's DriveSpace utility to compress that disk. :) I wasn't able to find a way to make it work through a command line just by doing raw file copies and setting attributes.

I'm of the mind that you'll need to use some sort of third party utility to get this done; more than likely Ghost will be easiest to implement in my opinion.

Link to comment
Share on other sites

I think you would need something to create a boot sector on the hard drive. Just copying files won't work. The format /s does create the boot sector though. Although the idea of a small ghost file sounds better to me and if you need any additional files added later, you can just update the ghost image instead of rewriteing any copy scripts.

Link to comment
Share on other sites

Best thing about the Ghost option is that FAT / FAT32 images can be directly manipulated (files dropped in, files deleted, et al) unlike NTFS images that are read-only. THus, you can maintain one "standard" ghost image on a network somewhere and always pull it down, and make updates to it whenever you need.

Link to comment
Share on other sites

Thanks for the input!

Today I am using ghost32, but I would sure like to adjust that boot record... Ghost is good but I want the info on the DOS partition to be copied from a central repository and be managed from there.

I have found the following information:

When I use FDISK and FORMAT from a 622 disk the maximum size of the partition is 2044 where as when I use diskpart the max can be as big as you like but I'm using 2047 to squeeze fat16 in. I tried dsfo /dsfi \\.\c: 0 512 filename.dat, but I am wondering if all I am copying is some raid disk information or something.

This is HP Proliant server hardware, HP/Compaq store raid configuration of the server locally on the disk, not on the raid array.

So ghost it is today.

Thanks again for your suggestions!

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