Re: 2.5.5-pre1: mounting NTFS partitions -t VFAT

From: Anton Altaparmakov (aia21@mole.bio.cam.ac.uk)
Date: Fri Feb 15 2002 - 12:11:24 EST


On Fri, 15 Feb 2002, Jos Hulzink wrote:
> 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.

At a guess (V)FAT is not checking the OEM identifier in the bootsector
which for NTFS is defined as "NTFS " (i.e. NTFS followed by four ASCII
spaces, 0x20 char code. The OEMid is at offset 3 (bytes) into the
bootsector.

If you just add a check to (v)fat boot sector sanity verification (it
does have one right? if not it REALLY ought to have one...) and make sure
the OEMid is not the ntfs one the fat driver will never touch the ntfs
partition. Even better if it would check for the correct FAT oem id but I
think there may be several different ones so it may be easier to just make
sure it is not NTFS.

Best regards,

Anton

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Feb 15 2002 - 21:01:08 EST