Troubleshooting
Common issues and solutions when building disk images.
Docker Issues
Error: --privileged flag required
DiskForge needs access to loop devices, device-mapper, and cryptsetup. Always run with --privileged:
Docker Desktop on macOS and Windows supports this. On Linux, your user must be in the docker group or use sudo.
Build fails with 'output directory not writable'
Ensure the output directory exists and is mounted correctly:
Docker image build fails on ARM Mac
The Dockerfile supports both amd64 and arm64. If you see architecture errors, ensure Docker BuildKit is enabled:
Partition Issues
Error: 'Partition exceeds disk bounds'
The total size of all partitions exceeds the disk size. Remember to account for:
- GPT: ~1 MiB overhead for the GPT header
- MBR: 2048-sector (1 MiB) alignment at the start
- Extended partitions: 1 MiB gap before the first logical partition
Fix: Increase the disk size or reduce partition sizes.
MBR: 'Re-reading the partition table failed'
This is a harmless warning from sfdisk running inside a container. It's because the loop device can't notify the kernel of partition changes in the same way a physical disk would. kpartx handles the mapping instead.
Filesystem Issues
exFAT mount fails
exFAT uses mount.exfat-fuse (FUSE-based). If it fails:
- Ensure
exfat-fuseandexfatprogsare installed in the container (they are by default) - FUSE requires
--privilegedmode - Check that the partition has enough space for exFAT overhead
No files matched pattern
The source glob pattern in add_files didn't match any files. Check that:
- Your
files/directory is mounted at/filesin the container - The glob pattern is correct (e.g.,
/files/*notfiles/*) - Files actually exist at the specified path
Encryption Issues
LUKS: 'Filesystem not supported for LUKS encryption'
LUKS only supports ext2, ext3, ext4, and xfs. You cannot use LUKS with FAT32, NTFS, or exFAT.
Fix: Change the partition's filesystem to one of the supported types.
VeraCrypt: 'No such file or directory: /dev/mapper/veracrypt1'
This happens when the device-mapper infrastructure isn't ready in the container. DiskForge runs dmsetup mknodes automatically, but if you see this:
- Ensure
--privilegedmode is enabled - Try running the build again (transient device-mapper timing issue)
VeraCrypt: 'NTFS signature is missing'
This was a bug in earlier versions where VeraCrypt tried to auto-mount a volume before the filesystem was created. Update to the latest version of DiskForge which uses --filesystem=none during volume creation.
VeraCrypt with wrong passphrase
VeraCrypt will fail silently or with a generic error when given the wrong passphrase. Unlike LUKS, there's no detectable header to confirm a volume is VeraCrypt-encrypted — this is by design (plausible deniability).
Build Issues
Build succeeds but image is empty
Check that:
- Your manifest has
populateblocks withadd_files - The
sourcepatterns match actual files - The
/filesvolume is mounted in the Docker command - File operations run in order: add → copy → move → delete