info-mtools
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Info-mtools] [BUG] mcopy unable to copy to small FAT32 image starting v


From: Alexander Bazarov
Subject: [Info-mtools] [BUG] mcopy unable to copy to small FAT32 image starting v4.0.32
Date: Fri, 19 Aug 2022 16:22:56 -0400

Hi,

During image creation for an embedded device that has a stripped
version of driver for FAT32 only (fails to boot with FAT12/16)
following step is performed and began to fail with newer versions of mtools:
```
mkfs.vfat -C img.vfat 0x4000 -F 32 -S 2048 -s 32
mcopy -v -i img.vfat anyfile.txt ::
```

I believe that mcopy auto detects it as FAT12/16 based on the number
of clusters. Is there any option to force mcopy to treat the image as
FAT32 ? (I didn't find any flag and using environment variable
MTOOLS_SKIP_CHECK=1 doesn't help)

running these lines with version prior to 4.0.32, e.g. 4.0.31 works:
```
user@tmp/mtools-4.0.31/usr/bin$ mkfs.vfat -C img.vfat 0x4000 -F 32 -S 2048 -s 32
mkfs.fat 4.1 (2017-01-24)
WARNING: Not enough clusters for a 32 bit FAT!
user@tmp/mtools-4.0.31/usr/bin$ ./mcopy -v -i img.vfat anyfile.txt ::
Copying anyfile.txt
```

but doing the same with 4.0.32 or newer, e.g. 4.0.40 fails:
```
user@tmp/mtools-4.0.40/usr/bin$ mkfs.vfat -C img.vfat 0x4000 -F 32 -S 2048 -s 32
mkfs.fat 4.1 (2017-01-24)
WARNING: Not enough clusters for a 32 bit FAT!
user@tmp/mtools-4.0.40/usr/bin$ ./mcopy -v -i img.vfat anyfile.txt ::
Cluster # at 5 too big(0xf80)
Probably non MS-DOS disk
Error reading FAT
Cannot initialize '::'
Bad target ::
```
```
user@tmp/mtools-4.0.40/usr/bin$ mtype img.vfat
Xmkfs.fa    @)ANO NAME    FAT32   w|"t
                                      V^2This is not a bootable disk.
Please insert a bootable floppy and
press any key to try again ...
URRaArrAaUXmkfs.fa    @)ANO NAME    FAT32   w|"t
                                                V^2This is not a
bootable disk.  Please insert a bootable floppy and
press any key to try again ...
```

for FAT16 it works:
```
user@tmp/mtools-4.0.40/usr/bin$ mkfs.vfat -C img.vfat16 0x4000 -F 16
-S 2048 -s 32
mkfs.fat 4.1 (2017-01-24)
WARNING: Not enough clusters for a 16 bit FAT! The filesystem will be
misinterpreted as having a 12 bit FAT without mount option "fat=16".
user@tmp/mtools-4.0.40/usr/bin$ ./mcopy -v -i img.vfat16 anyfile.txt ::
Copying anyfile.txt
```

Any ideas how to solve or bypass the issue (other than forcing use of
old mtools)?

Thank you,
Alex



reply via email to

[Prev in Thread] Current Thread [Next in Thread]