×
Menu
Index

2. Commands for Working with Drives and File Systems

 
Important: When using the Linux version of TBOSDT, all command line options are specified by using a "-" instead of a "/".
Example: LIST HD 0 -f
 
Command Function
Command Syntax
Open a file system (associate a file systemb with a drive). The drive must be a number 0 through 9.
OPEN FS drive: phydrivenum [partitionid]
OPEN FS drive: filename [partitionid]
MOUNT drive: filename [partitionid]
Close a file system
CLOSE FS drive:
UMOUNT drive:
Assign additional UEFI file systems a drive letter. UEFI version only.
OPEN UEFIFS
Close the additional UEFI file system opened. UEFI version only.
CLOSE UEFIFS
Display statistics for a file system
STATS d:
Display volume label for a file system
LIST VOL [d:]
Set the volume label for a file system.
(Currently supported for mounted drives 0: through 9: and drive letters using the Windows version)
SET VOL "volume name" [d:]
List partitions on a hard drive
LIST HD hdnum [/f][/u][/q][/w][/s][/a=n]
  /f - include free space in listing
  /u - include unallocated areas in listing
  /q - use volume sequence as volume id
  /w - use wide format
  /s - list disk signature(s)
  /a - alignment value in sectors (0=cylinder).
List partition details
(1.45+ version)
LIST PART hdnum partid [/q]
  /q - use volume sequence as volume id
List a volume serial number for FAT/FAT32/NTFS partitions or UUID for Ext2/3/4 partitions
(Pro Versions 1.50+ Only)
 
LIST VOLSN phyhdnum partid [/q]
  /q – use sequence for volume id
 
Open hard drive level software cache.
OPEN CACHE hdnum [size][/l=limit][/p][/z]
  /l - max io request size to cache.
  /p - enable partial lazy writing.
  /z - enable full lazy writing.
 
Enabling lazy writing can result in unknown data loss. Always attempt to CLOSE CACHE when lazy writing is enabled to get a report of any write failures. The cache is automatically closed when the device it’s no longer being used. When closed automatically, no write failure errors are reported.
Close hard drive level software cache or force it to flush to disk.
CLOSE CACHE hd [/f][/w]
  /f - force close (ignore lazy write errors).
  /w - flush lazy writes to disk only.
Copy a partition to a file
COPY PARTITION phyhdnum partid targetfile [/b][/q]
  /b - setup for use with bootfile application.
  /q - use sequence for volume id.
Add a virtual FAT drive
ADD VIRTDRV filename sizeinmb [volname] [/b] [/c=n] [/h=n] [/s=n][/l][/w][/fat32][/blocksize=n][/w][/bs=filename] [/bsraw][/empty]
  /b - setup for use with bootfile application
  /c - last cylinder value.
  /h - last head value.
  /s - sectors per track value.
  /l - limit virtual drive file size.
  /w - treat warning as error.
  /empty – create an empty file.
  /fat32 – try using FAT32 instead of FAT as file system.
  /blocksize – size of a sector in bytes.
  /bs – name of file containing boot sector code to use. (note: fat/fat32 only)
  /bsraw – overlay raw boot sector (/bs) with existing BPB.
 
The c h s values all need to be provided for them to be used.
They can be used to create floppy sized virtual drives by making sizeinmb zero and providing the c, h, and s values (remember for c and h the last value is one less than the total count of cylinders or heads. e.g. h=254 means total of 255 heads).
Add a virtual PC VHD drive
ADD VHD filename sizeinmb [/f]
  /f – create a fixed type VHD drive.
Expand a virtual PC VHD drive
SET VHDSIZE filename sizeinmb
Add a VHDX drive
ADD VHDX filename sizeinmb [/f][/s4]
  /f – create a fixed type VHD drive.
  /s4 – Use sector size of 4KiB (4096 bytes).
 
For Windows caching reasons, it is highly recommended to create partitions within a VHDX file that are aligned on at least a 1MiB boundary. That is either 2048 sectors for 512 byte sized sectors or 256 sectors for 4096 byte sized sectors.
Expand a VHDX drive
SET VHDXSIZE filename sizeinmb
Add a vmware VMDK drive
ADD VMDK filename sizeinmb [/f]
  /s – create a SCSI type VMDK drive.
Expand a vmware VMDK drive
SET VMDKSIZE filename sizeinmb
Add a partition
(Pro for BootIt Version)
ADD PARTITION hdnum partid sizeinmib fsid name [fsb] [/q] [/n] [/f] [/e] [/a=n] [/c=n] [/h=n] [/s=n] [/b=n] [/u] [/w] [/bs=filename] [/bsraw]
  fsid - file system identifier (6=FAT,7=NTFS,11=FAT32,…)
  name - name for new partition (gpt/embr).
  fsb - free space before size in MiB (omit for end of block).
  /q - use sequence for volume id.
  /n - use \"normal\" geometry.
  /f - force ending head/sector in MBR.
  /e - align on end.
  /a - alignment value in sectors (0=cylinder).
  /c - last cylinder value.
  /h - last head value.
  /s - sectors per track value.
  /b - bytes per cluster
  /u - leave unformatted (default when fsid format not supported)
  /w - treat warning as error.
  /bs - name of file containing boot sector code to use. (note: fat/f32 only)
  /bsraw – overlay raw boot sector (/bs) with existing BPB.
Delete a partition
(Pro for BootIt Version)
DEL PARTITION hdnum partid [/q][/y]
  /q - use sequence for volume id.
  /y - no confirmation to perform delete.
Slide a partition
(Pro for BootIt Version)
SLIDE hd id [fsb] [/q] [/n] [/f] [/e] [/r] [/a=n] [/c=n] [/h=n][/s=n] [/z]
  hd - hard drive number.
  id - partition id.
  fsb - free space before size in MiB (omit for end of block).
  /q - use sequence for volume id.
  /n - use "normal" geometry.
  /f - force ending head/sector in MBR.
  /e - align on end.
  /r - raw slide (move unused sectors).
  /a - alignment value in sectors (0=cylinder).
  /c - last cylinder value.
  /h - last head value.
  /s - sectors per track value.
  /z - no progress display.
Copy a partition
(Pro for BootIt Version)
COPY PARTITION hd id thd tid [fsb] [/q] [/n] [/f] [/e] [/r] [/a=n] [/c=n] [/h=n] [/s=n] [/b] [/z] [/i]
  hd - source hard drive number.
  id - source partition id.
  thd - target hard drive number.
  tid - target partition id.
  fsb - free space before size in MiB (omit for end of block).
  /q - use sequence for volume id.
  /n - use "normal" geometry.
  /f - force ending head/sector in MBR.
  /e - align on end.
  /r - raw copy (copy unused sectors).
  /a - alignment value in sectors (0=cylinder).
  /c - last cylinder value.
  /h - last head value.
  /s - sectors per track value.
  /b - assume original hd for boot.
  /z - no progress display.
  /i - ignore lock failures.
Resize a partition
(Pro for BootIt Version)
RESIZE hdnum partid [newsizemb] [/q] [/n] [/f] [/e] [/b] [/a=n] [/c=n] [/h=n] [/s=n] [/z]
  /q - use sequence for volume id.
  /n - use "normal" geometry.
  /f - force ending head/sector in MBR.
  /e - align on end.
  /b - resize beginning (extended partitions only)
  /a - alignment value in sectors (0=cylinder).
  /c - last cylinder value.
  /h - last head value.
  /s - sectors per track value.
  /z - no progress display.
Set a volume serial number for FAT/FAT32/NTFS partitions or UUID for Ext2/3/4 partitions
(Pro Versions 1.50+ Only)
SET VOLSN phyhdnum partid serialnumber [/q]
  /q – use sequence for volume id.
Set a partition active
SET PART ACTIVE phyhdnum partid [/q]
  /q - use sequence for volume id.
Set the CHS values for a partition entry
SET PART GEO phyhdnum partid [/C=lastcyl][/H=lasthead][/S=sectorspertrack][/q]
  /q - use sequence for volume id.
Set the partition type
(Pro for BootIt 1.45+ version)
SET PART TYPE phyhdnum partid fsid|{guid}[/q]
  /q - use sequence for volume id.
Set the partition attribute flag
(Pro for BootIt 1.45+ version)
SET PART ATTR phyhdnum partid attrvalue[/q]
  /q - use sequence for volume id.
Set the partition ID
(Pro for BootIt 1.45+ version)
SET PART ID phyhdnum partid id|{guid}[/q]
  /q - use sequence for volume id.
Set a drives partitioning type
(Pro for BootIt 1.45+ version)
SET DISKTYPE phyhdnum mbr | embr | gpt [/n] [/f] [/c=n] [/h=n] [/s=n] [/u]
  /n - use "normal" geometry.
  /f - force ending head/sector in MBR.
  /c - last cylinder value.
  /h - last head value.
  /s - sectors per track value.
  /u - unlimit primaries (EMBR related)
Delete EMBR (keeping MBR)
DEL EMBR phyhdnum
Set the Disk ID
(the two commands are equivalent. "newid" can be either the disk GPT {guid} or MBR signature. The "set diskid" command was added in version 1.72)
SET DISKID phyhdnum newid
SET MBR SIG phyhdnum newid
Change Windows BCD or MountedDevices references.
(Pro Versions 1.57+ Only)
SET REF [BCD|MountedDevices|All] phyhdnum partid orgdiskref orgpartref [newdiskref newpartref] [/oss] [/dno] [/q]
  orgdiskref – original disk guid or MBR signature.
  orgpartref – original partition guid or starting lba.
  newdiskref – optional new disk guid or MBR signature.
  newpartref – optional new partition guid or starting lba.
  /oss – original sector size
  /dno – disable changing only new to original.
  /q – use sequence for volume id.
 
If a GUID is used for a partition or disk reference then both must reference a GUID.
Install MBR code on a hard drive
SET MBR CODE phyhdnum [type]
  type can be "standard" or "win7"
Copy sectors to/from a file.
COPY SECTORS phyhdnum lba numsectors file [/w][/y]
  /w – write sectors from file (otherwise read sectors to file)
  /y – skip confirmation when /w used.
 
When /w is not specified this command reads sectors from a drive and saves them to a file. When /w is specified it reads data from a file and writes it to sectors on the drive.
 
The /w parameter is intended for use by those who know exactly what they are doing. You must be very careful when using the /w parameter. It is only available in interactive mode and will abort in script mode.
 
TBOSDT has the ability to OPEN (or MOUNT) partitions on physical hard drives, as well as file systems contained within a file – such as an ISO file, or a file containing an image of a floppy diskette or hard drive. These drives are assigned a number from 0 through 9 when opened, and then referenced in subsequent commands by using that number plus a colon. The following are some example sequences showing how these commands can be used: