mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* 2.5.5-pre1: mounting NTFS partitions -t VFAT
@ 2002-02-15 10:30 Jos Hulzink
  2002-02-15 17:11 ` Anton Altaparmakov
  2002-02-15 20:18 ` OGAWA Hirofumi
  0 siblings, 2 replies; 15+ messages in thread
From: Jos Hulzink @ 2002-02-15 10:30 UTC (permalink / raw)
  To: Linux Kernel Development

Hi,

Due to a recent change of filesystems, I found the following: 2.5.5-pre1
mounts my NTFS (win2k) partition as VFAT partition, if told to do so. The
kernel returns errors, but the mount is there. One write to the partition
was enough to destroy the entire NTFS partition.

Due to filesystem damage, I didn't test the behaviour of the VFAT driver
on other filesystems yet.

Kernel 2.4.17 also returns errors, but there the mount fails.

Will try to debug the problem myself this afternoon. Sounds like the VFAT
procedure ignores some errors.

Jos


^ permalink raw reply	[flat|nested] 15+ messages in thread
* 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; 15+ 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] 15+ messages in thread

end of thread, other threads:[~2002-03-11 18:01 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-02-15 10:30 2.5.5-pre1: mounting NTFS partitions -t VFAT Jos Hulzink
2002-02-15 17:11 ` Anton Altaparmakov
2002-02-15 20:18 ` OGAWA Hirofumi
2002-02-18 12:55   ` Jos Hulzink
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
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
2002-03-09  9:50       ` [BUG] 2.5.6: IPv6 fails to initialize Jos Hulzink
2002-03-09 20:55         ` Ben Clifford
2002-03-11 17:58       ` David S. Miller
2002-02-19 12:21 VFS issues (was: Re: 2.5.5-pre1: mounting NTFS partitions -t VFAT) Andries.Brouwer

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®