What Is an IMA File? A Raw Floppy Disk Image, and How to Check One Before You Trust It
An IMA file is a raw copy of a floppy disk, and readers can open damaged ones with no warning. Jump to your question below, or work through it in order.
What Is an IMA File? A raw floppy disk copy with no header in front
Short answer
An IMA file is a raw copy of a floppy disk, one sector after another, with no header in front. Most IMA files are FAT12 disks of 1,474,560 bytes. The ending .ima is a label, and the size and the first sector show what the file is.
We made 18 IMA files in the nine floppy sizes, read 11 public disk images and damaged one IMA file in 50 ways. Six readers handled the 50 copies in six ways, and only 2 copies gave the same answer in all six.
To check an IMA file, read the six steps. To see what is inside, read the layout. If your IMA file will not open, begin with the eight causes.
An IMA file is a raw copy of a floppy disk, written sector by sector with no header in front. Most IMA files are FAT12 disks of 1,474,560 bytes. The ending .ima is a label, and the first sector shows what the file is.
Picture a driver disk, an old game or a setup floppy that you meet as setup.ima. The drive is gone, but the IMA file has every byte that the disk had. Open an IMA file in an emulator or an archive tool and you see folders and files.
Wikipedia on the IMG format says the .img ending was first used for raw floppy images, and that .ima names floppy images in some programs. It adds that .imz is a zipped floppy image with one .IMA entry, and that WinImage makes these.
FileInfo lists three uses of the .ima ending. They are disk images, Sage ACT! email messages and IMA ADPCM audio. This page covers an IMA file that is a disk image, and the versus part separates the three.
Wikipedia on disk images says emulators use images of old floppies, because an image is simpler than a drive. It adds that the Unix dd program can make raw images. An IMA file is a raw image, so it has the disk bytes and nothing more.
Where our IMA files come from
We worked with three sets of files. We made 18 IMA files with two tools, in all nine floppy sizes. We read 11 public disk images from 6 projects. We also built a base IMA file, base.ima, and damaged copies of it in 50 ways.
The public images are test files and sample disks from emulator and library projects. Two of them are boot disks with no FAT disk at all, and one is a cut IMA file. They show what readers do with images from outside our lab, though most are small.
The ending is no guide to the content of a file. IMA files of 1,474,560 bytes are almost always 1.44 MB floppies, but the first sector decides how readers treat them. Our tests below show what happens when that sector or the file around it changes.
IMA file facts at a glance
| Property | Value |
|---|---|
| Meaning | Raw floppy disk images. FileInfo files the ending as disk images and lists WinImage, Nero, UltraISO, IsoBuster and MagicISO. |
| Header | None. Byte 0 of the file is byte 0 of the disk. |
| Usual size | Most IMA files are 1,474,560 bytes, or 2,880 sectors of 512 bytes. That is the 1.44 MB floppy. Nine sizes exist, from 163,840 to 2,949,120 bytes. |
| File system | FAT12 in every IMA file we made. A reader works out the FAT type from the number of clusters. |
| First bytes | EB or E9 in 28 of our 30 images. Not 89 49 4D 41. All 30 have 55 AA at byte 510. |
| Other uses | Sage ACT! email and IMA ADPCM audio, per FileInfo. |
| Related | IMG files are the same bytes under another name. IMZ files are zipped IMA files. VHD files add their own footer. |
| Opens with | Archive tools, mtools, disk forensics tools and emulators. We tested five readers. |
| Our tests | 18 made files, 11 public images, 50 damaged copies of one file and six readers, on Linux. |
Wrong page? Copies of hard disks are disk images or DD files. Virtual disks are VHD files.
What Is Inside an IMA File? A boot sector, two FATs, a root folder and the data
An IMA file is a boot sector, two copies of the FAT table, the root folder and then the data. IMA files of 1.44 MB have 2,880 sectors of 512 bytes, and the first 33 are structure. The boot sector shows readers how to find the rest.
We built a test IMA file with mformat and called it base.ima, so every part can be read. It has five files and one folder, and 201,267 bytes of file data. The figure shows where its parts lie, from the first byte.
Read the figure from the top. Wikipedia on FAT design lists the fields of the boot sector in the order that we show below. Readers use them to work out the sizes of the FATs, the root folder and the data.
The first 64 bytes of an IMA file
xxd -l 64 base.ima
00000000: eb3c 904d 544f 4f34 3034 3300 0201 0100 .<.MTOO4043.....
00000010: 02e0 0040 0bf0 0900 1200 0200 0000 0000 ...@............
00000020: 0000 0000 0000 29ae 1bad 2d49 4d41 5445 ......)...-IMATE
00000030: 5354 2020 2020 4641 5431 3220 2020 fa31 ST FAT12 .1
The first three bytes, EB 3C 90, are a jump over the table to the boot code. The next eight bytes spell the maker name, MTOO4043. The numbers that follow are stored with the low byte first, so 00 02 is 512 and 40 0B is 2,880.
Further along, a label named IMATEST and the text FAT12 appear. The two bytes 55 AA at byte 510 are the boot signature, and all 30 of the IMA files and images we made or collected have them.
The fields that matter
| Field | Offset | Size | In base.ima |
|---|---|---|---|
| Jump | 0 | 3 |
EB 3C 90
|
| Maker name | 3 | 8 |
MTOO4043
|
| Bytes per sector | 11 | 2 | 512 |
| Sectors per cluster | 13 | 1 | 1 |
| Reserved sectors | 14 | 2 | 1 |
| FAT copies | 16 | 1 | 2 |
| Root entries | 17 | 2 | 224 |
| Total sectors | 19 | 2 | 2,880 |
| Media byte | 21 | 1 |
F0
|
| Sectors per FAT | 22 | 2 | 9 |
| Sectors per track | 24 | 2 | 18 |
| Heads | 26 | 2 | 2 |
| Boot signature | 510 | 2 |
55 AA
|
Offsets and sizes are in bytes. Every reader we tested needs the fields in the table to be sensible, and every one refused or gave a changed answer when we broke them. The damage part shows how.
How readers find the FAT type
Readers do not trust the name FAT12. The OSDev wiki says the FAT type comes from the number of clusters, which is fewer than 4,085 for FAT12 and fewer than 65,525 for FAT16. The text in the boot sector is only a hint.
base.ima has 2,847 clusters, so it is a FAT12 disk. FAT12 entries take 12 bits, so two entries share three bytes. That is why 9 sectors can list 2,847 clusters.
Folders and long names
Every folder entry is 32 bytes long. It gives a name of eight letters, an ending of three, the size and the first cluster. The FAT then lists the next clusters until a marker ends the chain. Files of 200,000 bytes need 391 clusters.
mdir -s -i base.ima ::
Volume in drive : is IMATEST
Volume Serial Number is 2DAD-1BAE
Directory for ::/
DOCS <DIR> 2026-10-25 7:32
README TXT 34 2026-10-25 7:32
NOTES TXT 46 2026-10-25 7:32
PHOTO BIN 200000 2026-10-25 7:32
QUARTE~1 TXT 27 2026-10-25 7:32 Quarterly report.txt
...
Total files listed:
8 files 201 267 bytes
1 253 888 bytes free
Quarterly report.txt has a long name, so the root folder stores the short name QUARTE~1.TXT and extra entries for the long one. mtools shows both names.
The structure is small. The boot sector, the FATs and the root folder fill 33 sectors, or 16,896 bytes, of a 1.44 MB IMA file. The other 1,457,664 bytes are data, and no reader can check data against the structure.
How Big Is an IMA File? Nine floppy sizes, and the ending names none of them
The ending .ima names none of the nine floppy sizes, so the file size is the only sign of the disk. IMA files of 1.44 MB are 1,474,560 bytes, of 720 KB are 737,280 bytes and of 2.88 MB are 2,949,120 bytes. Two tools gave different boot sectors for 5 of the 9.
Most questions about an IMA file come down to which disk it copies. The file size answers that in a second. Wikipedia on floppy formats lists the disk sizes, and we made an IMA file in every size to see what the boot sector says.
The nine sizes
| Disk | Bytes | Cylinders x heads x sectors | Media byte |
|---|---|---|---|
| 160 KB | 163,840 | 40 x 1 x 8 |
FE
|
| 180 KB | 184,320 | 40 x 1 x 9 |
FC
|
| 320 KB | 327,680 | 40 x 2 x 8 |
FF
|
| 360 KB | 368,640 | 40 x 2 x 9 |
FD
|
| 720 KB | 737,280 | 80 x 2 x 9 |
F9
|
| 1.2 MB | 1,228,800 | 80 x 2 x 15 |
F9
|
| 1.44 MB | 1,474,560 | 80 x 2 x 18 |
F0
|
| 1.68 MB | 1,720,320 | 80 x 2 x 21 |
F0
|
| 2.88 MB | 2,949,120 | 80 x 2 x 36 |
F0
|
Every size is cylinders times heads times sectors times 512. Disks of 1.44 MB have 80 cylinders, 2 heads and 18 sectors per track, which is 2,880 sectors. The 1.68 MB size is the DMF format, with 21 sectors per track.
The media byte
The media byte says what kind of disk the image came from. It is stored in the boot sector and again as the first byte of the FAT. mformat wrote FE, FC, FF and FD for the four 5.25 inch sizes under 1 MB, and F9 for 720 KB and 1.2 MB.
All three 3.5 inch high density sizes, 1.44, 1.68 and 2.88 MB, got F0. So the media byte cannot separate them, and the size of the file must. Our script flags an IMA file when the two copies of the byte differ.
Two tools, two boot sectors
We also made every size with mkfs.fat 4.2, a Linux tool. For 360 KB, 720 KB, 1.2 MB and 1.44 MB, the boot sector matched the one from mformat in every field except the maker name. For the other five sizes it did not.
For 160 KB, 180 KB, 320 KB and 1.68 MB, mkfs.fat wrote the media byte F8, 512 root entries and 4 sectors per cluster. For 2.88 MB it wrote 224 root entries and mformat wrote 240. fsck.fat accepted all 18 IMA files.
F0.
Not sure the file is a floppy image at all? Check it with our script.
What Did We Find in 11 Public Disk Images? Six readers, and a split on the odd ones
Six readers saw our 11 public disk images in two ways. Four readers that save files agreed on the file count and the bytes for all 8 FAT images. All six refused the 2 boot disks, and one cut image opened in none. fsck.fat warned about 3 images that the others read in full.
We searched public code projects for a floppy image or a small disk image. These are IMA files under other endings, like .img and .dsk. We found 11 in 6 projects. Many are test files for emulators and libraries, so this study shows what readers do with them and not what they do with every disk.
The six readers
Our script is the 73 line Python program in the check part. It reads FAT12 and nothing else. mtools is a GNU toolset that copies files out of an image. 7-Zip 23.01 opens a FAT image like an archive. Sleuth Kit 4.12.1 lists files with fls and reads them with icat.
pyfatfs 1.1.0 is a Python library that reads FAT disks. fsck.fat 4.2 checks disks and saves no files, so it appears in the grid for its warnings and not for its files. We tested no Windows tool and no floppy drive.
Where the readers agree
On the 8 FAT images, mtools, 7-Zip, Sleuth Kit and pyfatfs gave a matching file count and matching bytes in every case. pcjrboot gave 6 files and 42,747 bytes. The two install disks gave 8 files and 7,691 bytes, and 18 files and 23,178 bytes.
The three rust-fatfs images gave 4 files and 14,042 bytes, as FAT12, FAT16 and FAT32. The Rufus image gave 16 files and 971,473 bytes. The dfvfs image gave 3 files and 191 bytes. Our script read 6 of the 8 and refused the FAT16 and FAT32 images.
Where the readers split
Two images from the bootOS project are not FAT disks. All six readers refused both, which is the right answer, because there are no files to read. They show that an IMA file of 360 KB or 1.44 MB is not always a disk with files.
Bootes.img is 23,503 bytes long, and its boot sector describes a 1.44 MB disk, so it is a cut IMA file. Sleuth Kit returned 0 files and gave no warning. mtools and 7-Zip refused it. Our script and pyfatfs returned 0 files with a warning.
fsck.fat warned about 3 images that four readers opened in full. It flagged the volume label of pcjrboot and the dot entries of both install disks. pyfatfs also warned that pcjrboot was not cleanly unmounted. Neither warning means that a file is lost.
Read the study with care. It shows what readers do with 11 public images. Most are small, and we did not check how any of them was made. Readers that agree on these images can still fail on your IMA file.
What Do Readers Do With a Damaged IMA File? 50 broken copies, six readers and silent changes
We damaged one 1.44 MB IMA file in 50 ways and read every copy with six readers. Only 2 of the 50 damaged IMA files gave the same answer in all six. Five of them changed bytes inside files, and no reader warned about any.
The base file, base.ima, has 5 files and 201,267 bytes of file data. We changed one thing at a time and sorted the 50 damaged IMA files into 6 groups. They are the boot sector, the FAT, the directory entries, the file data, the size and the wrapping.
Green means the reader gave the same files as for the intact IMA file. Amber means it gave other files with no warning. Red means warnings or refusals. The last column counts the four readers that save files and gave all five files back byte for byte.
Silent changes are the risk
For 24 of the 50 IMA files, at least one reader that saves files gave a different answer and no warning. Zeroing the root folder (C1) made five readers show an empty disk, and only fsck.fat warned. Our script was one of the five.
The worst cases changed file data. We flipped one byte in PHOTO.BIN (D1) and zeroed one sector of it (D2). We zeroed one sector of REPORT.TXT (D3). Our script and fsck.fat read structure only, so both gave the intact answer. The four others returned changed files in silence.
What the groups show
| Group | What we found |
|---|---|
| A. Boot sector |
Zeroing sector 0 (A1) stopped all six readers, though the FATs and files were intact. Zeroing 55 AA (A2) stopped three. Only mtools refused zeros for heads and sectors per track (A11). Changing the maker name (A4) changed nothing.
|
| B. FAT | One zeroed FAT (B1, B2) read fine in some readers and not in others. With both zeroed (B3), mtools, 7-Zip and pyfatfs stopped and Sleuth Kit gave wrong files. A chain linked into another file (B6) changed the files in mtools and Sleuth Kit. Our script flagged all 10. |
| C. Directory entries | Four IMA files (C1, C2, C6 and C8) drew another answer from five readers with no warning, and only fsck.fat flagged them. It flagged 8 of the 9. Broken long name checksums (C9) passed four readers. |
| D. File data |
Flipped bytes in free space (D4) changed no answer. Flipped bytes inside files (D1), zeroed sectors (D2, D3), stretches of F6 (D5) and swapped sectors (D6) passed our script and fsck.fat and changed files in four readers.
|
| E. Size | Cut to 1,474,048, 1,000,000 or 737,280 bytes, mtools, Sleuth Kit and pyfatfs still read all five files, because the files lie at the start. 7-Zip and our script warned. Padded to 1,475,072 or 2,949,120 bytes (E5, E6), the same three read all five files. Cut to 512 bytes, to 1,000 bytes or empty, no reader could read any file. |
| F. Wrapping | 512 bytes in front (F1), zips or IMZ files (F4), gzip (F5) and partition tables in front (F6) were read only by 7-Zip. A text mode transfer (F2) stopped mtools, 7-Zip and pyfatfs. Sleuth Kit gave changed answers. Cleared top bits (F3) stopped every reader that saves files. |
What a repair can do
We tried one step repairs on 25 IMA files, and every one gave five files back in all four readers. We copied boot sectors from a blank 1.44 MB image, copied one FAT over the other, restored the media byte, padded or trimmed the file and unwrapped it.
Before repair, 18 IMA files gave all five files in at least one reader. After a repair, 29 did. Nine IMA files lost data that no reader can bring back, so 41 are recoverable in principle. Twelve more need hand repairs of chains or entries.
A repair needs the original size. We knew the disk was a 1.44 MB floppy, so we could copy its boot sector from a blank image. If you do not know the disk size, start with the nine sizes and the file size.
Read the grid with care. Green cells mean only that a reader gave the same files as for the intact IMA file. We tested no Windows reader and no floppy drive. Every test changed one thing in a single IMA file that we wrote, while damage in the wild changes many things at once.
What Does Our Expert Say About IMA Files? A note from Neeraj Singh on trusting one reader
Check IMA files with two readers before you trust one answer. Six readers gave the same answer on only 2 of 50 damaged IMA files, and four of them changed files without warning. A hash check takes seconds, and a second reader takes minutes.
Expert insight
IMA files feel safe because they are only copies of disks. In our tests, flipped bytes inside files passed two of six readers, and only 2 of 50 damaged IMA files passed all six. Write down the hash of the file when you get it, and read it with two tools before you trust the files inside.
Why one reader proves little
A reader that opens an IMA file shows that the structure makes sense to that reader. It does not show that the data is right. In our tests our script flagged or refused 36 of 50 IMA files, and it missed every changed file byte.
Checks have limits. Two readers that agree can both be wrong, and neither says what an old PC would boot. The script from the check reads the boot sector, the FATs and the folders. Compare its answer with an extractor.
Hash the file first. The SHA256 hash of the file shows which copy you have, and it shows if a transfer changed it later. Work on copies of IMA files, and keep the original read only.
How Do You Open an IMA File? Archive tools, mtools, Sleuth Kit, Python and emulators
Open IMA files with an archive tool, mtools or a disk forensics tool to see their files, or load them in an emulator to start the disk. Reading is safe on every copy. We read ours with five tools, and not one of them can say what an old PC would boot.
Opening an IMA file means one of two things. You can read it to see the files inside, or you can boot it to start the disk in an emulator. Reading changes nothing in the file. Booting starts the code in its first sector, so use a copy.
Open an IMA file with 7-Zip
7-Zip 23.01 opens FAT disk images like archives, and it names the type as FAT. The FileInfo page lists WinImage, Nero, UltraISO, IsoBuster and MagicISO for an IMA file that is a disk image. We tested none of those five.
7z l base.ima
Date Time Attr Size Compressed Name
------------------- ----- ------------ ------------ ------------------------
2026-10-25 07:32:08 D.... DOCS
2026-10-25 07:32:08 ....A 34 512 README.TXT
2026-10-25 07:32:08 ....A 46 512 NOTES.TXT
2026-10-25 07:32:08 ....A 200000 200192 PHOTO.BIN
2026-10-25 07:32:08 ....A 27 512 Quarterly report.txt
2026-10-25 07:32:08 ....A 1160 1536 DOCS/REPORT.TXT
------------------- ----- ------------ ------------ ------------------------
2026-10-25 07:32:08 201267 203264 5 files, 1 folders
To save the files, use 7z x base.ima -oout. 7-Zip is also the only reader that opened our zipped, gzipped and prefixed IMA files, because it has a step that unwraps them on the way in. The damaged copies part lists them.
Copy files out with mtools
mtools is a toolset for DOS disks, and it reads an IMA file without a mount or a driver. It names the image with -i and the root of the disk with two colons. The first command below lists every folder, and the second copies every file out.
mdir -s -i base.ima ::
mcopy -s -n -i base.ima :: out/
The listing is the one we showed in the inside part. mtools refused 18 of our 50 damaged IMA files, and it gave a different answer with no warning on 17, so check its count against a second reader.
List files with Sleuth Kit
The Sleuth Kit is a set of forensics tools for a disk or an IMA file. fls lists files, folders and deleted names. icat saves one file by its number. Lines that start with v are virtual files that show the boot sector and the two FATs.
fls -r -p base.ima
r/r 3: IMATEST (Volume Label Entry)
d/d 4: DOCS
r/r 229: DOCS/REPORT.TXT
r/r 5: README.TXT
r/r 6: NOTES.TXT
r/r 7: PHOTO.BIN
r/r 10: Quarterly report.txt
v/v 45779: $MBR
v/v 45780: $FAT1
v/v 45781: $FAT2
V/V 45782: $OrphanFiles
icat base.ima 7 > PHOTO.BIN
Read an IMA file in Python
pyfatfs is a Python library that reads FAT disks. A short program below lists every file with its size, and it opened base.ima with no warning. It warned or refused on 29 of the 50 damaged IMA files.
from pyfatfs.PyFatFS import PyFatFS
fs = PyFatFS('base.ima', read_only=True)
for path in fs.walk.files():
print(path, len(fs.readbytes(path)))
fs.close()
# prints
/README.TXT 34
/NOTES.TXT 46
/PHOTO.BIN 200000
/Quarterly report.txt 27
/DOCS/REPORT.TXT 1160
Check an IMA file with fsck.fat
fsck.fat is the disk checker from dosfstools. With the -n flag it reads an IMA file and changes nothing. It is a checker, not a file saver. It counts 7 files here where the listing shows 5 files and a folder, so we used its warnings and its cluster count and not its file count.
fsck.fat -n base.ima
fsck.fat 4.2 (2021-01-31)
base.ima: 7 files, 398/2847 clusters
Mount an IMA file on Linux
A mount shows the disk as a folder. The usual command is below. Our test machine had no vfat support in its kernel, so we could not try it, and we do not claim it works for your IMA file. The ro option keeps the image unchanged.
sudo mount -o loop,ro -t vfat base.ima /mnt/floppy
Boot an IMA file in an emulator
An emulator starts the image as a floppy disk. QEMU documents its -fda option, which uses a file as the floppy disk image. The DOSBox-X wiki guide says that DOSBox-X treats the .IMA ending as a diskette image. We used no emulator.
| Reader | Result |
|---|---|
| Our script | Same answer on 10 IMA files, a change with no warning on 4 and a flag or refusal on 36. It reads FAT12 only. |
| mtools | Same on 13 IMA files, a silent change on 17 and a flag or refusal on 20. |
| 7-Zip | Same on 9 IMA files, a silent change on 10 and a flag or refusal on 31. It alone unwraps zip, gzip and prefixes. |
| Sleuth Kit | Same on 13 IMA files, a silent change on 22 and a flag or refusal on 15. It gave the most silent changes. |
| pyfatfs | Same on 10 IMA files, a silent change on 11 and a flag or refusal on 29. |
| fsck.fat | Same on 14 IMA files and a flag or refusal on 36. It never changed an answer, because it saves no files. |
How Do You Check an IMA File? Six steps, and only the last one reads file bytes
Check an IMA file in six steps. Hash it, compare its size with the nine sizes, read the first bytes, read the boot sector, follow the FATs and folders and open the files with a second reader. Only the last step reads file bytes, and no step shows what an old PC would boot.
The six steps
- Copy the IMA file, write down its SHA256 hash and work on the copy.
- Read the size and compare it with the size table. Sizes a few sectors off mean cut or padded IMA files.
-
Read the first 64 bytes with
xxd -l 64. Look forEBorE9first and55 AAat byte 510. A file with neither can be wrapped, or it can be another kind of file. - Read the boot sector fields from the table. Bytes per sector, sectors per cluster and total sectors should fit the size of the file.
- Follow the FATs and folders with the script below. It reports FAT copies that differ and chains that do not fit the file sizes.
- Open the IMA file with a second reader, like mtools or 7-Zip, and compare the count and the bytes. Open one file inside and read it.
A 73 line script that reads the IMA file
The Python script below does steps 3 to 5 in one second. It reads the boot sector and works out the FAT type from the number of clusters. It compares the two FATs, and it follows the chain of every file. It prints REFUSED when it cannot go on, and a note for every smaller worry.
import sys
def u(b, o, n): return int.from_bytes(b[o:o + n], 'little')
def peek(path):
d = open(path, 'rb').read()
notes = []
if len(d) < 512: return ['REFUSED: shorter than one sector (%d bytes)' % len(d)]
bps, spc, rsv, nf, root = u(d, 11, 2), d[13], u(d, 14, 2), d[16], u(d, 17, 2)
tot = u(d, 19, 2) or u(d, 32, 4)
media, spf, spt, hd = d[21], u(d, 22, 2), u(d, 24, 2), u(d, 26, 2)
if d[510:512] != b'\x55\xaa': notes.append('no 55 AA at byte 510')
if (bps not in (512, 1024, 2048, 4096) or spc not in (1, 2, 4, 8, 16, 32, 64, 128)
or not 1 <= nf <= 2 or not rsv or not spf or not root or not tot):
return notes + ['REFUSED: the boot sector has no usable FAT12 or FAT16 fields']
rs = (root * 32 + bps - 1) // bps
first = rsv + nf * spf + rs
clusters = (tot - first) // spc
kind = 'FAT12' if clusters < 4085 else 'FAT16' if clusters < 65525 else 'FAT32'
print('%s: %s bytes, %s, %d clusters of %d bytes, media 0x%02X, %d heads, '
'%d sectors per track' % (path, format(len(d), ','), kind, clusters, spc * bps, media, hd, spt))
if kind != 'FAT12': return notes + ['REFUSED: this script reads FAT12 only']
if len(d) != tot * bps:
notes.append('file is %+d bytes against the %d the boot sector claims'
% (len(d) - tot * bps, tot * bps))
f1 = d[rsv * bps:(rsv + spf) * bps]
f2 = d[(rsv + spf) * bps:(rsv + 2 * spf) * bps]
if len(f1) < spf * bps: return notes + ['REFUSED: the file ends inside the first FAT']
if f1[0] != media: notes.append('media byte 0x%02X differs from the FAT byte 0x%02X' % (media, f1[0]))
if nf == 2 and f1 != f2: notes.append('the two FAT copies differ')
def nxt(c):
v = u(f1, c * 3 // 2, 2)
return v >> 4 if c & 1 else v & 0xFFF
def chain(c):
out = []
while 2 <= c < 0xFF0 and c <= clusters + 1 and c not in out:
out.append(c)
c = nxt(c)
return out, c
def sector(c): return d[(first + (c - 2) * spc) * bps:(first + (c - 1) * spc) * bps]
def walk(buf, name):
files = size = 0
for i in range(0, len(buf), 32):
e = buf[i:i + 32]
if e[0] == 0: break
if e[0] == 0xE5 or e[11] & 0x08 or e[11] & 0x0F == 0x0F: continue
n, cl, sz = e[:8].decode('latin1').strip(), u(e, 26, 2), u(e, 28, 4)
if e[11] & 0x10:
if n in ('.', '..'): continue
ch, end = chain(cl)
sub = b''.join(sector(c) for c in ch)
if not ch:
notes.append('folder %s/%s has no clusters' % (name, n))
continue
a, b = walk(sub, name + '/' + n)
files += a
size += b
else:
ch, end = chain(cl)
need = -(-sz // (spc * bps))
if len(ch) != need or (sz and end < 0xFF8):
notes.append('%s/%s: %d clusters for %d bytes, chain ends 0x%03X'
% (name, n, len(ch), sz, end))
files += 1
size += sz
return files, size
rootbuf = d[(rsv + nf * spf) * bps:first * bps]
files, size = walk(rootbuf, '')
print('%d files, %s bytes of file data' % (files, format(size, ',')))
return notes or ['no complaint']
for p in sys.argv[1:]:
for line in peek(p): print(line)
On the intact file it finds 5 files and 201,267 bytes, and it has no complaint. On damaged IMA files it names the problem. B8 has a chain that ends early, E1 is 512 bytes short and A9 has a total of zero sectors. F1 has 512 bytes in front, so it has no 55 AA.
python3 ima_peek.py base.ima
base.ima: 1,474,560 bytes, FAT12, 2847 clusters of 512 bytes, media 0xF0, 2 heads, 18 sectors per track
5 files, 201,267 bytes of file data
no complaint
python3 ima_peek.py B8.ima E1.ima A9.ima F1.ima
B8.ima: 1,474,560 bytes, FAT12, 2847 clusters of 512 bytes, media 0xF0, 2 heads, 18 sectors per track
5 files, 201,267 bytes of file data
/PHOTO: 10 clusters for 200000 bytes, chain ends 0xFFF
E1.ima: 1,474,048 bytes, FAT12, 2847 clusters of 512 bytes, media 0xF0, 2 heads, 18 sectors per track
5 files, 201,267 bytes of file data
file is -512 bytes against the 1474560 the boot sector claims
REFUSED: the boot sector has no usable FAT12 or FAT16 fields
no 55 AA at byte 510
REFUSED: the boot sector has no usable FAT12 or FAT16 fields
What the script cannot see
The script reads structure and not a single file byte. It passed all five damaged IMA files where we changed bytes inside files (D1, D2, D3, D5 and D6). It also read FAT12 only, so it refused the FAT16 and FAT32 images that four other readers opened.
Passes from our script are no promise. With the root folder zeroed (C1) it printed 0 files and no complaint. Refusals are reasons to look closer, not verdicts. It refused the FAT16 and FAT32 images, which were fine.
Want the causes of an error? Go to the causes.
Is an IMA File Safe to Open? Reading is safe, and booting starts the first sector
Reading IMA files is safe, because the files are data. Booting one starts the code in its first sector, so boot a copy in an emulator. The files inside can be programs, so treat them as you would any download.
IMA files are copies of the bytes of disks. Reading one with a tool starts no program, and a read leaves a file as it was. We scanned no IMA file for malware, so we cannot speak for files from unknown senders. The ending proves nothing, because the file command calls our IMA file a DOS boot sector.
file -b base.ima | sed 's/, /\n/g'
DOS/MBR boot sector
code offset 0x3c+2
OEM-ID "MTOO4043"
root entries 224
sectors 2880 (volumes <=32 MB)
sectors/FAT 9
sectors/track 18
serial number 0x2dad1bae
label: "IMATEST "
FAT (12 bit)
followed by FAT
What booting does
Wikipedia on the boot sector says the BIOS loads the first sector of a bootable floppy and starts it. It adds that the bytes 55 AA conventionally mark a boot loader. An emulator that boots your IMA file starts that code.
So boot only a copy, and set the disk read only where the emulator allows it. Guests can write to the image they started from. Reading IMA files with 7-Zip, mtools or Sleuth Kit never starts the first sector.
What the files can do
Use a copy. Work on copies of IMA files, and write down their SHA256 hashes. The hash shows which file you received, and it shows if a transfer changed it later. Keep the original read only.
Why Will Your IMA File Not Open? Eight causes, and what to do about every one
IMA files stop opening for eight reasons that we could test. Broken boot sectors, broken FATs, broken folder entries and cut copies come first. Wrapped files, transfers, changed bytes and the wrong kind of file come last. Our repairs gave files back for 25 IMA files.
We cannot say what an old PC does with any damaged copy, because we booted none. The table lists what our readers did with every kind of damage and what repaired it. The first step for every cause is the same, make a copy of the IMA file and work on the copy.
| Cause | What we saw and what to do |
|---|---|
| Broken boot sectors (1) | Zeroing sector 0 (A1) stopped all six readers, though the FATs and files were intact. Zero sectors per cluster, zero reserved sectors and zero total sectors stopped them too. Fix: Copy the boot sector from a blank image of the same disk size. This gave all five files back for a total of 10 IMA files. |
| Broken FATs (2) | Zeroing the first FAT (B1) stopped mtools, 7-Zip and pyfatfs. A broken chain gave changed files in mtools and Sleuth Kit. Fix: Copy the second FAT over the first. This worked for B1, B2 and B5, and it needs an intact second FAT. IMA files with both FATs zeroed (B3) need a hand rebuild. |
| Broken folder entries (3) | Zeroing the root folder (C1) and marking an entry deleted (C2) gave an empty or short listing in five readers with no warning. Only fsck.fat flagged them. Fix: Restore the first letter of a deleted name, as we did for C2. Other broken entries need a hand repair. |
| Cut or padded copies (4) | Cut to 1,474,048, 1,000,000 or 737,280 bytes, IMA files still read all five files in three readers, because the files lie at the start. Cut to 512 bytes or to a size of zero, no reader could. Fix: Compare the size and the hash with the source. Pad cut copies with zeros, trim padded ones or copy the file again. |
| Wrapped files (5) | 512 bytes in front, partition tables in front, zips, IMZ files and gzip stopped every reader but 7-Zip. Fix: Unzip the file or cut off the bytes in front. For a prefix of 512 bytes or 63 sectors, the image then read like the original. |
| Transfers that changed bytes (6) | A text mode transfer (F2) turned every LF into CR LF and added 885 bytes. Cleared top bits (F3) lost data for good. Fix: For F2, change CR LF back to LF, which was exact here. For F3, copy the IMA file again in a binary mode. |
| Changed bytes in files (7) |
Flipped bytes, zeroed sectors, blocks filled with F6 and swaps inside files (D1, D2, D3, D5 and D6) passed our script and fsck.fat. Four readers returned changed files with no warning. Fix: Compare the SHA256 hash with the source and copy the IMA file again. No repair brings the bytes back.
|
| Not FAT floppy images (8) |
Two bootOS images are not FAT disks, and all six readers refused them. FAT16 images are no floppies at all, and our FAT12 script refused them. The ending .ima also names email and audio files. Fix: Read the size and the first bytes, and use file on the IMA file.
|
Fix an IMA file in seven steps
- Copy the IMA file, write its SHA256 hash and work on the copy.
- Compare the size with the sizes in the table and with the source. Sizes a few sectors off mean cut or padded IMA files.
-
Read the first 64 bytes with the check steps. Look for
EBorE9first and55 AAat byte 510. - Read the file with the check script. Notes or REFUSED lines name the point where the structure stops making sense.
- Open the file with 7-Zip and mtools as in the open part, and compare the counts.
- Repair one thing at a time. Copy the boot sector from a blank image of the same size, or copy one FAT over the other. Check again after every change.
- Copy the files out and compare their hashes with the source if you have it.
What to send when you ask for help
If vendors or museums gave you the IMA file, send them these lines. They show what was read and where it stopped, and they save a round of questions.
Subject: IMA file will not open
File: name, size in bytes and SHA256 hash
First bytes: the output of xxd -l 64
Script: the output of ima_peek.py
Readers: what 7-Zip and mtools printed, word for word
Source: where the IMA file came from and how it was copied
Not damage, but a question about other disk types? Go to the versus part.
How Do You Convert or Make an IMA File? Four formats, and what they do to the size
IMA files convert to IMG with a rename, because the bytes stay the same. Zipping one gives an IMZ file. Boot ISO files need a tool, and VHD files round the size up. To make new IMA files, use mformat and mcopy.
Converting IMA files differs from opening them. A rename changes the name and no byte. Every other change on this page adds a wrapper or changes the size of the IMA file, so we tested all of them and compared the result with the source.
Make a new IMA file
GNU mtools makes blank floppy images with mformat. The command below made base.ima, and the size follows the number after -f. It gives a blank disk. The Unix dd program can make raw copies of physical disks too, per Wikipedia on raw images.
mformat -C -f 1440 -v IMATEST -i base.ima ::
mcopy -i base.ima README.TXT ::
IMA to IMG
Rename the IMA file. The hash of a.img was the same as the hash of a.ima, bit for bit. The ending .img also names other kinds of images, so check the first bytes of a file that comes with that name.
IMA to IMZ
Zip the IMA file with any zip tool. Our 1,474,560 byte image made 203,378 bytes of zip, and blank 1.44 MB images made 2,213 bytes. The zip unpacked to a file with the same bytes. Wikipedia on IMG names this format and WinImage as a maker.
7z a -tzip a.imz a.ima
IMA to ISO
ISO files are CD images, so the floppy image goes inside as a boot image. We used genisoimage with the -b option. The result was a file of 1,835,008 bytes. The file command called it bootable, and 7-Zip showed the image as a 1.44 MB boot image.
genisoimage -quiet -o a.iso -b a.ima iso/
IMA to VHD
qemu-img wrote VHD files of 2,100,224 bytes, with virtual disks of 1,497,088 bytes. That is 22,528 bytes more than the IMA file, because the tool rounds a disk up to its own cylinder, head and sector counts. Wikipedia on VHD gives the format and its maker.
Converting the VHD back gave an image of 1,497,088 bytes with another hash. All five files still read, and our script gave a note on the extra bytes. If you need the original IMA file size, cut the image back to 1,474,560 bytes.
qemu-img convert -f raw -O vpc a.ima a.vhd
qemu-img convert -f vpc -O raw a.vhd back.ima
| To | Result |
|---|---|
| IMG | Same bytes, 1,474,560, same hash. |
| IMZ | 203,378 bytes for base.ima, and the same bytes after unzipping. |
| ISO | 1,835,008 bytes, bootable, with the image inside as a boot image. |
| VHD | 2,100,224 bytes, and 1,497,088 bytes back, with a different hash. |
How Does an IMA File Differ From IMG, IMZ, ISO and VHD Files? Size and first sector separate them
Size and first sector separate the types. IMA files and IMG files are raw disk copies, and IMZ files are zips of them. ISO files are CD images. VHD files have footers, and DD files can copy any disk, not only floppies.
All of these are called disk images, and some names overlap. A rename between them is a trap. They are not interchangeable. Tools that read one can refuse or misread another, so read the size and the first bytes of an IMA file before you choose a tool.
| Type | How it differs |
|---|---|
| IMA | Raw floppy images, written sector by sector with no header. Nine sizes, from 163,840 to 2,949,120 bytes. FileInfo lists two other uses of the ending. |
| IMG | The same bytes for floppies. Wikipedia says the ending also names QEMU hard disk images, CloneCD images, GEM graphics, Apple disk images and Garmin map images. |
| IMZ | Zip files with one .IMA entry, made by WinImage. See our ZIP file page for the container. |
| ISO | CD images. Boot ISO files have floppy images inside them, as 7-Zip showed in our test. |
| VHD | Virtual hard disks. See our VHD file page. Our qemu-img file rounded the disk up. |
| DD | Raw copies of any disk, per our DD file page. A dd copy of a floppy has the same bytes as an IMA file. |
| Sage ACT! email | Message files, per FileInfo, with no floppy inside. |
| IMA ADPCM audio | Raw four bit audio, per FileInfo, opened in Audacity. |
Other disk image pages on this site cover DMG files for the Mac, E01 files for forensics, VMDK files and VDI files for virtual machines. The disk image page compares them.
To separate an IMA file from the audio and email uses, read the size and the first bytes. A floppy image has 55 AA at byte 510, as all 30 of our made and public images do. We met no email or audio file with the ending, so we cannot say what a file of that kind looks like.
What Is the IMA File Format Made Of? The facts we could check, and where they came from
The IMA file format is a boot sector, two FATs, the root folder and data, with no header and no label. The facts below come from Wikipedia, FileInfo, the OSDev wiki and our checks of 18 made IMA files, 11 public images and 50 damaged IMA files. We list what we could confirm, and nothing more.
| Part | What we could check |
|---|---|
| Name | Raw floppy disk images. FileInfo files the ending as disk images. (FileInfo) |
| Other uses | Sage ACT! email messages and IMA ADPCM audio. (FileInfo) |
| Header | None. Byte 0 of an IMA file is byte 0 of the disk. (Our 30 images) |
| Sector size | 512 bytes in every IMA file we made, as a rule of mformat and mkfs.fat. (Our tests) |
| Boot sector |
Fields at set offsets, with the jump first and 55 AA at byte 510. (Wikipedia on FAT design)
|
| Boot signature | Conventionally marks boot loaders. The BIOS starts the first sector of bootable floppies. (Wikipedia on the boot sector) |
| FAT type | Set by the cluster count, below 4,085 for FAT12 and below 65,525 for FAT16. (OSDev wiki) |
| Sizes | Nine floppy sizes, from 163,840 to 2,949,120 bytes. (Wikipedia on floppy formats, our tests) |
| IMZ | Zipped floppy images with one .IMA entry. (Wikipedia on IMG) |
| IMG | The same ending is used for other image types. (Wikipedia on IMG) |
| Magic number |
None that we found. 28 of our 30 images start with EB or E9, and all 30 have 55 AA at byte 510.
|
| Our counts | 18 made files, 11 public images, 50 damaged copies of one IMA file and six readers. |
About the values we list
Facts about the layout come from Wikipedia and the OSDev wiki, and every row names its source. The counts were checked against our IMA files. FileInfo is a directory, so we use it for the name and the programs only.
The pages we read give no rule that says floppy images must have boot signatures. IMA files of 1.44 MB with zeroed 55 AA still read in mtools and fsck.fat. So we call the signature a convention and not a rule.
What we left out
We tested on Linux only, and we used no Windows reader, no WinImage and no floppy drive. We used no emulator, and we could not mount an IMA file, because our kernel had no vfat support. We scanned no IMA file for malware.
Our 11 public images come from 6 projects, and most are small. Our damaged IMA files change one thing at a time in a copy of one base file. Readers that fail on our IMA files can work on yours, and the reverse is true as well.
Sources checked
For the format, see the IMG format article, the FAT design article and the OSDev wiki page on FAT. For sizes, see Wikipedia on floppy disk formats.
For boot code, see the boot sector article. For tools, see the mtools manual, the QEMU invocation page and Wikipedia on WinImage. For the other uses, see the FileInfo page on IMA files.
For disk images in general, see the disk image article. Every count came from the files and scripts in our research folder.
Frequently Asked Questions About IMA Files
What is an IMA file?
An IMA file is a raw copy of a floppy disk, written sector by sector with no header. Most IMA files are 1,474,560 bytes, the size of a 1.44 MB disk. FileInfo files the ending as disk images and lists two other uses, email and audio.
How do I open an IMA file?
Open an IMA file in 7-Zip to list the files, or copy them out with mtools. An emulator can boot the image as a floppy disk. We tested 7-Zip, mtools, Sleuth Kit, pyfatfs and fsck.fat. We used no emulator and no Windows tool.
Can an IMA file be audio or an email?
Yes. FileInfo lists three uses of the ending, disk images, Sage ACT! email messages and IMA ADPCM audio. A floppy image has 55 AA at byte 510, as all 30 of our made and public images do. Read the size and the first bytes before you choose a program for an IMA file.
Is an IMA file the same as an IMG file?
For floppies, yes. Renaming a.ima to a.img left every byte and the hash the same. The ending IMG also names other things, like CloneCD images, GEM graphics and Apple disk images, so IMG files are not always floppies.
Is an IMA file safe to open?
Reading an IMA file with a tool is safe, because the file is data. Booting one starts the code in its first sector, so boot only a copy in an emulator. The files inside can be programs. We scanned no IMA file for malware.
What is inside an IMA file?
An IMA file has a boot sector, two copies of the FAT table, the root folder and then the data. In a 1.44 MB file, the first 33 of 2,880 sectors are structure, and the other 2,847 sectors are data. Our example, base.ima, has 5 files.
How big is an IMA file?
Nine sizes exist, from 163,840 bytes for a 160 KB disk to 2,949,120 bytes for a 2.88 MB disk. The usual size is 1,474,560 bytes. A size a few sectors off means a cut or padded IMA file, and the ending cannot show it.
Why will my IMA file not open?
Eight causes cover what we found for an IMA file that will not open. They are broken boot sectors, broken FATs, broken folder entries and cut or padded copies. The rest are wrapped files, transfers that changed bytes, changed bytes in files and files that are not FAT floppy images.
How do I mount an IMA file?
On Linux, the usual command is mount with the loop and ro options and the vfat type. Our test machine had no vfat support in its kernel, so we could not test it. 7-Zip and mtools read an IMA file with no mount at all, which is a safer way to look.
How can I check if an IMA file is damaged?
Hash the IMA file, compare its size with the nine sizes, read the first bytes and use a script that follows the FATs and folders. Then open it with a second reader. Six readers gave the same answer on only 2 of 50 damaged IMA files.
Can I convert an IMA file to ISO or VHD?
Yes. A boot ISO file needs genisoimage with the boot option, and ours came out at 1,835,008 bytes. A VHD from qemu-img rounded the disk up by 22,528 bytes. Renaming an IMA file to IMG and zipping it to IMZ changed no byte of the image.
How do I make an IMA file?
Use mformat from mtools to make a blank image, and mcopy to put files in it. The dd program can copy a physical floppy to a raw file too, per Wikipedia. We made an IMA file in all nine sizes with mformat and with mkfs.fat.
Still Stuck With an IMA File? Two routes out, and where to look next
Read the size and the first bytes, then add up the checks. The cause table lists what to try in order.
The convert part shows IMG, IMZ, ISO and VHD files and what they do to the size.
Is it a hard disk copy? The page on disk images compares the kinds, and the DD files page covers raw copies.
Is it a virtual disk? Read about the VMDK format, the VDI format and the VHD format for the three main formats.
Is it a zip inside? IMZ files are zips of one image, and the page on ZIP files covers the container.
Is it an unknown file type? Browse the file extension resource library, or send it on the submit a file type page.