mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Re: VFS issues (was: Re: 2.5.5-pre1: mounting NTFS partitions -t VFAT)
@ 2002-02-19 12:21 Andries.Brouwer
  0 siblings, 0 replies; 7+ messages in thread
From: Andries.Brouwer @ 2002-02-19 12:21 UTC (permalink / raw)
  To: hirofumi, josh; +Cc: linux-kernel

    From: Jos Hulzink <josh@stack.nl>

    On Mon, 18 Feb 2002, OGAWA Hirofumi wrote:

    > Jos Hulzink <josh@stack.nl> writes:
    >
    > > What lacks is a fingerprint detector, and iirc -long time ago- FAT has a
    > > very easy to detect fingerprint.
    > >
    > > I'll dig into FAT documentation tonight.
    >
    > I read the document repeatedly and did much tests. If you read the
    > document, you may use BS_OEMName or BS_FilSysType, however, these
    > don't have a meaning.

    Hmmm. You seem to be right there. In my OS (IBM PC only) I checked the
    partition table (see below).

    The first question I want answered: Should I just call myself stupid for
    trying to mount NTFS as VFAT, or should we consider this a real issue that
    needs fixing ? (I see the problem as a generic problem. There must be
    other combinations of filesystems and partition types that pass the
    test, but are wrong). IMHO the latter, for every lost partition makes an
    angry linux user.

    Anyway. I have already been thinking further. Maybe I'm talking nonsense,
    but I'll give it a try.

    The type of a partition is written in the partition table, or something
    similar. Maybe we should check that ?

No.

Letting mount guess is a dangerous business. There is no guarantee
it will guess right, and if mount guesses wrong and the filesystem
was mounted rw, then it may well be trashed.

Doing this right is impossible, and doing this better than today
is of questionable usefulness.

[When guessing reaches a 99.99% probability of success then before
you know it distributions will use guessing in their installation
scripts, and destroy the filesystem of only 1 in 10000 customers.
That single customer always turns out to be me.
When the probability is only 99% people are kept honest.]

FAT is one of the filesystems without really good magic.
But also with filesystems that have good magic one may make
mistakes: several filesystem types have magic in different
blocks, at different offsets. Thus, a partition can have the
magic of more than one filesystem type. This is especially likely
if it had a filesystem of one type before it was reformatted as
another type.
[Zeroing out the first few blocks upon a reformat helps a bit,
but will in some cases destroy a boot loader.]

Now about partition types. First look at
http://www.win.tue.nl/~aeb/partitions/partition_types-1.html
and then consider:
Several dozen types all imply FAT.
The Linux type 83 only says Linux but does not carry information
about the filesystem type. The NTFS type 7 is also the OS/2 type
for HPFS and other installable file systems, and is used by a
few other systems as well.
You see that this is a mess, and in reality no useful information
is to be found here, at most some vague heuristics.

Then consider that partitions can come from BSD slices or other
flavours of partition table or disk label, and that they can be
added by ioctl, so that no partition table need to be present
at all.

So, no, looking at partition types is a very bad idea.

Andries

^ permalink raw reply	[flat|nested] 7+ messages in thread
* Re: 2.5.5-pre1: mounting NTFS partitions -t VFAT
@ 2002-02-18 14:56 OGAWA Hirofumi
  2002-02-19 10:02 ` VFS issues (was: Re: 2.5.5-pre1: mounting NTFS partitions -t VFAT) Jos Hulzink
  0 siblings, 1 reply; 7+ messages in thread
From: OGAWA Hirofumi @ 2002-02-18 14:56 UTC (permalink / raw)
  To: Jos Hulzink; +Cc: Linux Kernel Development

Jos Hulzink <josh@stack.nl> writes:

> Hi Ogawa,
> 
> Your patch seems to fix it more or less, not the way it should be
> fixed, imho.  Partitions other than FAT return bogus information, but
> bogus is not always zero. Fortunately enough, one of those new if
> statements returns an error, but this is a "works for me"
> solution, not a decent one.

No, that patch are validity check for FAT, not for you.

> What lacks is a fingerprint detector, and iirc -long time ago- FAT has a
> very easy to detect fingerprint.
> 
> I'll dig into FAT documentation tonight.

I read the document repeatedly and did much tests. If you read the
document, you may use BS_OEMName or BS_FilSysType, however, these
don't have a meaning.
-- 
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2002-02-19 13:34 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-02-19 12:21 VFS issues (was: Re: 2.5.5-pre1: mounting NTFS partitions -t VFAT) Andries.Brouwer
  -- strict thread matches above, loose matches on Subject: below --
2002-02-18 14:56 2.5.5-pre1: mounting NTFS partitions -t VFAT OGAWA Hirofumi
2002-02-19 10:02 ` VFS issues (was: Re: 2.5.5-pre1: mounting NTFS partitions -t VFAT) Jos Hulzink
2002-02-19 11:52   ` Richard Russon
2002-02-19 12:48     ` Jos Hulzink
2002-02-19 13:34   ` Alexander Viro
2002-02-19 14:25   ` Denis Vlasenko
2002-02-19 11:03     ` Jos Hulzink

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®