×
Menu
Index

Examples

 
Mounting and accessing a partition on physical hard drive 0 (requires admin privileges)
 
LIST HD 0
list partitions on HD0 (includes partition IDs)
OPEN FS 4: 0 1
open partition with ID=1 on HD0 and assign it to drive 4:
DIR 4:
list files on drive 4:
STATS 4:
display statistics for file system mounted at 4:
DEL FILE 4:filename /y
delete filename on drive 4: and do not confirm the deletion
CLOSE FS 4:
close drive 4:
 
Mounting and accessing a floppy diskette image file named floppy.img
 
OPEN FS 2: floppy.img
open (or mount) the floppy image as drive 2:
COPY FILE 2:
copy filename from drive 2: to current directory
CLOSE FS 2:
close drive 2: (close the image file)
 
Mounting and accessing an ISO file named terabyte.iso
 
OPEN FS 3: terabyte.iso
open (or mount) the ISO file as drive 3:
COPY FILE 3:filename filename1
copy filename on drive 3: to filename1 in current directory
CLOSE FS 3:
close drive 3: (close the ISO file)
 
Mounting and accessing a partition contained within a hard drive image file
 
In this case, the file is a VPC virtual hard drive file named disk1.vhd
 
OPEN FS 5: disk1.vhd 1
open (or mount) partition with ID=1 as drive 5:
OPEN FS 5: disk1.vhd 0x1
same as above, but using 0x1 format to specify the ID
CLOSE FS 5:
close drive 5: (close the virtual hard disk file)
UMOUNT 5:
same as above, but using the UMOUNT syntax
 
Note that all open file systems will be closed automatically when exiting TBOSDT (or when a script completes), without having to explicitly unmount or close them.
 
Copying a partition to a file
 
The COPY PARTITION command can copy an existing partition to a file. The resulting file will be the same size in bytes as the partition copied. The file can then be worked with in the same way as other files containing a file system (such as ISO files and floppy diskette images):
 
COPY PARTITION 0 0xd3 part.img
copy partition with ID=d3 on HD0 to the file part.img
COPY PARTITION 0 0xd3 part.img /b
same as above but setup for use with bootfile (adds 1 sector)
MOUNT 2: part.img
mount part.img and assign to drive 2:
UMOUNT 2:
unmount part.img
 
Creating a virtual FAT drive
 
The ADD VIRTDRV command will create a file containing a FAT file system. The resulting file can then be worked with in the same way as other files containing file systems:
 
ADD VIRTDRV fat.img
create 32 MB FAT file system in file fat.img
ADD VIRTDRV fat.img 32 TEST
same as above but specify "TEST" as the volume name
ADD VIRTDRV fat.img 32 TEST /b
same as above but setup for use with bootfile (adds 1 sector)
OPEN FS 3: fat.img
open (mount) fat.img and assign to drive 3:
 
When working with hard drives and hard drive image files, there are some additional commands (some have already been used above) that can accomplish tasks such as listing partitions on a drive, setting a partition active, and installing MBR code on the drive. These commands can be used without having to first OPEN or MOUNT the drive or drive image file. The following are some examples of these commands (these typically require admin/root privileges):
 
Creating a Virtual PC VHD drive
 
The ADD VHD command will create a file in the format compatible with the Virtual PC/Server software products.
 
ADD VHD my.vhd 32
create 32 MB VHD dynamic virtual drive.
ADD VHD my.vhd 32 /f
create 32 MB VHD fixed virtual drive.
 
Note that TBOSDT currently supports only dynamic and fixed drive types that reside in a single .VHD file. If the files are split (e.g. my.vhd, my.v01, my.v02) then the virtual hard drive will not be supported by TBOSDT. Splitting can occur when the VHD virtual drive is located on a FAT volume and exceeds 4GiB in size. In addition, the current Virtual PC software only supports VHD drives up to 128GiB. Hyper-V supports drives larger than 128GiB.
 
Expanding the size of a virtual PC VHD drive
 
Use SET VHDSIZE command to extend the size of a VHD virtual drive. The maximum size for a VHD drive that will work in Virtual PC is 128GiB. Hyper-V supports VHD files that are larger.
 
SET VHDSIZE my.vhd 64
extend the VHD drive to be 64 MB in size.
 
Creating a VMWare VMDK drive
 
The ADD VMDK command will create a file in the format compatible with the VMWare software products.
 
ADD VMDK my.vmdk 32
create 32 MB VMDK MonolithicSparse virtual IDE drive.
ADD VMDK my.vmdk 32 /s
create 32 MB VMDK MonolithicSparse virtual SCSI drive
 
Note that TBOSDT currently supports only MonolithicSparse (and pre-allocated raw) drive types that reside in a single .VMDK file.
 
Expanding the size of a VMWare VMDK drive
 
Use SET VMDKSIZE command to extend the size of a VMDK virtual drive. The maximum size for a VMDK drive is 2TiB.
 
SET VMDKSIZE my.vmdk 64
extend the VMDK drive to be 64 MB in size.
 
Listing partitions on a physical hard drive, or in a hard drive image file
 
LIST HD 1
list partitions on HD1 (includes partition IDs)
LIST HD 1 /f
same as above, but include free space in the listing
LIST HD disk1.vhd
list partitions in hard drive image file disk1.vhd
 
Setting a partition active on a physical hard drive, or in a hard drive image file
 
SET PART ACTIVE 1 2
set partition with ID=2 active on HD1
SET PART ACTIVE disk1.vhd 4
set partition with ID=4 active in hard drive image file disk1.vhd
LIST HD disk1.vhd
list partitions in hard drive image file disk1.vhd
 
Install MBR code to a physical hard drive, or to a hard drive image file
 
SET MBR CODE 1
install standard MBR code on physical hard drive HD1
SET MBR CODE disk1.vhd
install standard MBR to hard drive image file disk1.vhd
 
Setting the NT Disk Signature on a hard drive, or in a hard drive image file
 
The SET MBR SIG command will write the 4-byte NT disk signature to the MBR sector (1st sector) of a hard drive. The NT disk signature is located at bytes 0x1B8 through 0x1BB in the MBR sector. The disk signature can be cleared by writing zero. Here are some examples:
 
SET MBR SIG 1 0x1A3C77D1F
set the MBR sig to 0xA3C77D1F on physical hard drive 1
SET MBR SIG 0 0x0
set the MBR sig to 0 (clear the sig) on physical hard drive 0
SET MBR SIG disk1.vhd 0x0
set the MBR sig to 0 (clear the sig) in file disk1.vhd
 
Setting the CHS values for a partition entry
 
The SET PART GEO  command will set one or more of the CHS values for a partition to specified values. The following is an example of how this command can be used:
 
SET PART GEO 0 1 /h=254 /s=63
for partid=1 on HD0, set last head to 254, sectors/track to 63