-
Notifications
You must be signed in to change notification settings - Fork 113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mkfs.vfat refuses to work without -I on loop device #40
Comments
I suggest you check this by inserting
|
That's interesting. Output of "losetup":
Output of "lsblk":
And that's after I already forced mkfs.vfat to create the fat fs on /dev/loop0. I'm not familiar with udev. Does it mean that this is possibly a bug in udev? Due to the offset in the bind mount, the partition table should be not visible from within /dev/loop0. |
Coming back to this, it seems that Therefore, I'll close this issue for now. |
Agreed, thanks for pointing out how mkfs makes its decision. |
It will be very late answer, but this can be fixed by calling |
The mkfs.fat sanity check revealed a problem with outdated partition mapping info in elbe: [CMD] mkfs.vfat -n uefi /dev/loop0 mkfs.fat 4.2 (2021-01-31) mkfs.vfat: Partitions or virtual mappings on device '/dev/loop0', not making filesystem (use -I to override) The kernel retains information about previously created partitions on a loop device with the same name. Update that info with kpartx -u. Link: dosfstools/dosfstools#40 Signed-off-by: Bastian Germann <[email protected]> Reviewed-by: Christian Gabriel <[email protected]>
Hi,
I've encountered a strange issue when trying to build a live-build hdd image for the upcoming Debian Stretch release. As one of the last steps, live-build attempts to generate an image file with a FAT partition to boot from. At the beginning we have an empty "binary.img" file. Then, "parted" is used to create a partition table at offset 0. Then, the image file is mounted again using losetup and the -o parameter to specify an offset of one sector. Then, mkfs.vfat is called on the /dev/loop0 device in order to create a new FAT filesystem. However, mkfs.vfat refuses to do this without the -I parameter (error message: Partitions or virtual mappings on device '/dev/loop0', not making filesystem (use -I to override)).
A hexdump on /dev/loop0 reveals that is only contains zeros. However, mkfs.vfat seems to take a glimpse behind the curtains and sees the the original file has a partition table at offset 0!
You can find the relevant live-build code here:
https://github.com/timrchavez/live-build/blob/master/scripts/build/binary_hdd#L202
The error message in mkfs.vfat is generated here:
https://github.com/dosfstools/dosfstools/blob/master/src/mkfs.fat.c#L1670
The text was updated successfully, but these errors were encountered: