Bug 259012 - makefs -t msdos creates broken image when out of space
Summary: makefs -t msdos creates broken image when out of space
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-10-08 20:06 UTC by Ed Maste
Modified: 2021-10-08 20:06 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ed Maste freebsd_committer freebsd_triage 2021-10-08 20:06:36 UTC
I attempted to create a FAT image using:

makefs -t msdos \
    -o fat_type=16 \
    -o sectors_per_cluster=1 \
    -o volume_label=EFISYS \
    -s 64m \
    -D arm64.rootfs METALOG-boot

as it happens the content will not actually fit in 64m, and makefs emits errors and reports that the image is not created:

makefs: warning: FAT type limits file system to 66069 sectors
arm64.rootfs: 65524 sectors in 65524 FAT16 clusters (512 bytes/cluster)
BytesPerSec=512 SecPerClust=1 ResSectors=1 FATs=2 RootDirEnts=512 Media=0xf0 FATsecs=256 SecPerTrack=63 Heads=255 HiddenSecs=0 HugeSectors=66069
Populating `arm64.rootfs'
makefs: msdosfs_mkfile ./boot/kernel/ath_hal_ar9300.ko: No space left on device
makefs: msdos_populate_dir ./boot/kernel: No space left on device
makefs: msdos_populate_dir ./boot: No space left on device
makefs: Image file `arm64.rootfs' not created.

However, an image of the requested size with truncated contents does exist at this point:

$ ls arm64-stage/arm64.rootfs 
arm64-stage/arm64.rootfs