USB Disk Tools
Updated: August 18, 2009
MS-DOS tools to create or delete partitions, check the disk information, and totally restore the disk from an image file. This was originally created and tested on Eee PC netbook computers, but has
since been used on many other computers. Advanced users should easily be able to change the batch code to their requirements.
This can be run within Win98 or WinME DOS versions.
Slight modification would be needed to run from CD/DVD.
First create a DOS Bootable USB drive.
Use the method discussed here
or create your boot disk some other way.
 |
|
Contents |
|
 |
Getting Started
Main Menu
Menu Details
Read Me
Config.sys
Autoexec.bat
Logo.sys
Part.bat
Rest.bat
Download
I use a DOS shareware program called
Aefdisk to handle the partitioning (ver1.7
for testing 2.2+ is on their website).
I use SnapShot for the disk imaging. You can download a time limited trial from
their website.
The backup feature stops working after a certain time but the restore always
works.
First install Windows XP on your computer, and once you have it setup how you want it, use SnapShot within
Windows
to create an image file of the C drive, and call it C-DRIVE.SNA
** THIS IS FOR INFORMATION ONLY - USE AT YOUR OWN RISK **
1-Disk Managment
2-Restore Disk Image
3-Exit to DOS
1-Disk Managment
Delete Partitions
Create Single Partition
Create Partitions with Boot Booster (Eee PC only)
Install Standard DOS MBR loader
Show Disk Information
2-Restore Disk Image
Restore from Image
Restore MBR from Image
Restore Partition Structure from Image
Restore Partition Structure and MBR from Image
Restore Complete Partition from Image
 |
Delete Partitions:
Deletes all Partitions on the first disk.
Installs Standard DOS MBR loader on the first disk.
Create Single Partition:
Deletes all Partitions on the first disk.
Installs Standard DOS MBR loader on the first disk.
Creates a single NT Partition 1 of the total size of the first disk.
Create Partitions with Boot Booster: (Eee PC
only)
Deletes all Partitions on the first disk.
Installs Standard DOS MBR loader on the first disk.
Creates an 8mb EFI Partition 2 at the end of the first disk.
Creates an NT Partition 1 of the remaining size of the first disk.
The EFI Partition is so that the BIOS Boot Booster feature is shown.
Boot Booster basically caches part of the Bios to that partition so when you
boot
it skips the Asus Logo and Bios checks.
Do not enable Boot Booster in the BIOS until XP has been installed.
Please note the 8mb size was created for the 701 (4G) so you may need to
edit this for your Eee PC model, depending on the size of the drive.
Install Standard DOS MBR loader:
Installs Standard DOS MBR loader on the first disk.
Show Disk Information:
Shows Partition information for the first disk.
Shows Partition information for the USB disk.
Restore from Image:
Restores a Partition on the first disk from an Image file.
Checks that the first disk is bootable, fixes if not.
Restore MBR from Image:
Restores the first disk MBR from an Image file.
Restore Partition Structure from Image:
Restores the first disk Partition Structure from an Image file.
Restore Partition Structure and MBR from Image:
Restores the first disk Partition Structure from an Image file.
Restores the first disk MBR from an Image file.
Restore Complete Partition from Image:
Restores the first disk Partition Structure from an Image file.
Restores the first disk MBR from an Image file.
Restores a Partition on the first disk from an Image file.
Checks that the first disk is bootable, fixes if not.
DOS Command Options:
Advanced users can exit to DOS and use any command line options.
Type AEFDISK/? for Disk Partitioning options.
Type SNAPSHOT/? for Disk Image Restore options.
 |
Copy these files to the root of the USB drive:
Config.sys
Autoexec.bat
Logo.sys |
- See below
- See below
- Optional |
Copy these files to a folder called DOS on the USB drive:
AEFDISK.EXE
SNAPSHOT.EXE
C-DRIVE.SNA
PART.BAT
REST.BAT |
- Shareware (Aefdisk) 1.7
tested
- Trial (SnapShot)
- Your SnapShot Image File
- See below
- See below |
Make new Text file and rename it Config.sys
Right click EDIT then place the following into it.
[MENU]
SUBMENU=PART0, Disk Management
SUBMENU=REST0, Restore Image File
MENUITEM=QUIT, Exit to DOS
[PART0]
MENUITEM=PART1, Delete Partitions
MENUITEM=PART2, Create Single Partition
MENUITEM=PART3, Create Partitions with Boot Booster
MENUITEM=PART4, Install Standard DOS MBR loader
MENUITEM=PART5, Show Disk Information
SUBMENU=MENU, Back to Main Menu
[REST0]
MENUITEM=REST1, Restore from Image
MENUITEM=REST2, Restore MBR from Image
MENUITEM=REST3, Restore Partition Structure from Image
MENUITEM=REST4, Restore Partition Structure and MBR from Image
MENUITEM=REST5, Restore Complete Partition from Image
SUBMENU=MENU, Back to Main Menu
[PART1]
[PART2]
[PART3]
[PART4]
[PART5]
[REST1]
[REST2]
[REST3]
[REST4]
[REST5]
[QUIT]
|
Make new Text file and rename it Autoexec.bat
Right click EDIT then place the following into it.
@ECHO OFF
CLS
PROMPT=$P$G
IF %CONFIG%=="" GOTO QUIT
GOTO %CONFIG%
:PART1
:PART2
:PART3
:PART4
:PART5
IF NOT EXIST DOS\PART.BAT GOTO QUIT
CALL DOS\PART.BAT %CONFIG%
GOTO QUIT
:REST1
:REST2
:REST3
:REST4
:REST5
IF NOT EXIST DOS\REST.BAT GOTO QUIT
CALL DOS\REST.BAT %CONFIG%
:QUIT
|
This is optional. This replaces the default WINDOWS 98/ME LOGO.
Make a blank 0 length file and call it logo.sys
This is the file that deals with the Partitioning.
This primarily uses AEFDISK.
Settings can be changed for other PCs or Controllers.
Settings included are tested with the Asus Eee PC 701
(4G)
@ECHO OFF
PROMPT=$P$G
CD\
::=================
:: USER SETTINGS
::-----------------
SET srcdrv=c:
SET srcnum=1
SET destnum=2
SET srcstr=USB
SET deststr=Eee PC
SET dospath=%srcdrv%\DOS
::=================
:: SYSTEM SETTINGS
::-----------------
SET partype=%1
SET delonly=false
SET noboost=false
SET booston=false
SET mbronly=false
SET msgpart=""
SET endpart=""
::=================
:: MENU SETTINGS
::-----------------
IF %partype%=="" SET partype=PART1
IF %partype%==PART1 SET delonly=true
IF %partype%==PART1 SET msgpart=Delete %deststr%Partitions
IF %partype%==PART1 SET endpart=%deststr%Partitions Deleted
IF %partype%==PART2 SET noboost=true
IF %partype%==PART2 SET msgpart=Create Single %deststr%Partition
IF %partype%==PART2 SET endpart=Single %deststr%Partition Created
IF %partype%==PART3 SET booston=true
IF %partype%==PART3 SET msgpart=Create %deststr%Partitions with Boot Booster
IF %partype%==PART3 SET endpart=%deststr%Partitions with Boot Booster Created
IF %partype%==PART4 SET mbronly=true
IF %partype%==PART4 SET msgpart=Install Standard DOS MBR loader to %deststr%
IF %partype%==PART4 SET endpart=Standard DOS MBR loaded to %deststr%
::#########################################################
::# #
::# CHECK DRIVES #
::# #
::#########################################################
:_LOAD
::# CHECK SOURCE DRIVE
IF EXIST %srcdrv%\windows\explorer.exe GOTO _ERRDRV
IF NOT EXIST %dospath%\aefdisk.exe GOTO _ERRFILE
SET ALLSIZE=0
SET freesize=0
PATH=%dospath%\;%srcdrv%\
::# CHECK DEST DISK NUM EXISTS
AEFDISK %destnum% /ALLSIZE
IF %ALLSIZE%==0 GOTO _ERRDISK
::#########################################################
::# #
::# PARTITION MENU #
::# #
::#########################################################
:_PARTMNU
::# SHOW DISK PARTITION INFO ONLY
IF %partype%==PART5 GOTO _SHOWINF
CLS
ECHO %msgpart%
ECHO ALL FILES WILL BE DELETED!!!
ECHO.
PAUSE
GOTO _PARTDEL
::#########################################################
::# #
::# PARTITION PROCESS #
::# #
::#########################################################
:_PARTDEL
CLS
IF %mbronly%==true GOTO _PARTMBR
::# DELETE ALL PARTITIONS
AEFDISK %destnum% /delall
ECHO.
::# GET FREESIZE
SET freesize=0
AEFDISK %destnum% /freesize
:_PARTMBR
::# LOAD STANDARD MBR
AEFDISK %destnum% /MBR
ECHO.
IF %delonly%==true GOTO _PARTEND
IF %mbronly%==true GOTO _PARTEND
IF %noboost%==true GOTO _NOBOOST
:_BOOSTON
::# CREATE PARTITION 2 WITH EF AND 7mb (8mb)
AEFDISK %destnum% /pri:7:EF:2
ECHO.
::# GET FREESIZE FOR PARTITION 1
SET freesize=0
AEFDISK %destnum% /freesize
::# DELETE ALL PARTITIONS AGAIN
AEFDISK %destnum% /delall
ECHO.
::# CREATE PARTITION 1 WITH NT AND FREESIZE
::# CREATE PARTITION 2 WITH EF AND 7mb (8mb)
AEFDISK %destnum% /pri:%freesize%:07:1 /pri:7:EF:2
ECHO.
AEFDISK %destnum% /activate:1
ECHO.
GOTO _PARTEND
:_NOBOOST
::# CREATE PARTITION 1 WITH NT AND TOTAL SIZE
AEFDISK %destnum% /pri:0:07
ECHO.
:_PARTEND
::# SHOW THE PROCESS END MESSAGE
ECHO -----------------------------------------------------
ECHO %endpart%
IF %delonly%==true ECHO Unpartitioned - %freesize% MB Available
IF %noboost%==true ECHO Created Partition - Windows NT %freesize% MB
IF %booston%==true ECHO Created Partition1 - Windows NT %freesize% MB
IF %booston%==true ECHO Created Partition2 - Boot Booster EFI 8 MB
ECHO -----------------------------------------------------
:_REBOOT
::# SHOW REBOOT MESSAGE
ECHO Press CTL-ALT-DEL to reboot
PAUSE >NUL
CLS
GOTO _REBOOT
::#########################################################
::# #
::# SHOW DISK INFO #
::# #
::#########################################################
:_SHOWINF
CLS
ECHO %deststr%Disk Info:
AEFDISK %destnum% /show
AEFDISK %destnum% /info
ECHO.
ECHO -----------------------------------------------------
SET freesize=0
AEFDISK %destnum% /freesize
ECHO TOTAL FREE SPACE: %freesize% MB
ECHO -----------------------------------------------------
ECHO Press any key to show %srcstr% disk info . . .
ECHO Press CTL-ALT-DEL to reboot
PAUSE >NUL
:_SHOWUSB
CLS
ECHO %srcstr% Disk Info:
AEFDISK %srcnum% /show
AEFDISK %srcnum% /info
ECHO.
ECHO -----------------------------------------------------
ECHO Press any key to show %deststr%disk info . . .
ECHO Press CTL-ALT-DEL to reboot
PAUSE >NUL
GOTO _SHOWINF
::#########################################################
::# #
::# ERROR MESSAGES #
::# #
::#########################################################
:_ERRDRV
CLS
ECHO =============================================================================
ECHO **** ERROR - SOURCE DRIVE NOT SUPPORTED ****
ECHO =============================================================================
PAUSE
GOTO _EXIT
:_ERRDISK
CLS
ECHO =============================================================================
ECHO **** ERROR - SYSTEM DISK NOT FOUND ****
ECHO =============================================================================
PAUSE
GOTO _EXIT
:_ERRFILE
CLS
ECHO =============================================================================
ECHO **** ERROR - SOURCE FILE CORUPT OR MISSING ****
ECHO =============================================================================
PAUSE
GOTO _EXIT
::#########################################################
::# #
::# EXIT TO DOS #
::# #
::#########################################################
:_EXIT
CLS
|
 |
This is the file that deals with the Image Restore.
This primarily uses SNAPSHOT but also uses AEFDISK.
Settings can be changed for other PCs or Controllers.
Settings included are tested with the Eee PC 701 (4G)
@ECHO OFF
PROMPT=$P$G
CD\
::=================
:: USER SETTINGS
::-----------------
SET srcdrv=c:
SET destnum=2
SET destdrv=HD2
SET srcstr=USB
SET deststr=Eee PC
SET imgfile=C-DRIVE
SET dospath=%srcdrv%\DOS
SET imgpath=%dospath%
::=================
:: SYSTEM SETTINGS
::-----------------
SET restype=%1
SET resonly=false
SET mbronly=false
SET partonly=false
SET partmbr=false
SET msgrest=""
SET endrest=""
::=================
:: MENU SETTINGS
::-----------------
IF %restype%=="" SET restype=REST1
IF %restype%==REST1 SET resonly=true
IF %restype%==REST1 SET msgrest=Restore %deststr%from Image
IF %restype%==REST1 SET endrest=%deststr%Restore Complete
IF %restype%==REST2 SET mbronly=true
IF %restype%==REST2 SET msgrest=Restore %deststr%MBR from Image
IF %restype%==REST2 SET endrest=%deststr%MBR Restore Complete
IF %restype%==REST3 SET partonly=true
IF %restype%==REST3 SET msgrest=Restore %deststr%Partition Structure from Image
IF %restype%==REST3 SET endrest=%deststr%Partition Structure Restore Complete
IF %restype%==REST4 SET partmbr=true
IF %restype%==REST4 SET msgrest=Restore %deststr%Partition Structure and MBR from Image
IF %restype%==REST4 SET endrest=%deststr%Partition Structure and MBR Restore Complete
IF %restype%==REST5 SET msgrest=Restore %deststr%Complete Partition from Image
IF %restype%==REST5 SET endrest=%deststr%Complete Partition Restore Complete
::#########################################################
::# #
::# CHECK DRIVES #
::# #
::#########################################################
:_LOAD
::# CHECK SOURCE DRIVE
IF EXIST %srcdrv%\windows\explorer.exe GOTO _ERRDRV
IF NOT EXIST %imgpath%\%imgfile%.SNA GOTO _ERRFILE
IF NOT EXIST %dospath%\snapshot.exe GOTO _ERRFILE
IF NOT EXIST %dospath%\aefdisk.exe GOTO _ERRFILE
SET ALLSIZE=0
PATH=%dospath%\;%srcdrv%\
::# CHECK DEST DISK NUM EXISTS
AEFDISK %destnum% /ALLSIZE
IF %ALLSIZE%==0 GOTO _ERRDISK
SET ALLSIZE=0
::#########################################################
::# #
::# RESTORE MENU #
::# #
::#########################################################
:_RESTMNU
CLS
ECHO %msgrest%
ECHO ALL FILES WILL BE DELETED!!!
ECHO.
PAUSE
GOTO _RESTPAR
::#########################################################
::# #
::# RESTORE DISK #
::# #
::#########################################################
:_RESTPAR
IF %resonly%==true GOTO _RESTORE
IF %mbronly%==true GOTO _RESTMBR
SNAPSHOT RESTORE %destdrv% partitionstructure %imgpath%\%imgfile%.SNA -Y
IF %partonly%==true GOTO _RESTEND
:_RESTMBR
SNAPSHOT RESTORE %destdrv% MBR %imgpath%\%imgfile%.SNA -Y
IF %mbronly%==true GOTO _RESTEND
IF %partmbr%==true GOTO _RESTEND
:_RESTORE
SNAPSHOT RESTORE %destdrv% auto %imgpath%\%imgfile%.SNA -Y
SNAPSHOT CHECKBOOT %destdrv% -Y
:_RESTEND
ECHO -----------------------------------------------------
ECHO %endrest%
:_REBOOT
ECHO Press CTL-ALT-DEL to Reboot
PAUSE >NUL
CLS
GOTO _REBOOT
::#########################################################
::# #
::# ERROR MESSAGES #
::# #
::#########################################################
:_ERRDRV
CLS
ECHO =============================================================================
ECHO **** ERROR - SOURCE DRIVE NOT SUPPORTED ****
ECHO =============================================================================
PAUSE
GOTO _EXIT
:_ERRDISK
CLS
ECHO =============================================================================
ECHO **** ERROR - SYSTEM DISK NOT FOUND ****
ECHO =============================================================================
PAUSE
GOTO _EXIT
:_ERRFILE
CLS
ECHO =============================================================================
ECHO **** ERROR - SOURCE FILE CORUPT OR MISSING ****
ECHO =============================================================================
PAUSE
GOTO _EXIT
::#########################################################
::# #
::# EXIT TO DOS #
::# #
::#########################################################
:_EXIT
CLS
|
 |
Download Now (126 downloads)
|