Re: Detecting FS

2024-02-12 Thread Saurav Pal
Hi Greg,


Thanks for the clarification! That was what I was looking for, the part
about the need for explicitly stating the FS.


Regards,

SP

On Tue, 13 Feb, 2024, 02:05 Gregory Nutt,  wrote:

> You would need to mount with -t vfat.  That is how it the system knows
> that the file system is vfat.
>
> It seems like you should be able to omit the file system type when
> mounting and let the system figure out the file system type, but that
> does not appear to be supported.
>
> On 2/12/2024 2:30 PM, Saurav Pal wrote:
> > Hi Alan,
> >
> > Thanks for the reply. I had gone through that global array but I couldn't
> > find what I was looking for.
> >
> > In a different phrasing, what I don't understand is how is it detected
> > which file system was used to format a storage device.
> >
> > Like, let's say I have a HDD in my PC formatted with VFAT, and if I use
> it
> > with NuttX, how will it detect VFAT is being used?
> >
> > Magic numbers are unique for FSs, but I have not seen / missed where they
> > are being stored on the disk for identification.
> >
> > Regards,
> > SP
> >
> > On Tue, 13 Feb, 2024, 01:42 Alan C. Assis,  wrote:
> >
> >> Hi Saurav,
> >>
> >> Please take a look at "static const struct fsmap_t g_bdfsmap[]" in the
> file
> >> nuttx/fs/mount/fs_mount.c
> >>
> >> You will figure-out how the "magic" happens.
> >>
> >> Best Regards,
> >>
> >> Alan
> >>
> >> On Mon, Feb 12, 2024 at 9:20 AM Saurav Pal 
> wrote:
> >>
> >>> Hi all,
> >>>
> >>> I am trying to write some docs for VFS in NuttX, but there's one thing
> >> I've
> >>> been stumbling on for some time.
> >>>
> >>> How are the file systems detected from the storage devices? For
> example,
> >> if
> >>> I have a storage device which has been formatted using VFAT...after
> (say)
> >>> power on, how does NuttX detect that vfat was used to format the
> storage
> >>> device?
> >>>
> >>>  From what I can see, NuttX does not have a "superblock" concept
> >> explicitly
> >>> defined, nor does it seem to require the file systems to store magic
> >>> numbers in the disk in any way.
> >>>
> >>> Thanks in advance.
> >>> Regards,
> >>> SP
> >>>
>


Re: Detecting FS

2024-02-12 Thread Gregory Nutt
You would need to mount with -t vfat.  That is how it the system knows 
that the file system is vfat.


It seems like you should be able to omit the file system type when 
mounting and let the system figure out the file system type, but that 
does not appear to be supported.


On 2/12/2024 2:30 PM, Saurav Pal wrote:

Hi Alan,

Thanks for the reply. I had gone through that global array but I couldn't
find what I was looking for.

In a different phrasing, what I don't understand is how is it detected
which file system was used to format a storage device.

Like, let's say I have a HDD in my PC formatted with VFAT, and if I use it
with NuttX, how will it detect VFAT is being used?

Magic numbers are unique for FSs, but I have not seen / missed where they
are being stored on the disk for identification.

Regards,
SP

On Tue, 13 Feb, 2024, 01:42 Alan C. Assis,  wrote:


Hi Saurav,

Please take a look at "static const struct fsmap_t g_bdfsmap[]" in the file
nuttx/fs/mount/fs_mount.c

You will figure-out how the "magic" happens.

Best Regards,

Alan

On Mon, Feb 12, 2024 at 9:20 AM Saurav Pal  wrote:


Hi all,

I am trying to write some docs for VFS in NuttX, but there's one thing

I've

been stumbling on for some time.

How are the file systems detected from the storage devices? For example,

if

I have a storage device which has been formatted using VFAT...after (say)
power on, how does NuttX detect that vfat was used to format the storage
device?

 From what I can see, NuttX does not have a "superblock" concept

explicitly

defined, nor does it seem to require the file systems to store magic
numbers in the disk in any way.

Thanks in advance.
Regards,
SP



Re: Detecting FS

2024-02-12 Thread Saurav Pal
Hi Alan,

Thanks for the reply. I had gone through that global array but I couldn't
find what I was looking for.

In a different phrasing, what I don't understand is how is it detected
which file system was used to format a storage device.

Like, let's say I have a HDD in my PC formatted with VFAT, and if I use it
with NuttX, how will it detect VFAT is being used?

Magic numbers are unique for FSs, but I have not seen / missed where they
are being stored on the disk for identification.

Regards,
SP

On Tue, 13 Feb, 2024, 01:42 Alan C. Assis,  wrote:

> Hi Saurav,
>
> Please take a look at "static const struct fsmap_t g_bdfsmap[]" in the file
> nuttx/fs/mount/fs_mount.c
>
> You will figure-out how the "magic" happens.
>
> Best Regards,
>
> Alan
>
> On Mon, Feb 12, 2024 at 9:20 AM Saurav Pal  wrote:
>
> > Hi all,
> >
> > I am trying to write some docs for VFS in NuttX, but there's one thing
> I've
> > been stumbling on for some time.
> >
> > How are the file systems detected from the storage devices? For example,
> if
> > I have a storage device which has been formatted using VFAT...after (say)
> > power on, how does NuttX detect that vfat was used to format the storage
> > device?
> >
> > From what I can see, NuttX does not have a "superblock" concept
> explicitly
> > defined, nor does it seem to require the file systems to store magic
> > numbers in the disk in any way.
> >
> > Thanks in advance.
> > Regards,
> > SP
> >
>


Re: Detecting FS

2024-02-12 Thread Alan C. Assis
Hi Saurav,

Please take a look at "static const struct fsmap_t g_bdfsmap[]" in the file
nuttx/fs/mount/fs_mount.c

You will figure-out how the "magic" happens.

Best Regards,

Alan

On Mon, Feb 12, 2024 at 9:20 AM Saurav Pal  wrote:

> Hi all,
>
> I am trying to write some docs for VFS in NuttX, but there's one thing I've
> been stumbling on for some time.
>
> How are the file systems detected from the storage devices? For example, if
> I have a storage device which has been formatted using VFAT...after (say)
> power on, how does NuttX detect that vfat was used to format the storage
> device?
>
> From what I can see, NuttX does not have a "superblock" concept explicitly
> defined, nor does it seem to require the file systems to store magic
> numbers in the disk in any way.
>
> Thanks in advance.
> Regards,
> SP
>


Detecting FS

2024-02-12 Thread Saurav Pal
Hi all,

I am trying to write some docs for VFS in NuttX, but there's one thing I've
been stumbling on for some time.

How are the file systems detected from the storage devices? For example, if
I have a storage device which has been formatted using VFAT...after (say)
power on, how does NuttX detect that vfat was used to format the storage
device?

>From what I can see, NuttX does not have a "superblock" concept explicitly
defined, nor does it seem to require the file systems to store magic
numbers in the disk in any way.

Thanks in advance.
Regards,
SP