Jump to content

[Help] Manually add the boot sector...


Recommended Posts

Posted

There have been cases where when I can't Ghost a system so I begin a Windows XP install on a system and then boot into a PE when it reaches the GUI phase (After the boot sector is created)...

I know I can use Diskpart to create the partition at a command prompt, and use XCopy to copy the contents of a drive, so I was wondering how to go about creating a boot sector from a PE would be done through a command prompt...

My hope is to eliminate the need to have to do the "Install XP" step and just do everything in one fell swoop...


Posted

There is a fixboot command that writes a boot sector to the drive.

If you already have a boot sector that you want to use, there are some small programs that will read/write the boot sector - they're meant to be run in pure DOS, so I'm not sure if they'll work under XP command prompt. Google should find them, if not I can quickly write one for you ;)

Posted

not really sure what you're trying to do exactly, but if the boot sector is hosed then when you boot up with the winxp/2k cd you could enter the command console and run both fixboot and fixmbr. that usually fixes the disk so it'll boot up. you should be able to ghost after that. other possibility is that the NTFS system has a 'dirty' flag on it and needs to be removed before you can proceed. hope that helps you out!

not really sure what you're trying to do exactly, but if the boot sector is hosed then when you boot up with the winxp/2k cd you could enter the command console and run both fixboot and fixmbr. that usually fixes the disk so it'll boot up. you should be able to ghost after that. other possibility is that the NTFS system has a 'dirty' flag on it and needs to be removed before you can proceed. hope that helps you out!

Posted

Ghost does not always work, even if you try Fixboot and fixmbr... Hell there are times that doing either of those causes the drive to become blank...

My process allows me to manually copies files from drive A to drive B, however the important thing about Ghost is that it also copies the boot sector, which my method doesn't, so I need to be able to create the NTFS boot sector required to make 2k/XP work...

I'm NOT doing it through the recovery console, I'm doing it from within a BartPE Windows...

Posted

I've never had an issue w/Ghost not creating a bootable image. That is as long as you're doing a dump and not a copy or partition dump, which does not grab the MBR. I've been using Ghost for years w/o issue so I'm kinda stumped as to why you'd be in a situation like this. Could you post the command line used that gives you grief?

Posted

Assuming you can boot to MS-DOS:

Save as BSSAVE.BAT:

@echo off
md c:\dos
echo LCS:100 2 0 1 > c:\boot.tmp
echo rcx >> c:\boot.tmp
echo 200 >> c:\boot.tmp
echo n c:\bootsect.dat >> c:\boot.tmp
echo wcs:100 >> c:\boot.tmp
echo q >> c:\boot.tmp
echo. >> c:\boot.tmp
debug < c:\boot.tmp
del c:\boot.tmp
ECHO HARD DISK BOOTSECTOR STORED AS C:\BOOTSECT.DAT

Save as BSWRITE.BAT:

@echo off
ECHO THIS FILE WILL WRITE A:\BOOTSECT.DAT TO THE PRIMARY HARD DISK BOOTSECTOR!
ECHO EXPECT YOUR COMPUTER TO RESTART UPON COMPLEATION.
ECHO.
ECHO PRESS ANY KEY TO CONTINUE, OR CTRL-C TO QUIT.
echo WCS:100 2 0 1 > a:\boot.tmp
echo q >> a:\boot.tmp
echo. >> a:\boot.tmp
debug a:\bootsect.dat < a:\boot.tmp
del a:\boot.tmp
echo g=ffff:0|debug

Note that you may modify them, but from memory you CANNOT run bswrite from C:\. If desired use a ramdrive (eg, boot into DOS from CD and create a ramdrive, copy bootsect.dat to your ramdrive and replace A: with the drive letter of your ramdrive, eg R:). Also note that HDD must be identical (ie same size, same manufacturer, same partition size) to use bswrite - or writing the bootsector WILL CAUSE PROBLEMS. This is dangerous! But, if you know what you're doing - go for it.

I used to use if for MANUALLY installing MS-DOS7.1 AFTER WinXP... What I would do is install windows xp on a FAT-32 patition, create a C:\DOS directory and copy all the files I needed, then boot from a bootdisk, run BSSAVE... to back-up the NT (XP's) bootsector, then SYS C:, then run BSSAVE again edit the bootsector (to use IO.DOS and MSDOS.DOS rather than .SYS ... which in turn would use config.dos instead of config.sys) - this would allow me to install Windows 98 later and have them independently boot. And then I would run BS-WRITE to restore the NT-bootsector (the only other way to do this is with recovery console which takes a lot longer if you boot into it then doing it with the batch file). You MUST run it from the floppy (or ramdrive) and not from C:. That is your bootsector and your files .bat and debug.exe - and your boot (io.sys, msdos.sys, autoexec.bat, config.sys, command.com) must all be booted from your floppy (or CD) and NOT from your HDD or there will be problems writing the bootsector (but you can read it booted from the HDD).

Oh by the way, I assume you can only use this on drives formatted FAT or FAT32. Use MS-DOS 7.1 if possible. Oh and don't say I didn't warn you...

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...