SAMdisk Utility
Download
Author
Description
SAMdisk is a command-line disk image utility for Windows, Linux and MacOS.
Read and write almost any soft-sectored floppy disk format compatible with the PC floppy controller, including some traditionally copy-protected formats. Also supports hard disk imaging to and from HDF and raw formats.
SAMdisk supports a selection of popular disk image containers, rather than specific disk formats, meaning it automatically supports thousands of existing disk images and track formats.
The following containers types are supported for input:
- EDSK - Extended disk image (Amstrad CPC, Spectrum +3, SAM Coupé, PC)
- MGT - MGT +D/Disciple/SAM (Sinclair Spectrum / SAM Coupé)
- SAD - SAm Disk (SAM Coupé)
- SBT - Sam BooTable disk (SAM Coupé)
- SDF - Sam Disk Format (SAM Coupé)
- DS2 - Velesoft split side format (SAM Coupé)
- CPM - Pro-DOS CP/M (SAM Coupé)
- TD0 - Sydex TeleDisk (various)
- RAW - KryoFlux stream format [IBM MFM and FM only]
- SCP - SuperCard Pro stream format [IBM MFM and FM only]
- DFI - DiscFerret stream format [IBM MFM and FM only]
- IPF - Interchangeable Preservation Format [IBM MFM only]
- HFE - SD HxC Floppy Emulator disk format [IBM MFM and FM only]
- DMK - David M Keil's disk format (mainly TRS-80)
- IMD - ImageDisk utility image (various)
- TRD - Beta128 disk for TR-DOS (Sinclair Spectrum)
- FDI - Full Disk Image (Sinclair Spectrum, not Disk2FDI!)
- OPD - OPus Discovery (Sinclair Spectrum)
- MBD - MB-02+ Disk (Sinclair Spectrum)
- UDI - Ultra Disk Image (Sinclair Spectrum)
- SCL - Sinclair betadisk archive (Sinclair Spectrum)
- DSK - Disk image (Amstrad CPC)
- DSC - WinAPE disk image (Amstrad CPC)
- CFI - Compressed Floppy Image (Amstrad)
- BPB - FAT12/16 BIOS Parameter Block (MS-DOS, Atari ST)
- MSA - Magic Shadow Archive (Atari ST)
- D80 - Didaktik D80
- D88 - Pasopeia D88 (NEC PC-xx)
- D81 - Commodore 1581
- D2M - Commodore CMD FD-2000
- D4M - Commodore CMD FD-4000
- LIF - Logical Interchange Format (Hewlett-Packard)
- DTI - Deep Thought (Jupiter Ace)
- S24 - Sega System 24 (Arcade, 1.8M and 1.88M formats)
- RAW - some raw sector dumps, identified by file size only
The following types are supported for output of new or modified disk images:
- .DSK - Extended DSK flexible format
- .MGT - Miles Gordon Technology +D/SAM (80/2/10/512)
- .SAD - SAm Disk semi-flexible
- .CPM - SAM Coupé Pro-DOS (80/2/9/512)
- .TRD - Beta128 / TR-DOS (typically 80/2/16/256)
- .FDI - Full Disk Image flexible format (Beta128 / TR-DOS, not Disk2FDI)
- .OPD - Opus Discovery (typically 40/1/18/256)
- .MBD - MB-02+ (82/2/11/1024)
- .IMD - ImageDisk flexible format
- .D81 - Commodore 1581 (80/2/10/512)
- .D88 - Pasopeia D88 (NEC PC-xx) flexible format
- .D2M - CMD FD-2000 (81/2/10/1024)
- .D4M - Commodore CMD FD-4000 (81/2/20/1024)
- .DTI - Deep Thought UART stream (80/2/1/2304)
- .LIF - HP Logical Interchange Format (77/2/16/256)
- .RAW - Raw sector dump in suitable regular format
For downloads and full information see the SAMdisk Homepage.
Instructions
Floppy to Image
To create a disk image from an existing SAM disk use:
SAMdisk a: image.dsk
Image to Floppy
To write a SAM disk image back to a real disk use:
SAMdisk image.dsk a:
To write a disk image to a pre-formatted SAM floppy (faster):
SAMdisk image.dsk a: --no-format
To write only used tracks to pre-formatted floppy (fastest!):
SAMdisk image.dsk a: --minimal --no-format
Format Floppy
To format a floppy in MGT format for normal SAM use:
SAMdisk format a:
To format a floppy in CP/M format for ProDos use:
SAMdisk format a: --cpm
Note: Be sure to use only true double-density disks, which should be marked DSDD or 2DD, and are often blue. Covering the hole on high-density disks (usually black) is not recommended!
Atom / Atom Lite
BDOS format drives are supported, on floppy disks, hard disks, or compact flash cards.
List Drives
To display a list of available drives:
SAMdisk list
Sample output:
0: Name: ST380021A Capacity: 80026361856 bytes = 156301488 sectors = 80GB 1: Name: Generic-Compact Flash Capacity: 524869632 bytes = 1025136 sectors = 525MB Format: Atom Lite, 641 records, bootable
A drive number followed by a colon is shown above each entry, and used to refer to the drive in other commands. In this example the OS boot drive is 0: and the BDOS drive is 1:
List Records
To list the BDOS records on this drive:
SAMdisk list 1:
Sample output:
Atom Lite, 641 records: 1 : System 10 : Comet v18 40 : SAM Paint 50 : Lemmings! 1-1 51 : Lemmings! 1-2
List Files
To show a directory listing of files in a single BDOS record (1 in this example):
SAMdisk list 1:1
Sample output:
Record 1: System 1* Mini-FAT16 256 SPECIAL 2 AL-BDOS15a 21 CODE 32777,10701 22/07/2012 00:59 3 AL-LOGO 49 SCREEN$ [mode 4] 22/07/2012 00:59 3 files, 77 free slots, 163K used, 617K free
Drives
Drive to Image
To create a disk image from a BDOS drive:
SAMdisk 1: image.hdf
The output file is uncompressed, so you'll need space matching your source drive size.
Image to Drive
SAMdisk image.hdf 1:
You'll be asked to confirm the target drive is correct before writing begins, though you may skip this step with --force if you need to automate this process.
If your target drive is a different size (even slightly), use --resize to make the necessary adjustments. This is not the default behaviour as a safety precaution.
If your new drive is much larger than the old one, you can use --quick to skip the zero-filling of the new disk after the content is copied.
To convert between Atom and Atom Lite formats during the write, use --byte-swap.
Image to Image
To convert images between Atom and Atom Lite format requires byte-swapping:
SAMdisk atom.hdf atomlite.hdf --byte-swap
To copy an image into a existing image of a different size will require resizing:
SAMdisk small.hdf big.hdf --resize
Create Image
To create a blank HDF disk image (32MB in this example):
SAMdisk create image.hdf 32
This image will still need formatting before use...
Format Drive or Image
To format a drive or image for use with the Atom Lite interface:
SAMdisk format 1:
SAMdisk format image.hdf
To format for use with the legacy Atom interface:
SAMdisk format 1: --atom:
Records
Format Record
To format an existing record, to empty it:
SAMdisk format 1:123
Record to Image
To copy a record (123 in this example) to a floppy disk image:
SAMdisk 1:123 image.mgt
To copy a special ProDos CP/M record to a disk image:
SAMdisk 1:123 image.cpm --cpm
Image to Record
To copy a disk image (MGT or compatible) to a record:
SAMdisk image.mgt 1:123
To copy a 720K CP/M image to a the special ProDos record format:
SAMdisk image.cpm 1:123 --cpm
Record to Record
To copy between records is simple too:
SAMdisk 1:123 1:234
Boot Sector
The first sector on a BDOS drive is the boot sector, which holds configuration parameters for the drive, as well as code to load the splash screen and optionally auto-boot a record.
Boot to File
To copy the boot sector a file:
SAMdisk 1:0 image.bin
File to Boot
To copy a previously saved boot sector (512 bytes) back to the drive:
SAMdisk image.bin 1:0
SAMdisk will automatically update the BDOS parameters in the data before writing. To prevent this happening add --no-fix.