fat: handle Windows formatted partition (thru USB Mass Storage)

Andy Shevchenko andy.shevchenko at gmail.com
Mon Jan 13 20:15:16 CET 2020


On Mon, Jan 13, 2020 at 7:55 PM Heinrich Schuchardt <xypron.glpk at gmx.de> wrote:
> On 1/13/20 5:34 PM, Tom Rini wrote:
> > On Mon, Jan 13, 2020 at 12:52:48PM +0200, Andy Shevchenko wrote:
> >> Hi!
> >>
> >> I recently stumble over FAT partitioning issue. I have a device with
> >> MMC, one partition of which has been exported as disk via USB Mass
> >> Storage to the host. When Windows 10 sees that disk it can't handle it
> >> till I format it there.
>
> This I could reproduce.
>
> So far so good. However, the same partition
> >> can't be used under U-Boot due to Windows flow, i.e. it makes a
> >> partitioning on top of the actual partition while U-Boot expects that
> >> we only have one MBR (or partitioning) on the dist. So, the commands
> >> such fatls, fatload do not recognise any file there.
>
> But for me the U-Boot's load command loaded a file created on Windows
> without problems. The size of my FAT partition was 50 MiB.
>
> Please, provide a more detailed instruction how to create an image that
> is recognized by Windows but not by U-Boot.

Windows GUI (Disk manager by clicking right button on the Windows icon
on the bar) provides this.
https://www.windowscentral.com/how-format-usb-flash-drive-windows-10

Basically I followed above (Quick or not format makes no difference --
it has the "new simple volume" available only which creates, as
mentioned, volume with all structures).

> Please, provide a gzipped test image for download.

What image?
Disk one? Let me prepare it later when I come home.

>
> Best regards
>
> Heinrich
>
> >>
> >> In Linux it's easy to use: mount -o loop,offset=65536 /dev/mmcblk0p9 /mnt
> >> (offset can be different)
> >>
> >> But I would like to use it in U-Boot.
> >>
> >> Any thoughts on this?
> >
> > I'm not sure.  If you didn't have to use offset+loop to re-expose things
> > as a new disk and show the partition I'd say we need to support that
> > case.  But here, hmmm.  We don't have "loopback".  So, I'm not sure.
> > Can't you just tell Windows to use the whole device as FAT and so
> > mmcblk0p9 would directly be FAT and work as expected in both Linux and
> > U-Boot?
> >



-- 
With Best Regards,
Andy Shevchenko


More information about the U-Boot mailing list