Disk images
Browse VHD, VHDX, VMDK, DMG and raw disk images read-only, the way 7-Zip does, with MBR and GPT partitions and FAT, exFAT, NTFS, HFS+ and ISO 9660 inside.
Last updated
Arca opens the disk images of virtual machines, of macOS installers and of
SD cards and USB sticks, and shows the files inside them, as 7-Zip does. They
are built in, need no Cargo feature and are read-only: Arca never creates,
modifies or mounts them. Listing, testing, extracting, previews, the checksums
of entries in the window and comparisons (arca diff) work as for any other
archive.
arca list server.vhdxarca test macOS-installer.dmgarca extract sdcard.img -o sdcard/arca diff guest.vmdk restored/Containers
A dynamic VHD, a VHDX and a VMDK are also recognized by their first bytes when their name says nothing. A fixed VHD, a DMG and a raw image keep nothing telling at the start, so only the suffix says what they are.
Partitions and file systems
A disk with an MBR (including logical partitions in an extended one) or a GPT
shows each partition as a numbered folder at the top, named after its file
system: 0.ntfs/, 1.fat/, 2.exfat/, 3.hfs/, 4.iso/. A DMG lists its
blocks the same way, leaving out the free space. A partition whose file system
Arca does not read, such as ext4, APFS or a Linux swap area, is listed as one
raw file, N.img, that can be extracted and opened on its own. A disk without
a partition table that holds a file system directly, such as a floppy or a
"superfloppy" USB stick, shows that file system's files at the top; one that
holds nothing Arca knows is one raw file named after the image.
What is not read
- APFS and ext2/3/4 are not browsed: their partitions are listed as raw
N.imgfiles. Most current macOS DMGs hold APFS. - LZFSE chunks in a DMG. The only pure-Rust LZFSE decoder relies on
hundreds of
unsafeblocks, and Arca does not hand it untrusted bytes. The listing says so, and the partitions those chunks belong to cannot be read. - Encrypted DMGs (
encrcdsa), segmented DMGs and old DMGs that keep their block map only in a resource fork are refused. - NTFS files compressed or encrypted by NTFS, and its symbolic links, junctions and other reparse points, are left out and counted in a note.
- HFS+ files compressed by HFS+ (the
UF_COMPRESSEDflag, common for files copied by the Finder or installed by macOS) and folder hard links are left out and counted in a note. - Differencing VHD and VHDX disks and VMDK snapshots, which need their parent disk.
- Logical volumes (LVM, Storage Spaces), RAID and BitLocker or FileVault volumes show as raw partitions.
Why Arca never takes these files over
Disk images belong to the system that mounts them: Windows attaches VHD and
VHDX disks and mounts .img files with a double click, macOS opens DMGs with
its own mounter, and VMDK disks belong to VMware and VirtualBox. The installer
therefore never registers these suffixes, not even on request; open them from
the window, by dragging them onto it, or with Open with.
Safety
Every parser is Arca's own, in safe Rust, and a damaged or hostile image gives an error or a note, never a crash:
- no structure is allocated from a declared size before that size is held against the image: block tables, grain directories, the DMG property list (at most 64 MiB) and each decoded chunk (at most 64 MiB) are checked first;
- reads never go past the virtual disk, and regions the image does not store read as zeros;
- partitions that start past the disk are left out, and ones that run past it are cut where it ends; the chain of logical partitions is followed at most 128 records and stops at a loop;
- FAT and exFAT cluster chains, NTFS parent links and HFS+ B-tree leaf chains stop at a loop, folders are followed at most 128 levels deep, and every file system shares one budget of data runs;
- extraction goes through the same destination checks as every other format, so a name that leads out of the folder is refused.
Tests build each image byte by byte (FAT, exFAT and HFS+ volumes, MBR and GPT
tables, VHD, VHDX, VMDK and DMG containers) and damage it: cut short at many
lengths, or with bytes flipped over its headers, it must open, test and read
without a panic. The
NTFS volume is the 2 MiB testfs1 image of the ntfs
crate (MIT or Apache-2.0), kept as arca-disk/tests/fixtures/ntfs.img.xz.
cargo test -p arca-diskcargo test -p arca-cli --test disk