Date: Tue, 4 Dec 2001 08:31:30 +0000 From: Tony <tony@ubik.demon.co.uk> To: freebsd-fs@freebsd.org Cc: Eugene Grosbein <eugen@grosbein.pp.ru> Subject: Re: [PATCH] msdosfs_vfsops.c: some kind of FAT32 incompatibility? Message-ID: <Usa06KAinID8IwoI@ubik.demon.co.uk> In-Reply-To: <20011203235203.A435@grosbein.pp.ru> References: <20011203235203.A435@grosbein.pp.ru>
next in thread | previous in thread | raw e-mail | index | archive | help
In article <20011203235203.A435@grosbein.pp.ru>, Eugene Grosbein
<eugen@grosbein.pp.ru> writes
>Hi!
Hi
>FreeBSD has obtained FAT32 support with jkh's commit 3 years, 9 months ago
>(see revision 1.24). FAT32 checks has not changed since then basically.
>Here are problem description and patch suggested for discussion.
>
>First I have to explain partitioning of my 6.4G hard drive.
>
>Slice 1: Primary DOS partition, FAT16 500Mb (C: for DOS)
>Slice 2: Extended DOS partition, 1500Mb single "disk D:", FAT32.
> No free space in the slice for new DOS disks.
>Slice 3: 3G for FreeBSD.
>
>The rest is free and the last record in the MBR is not occupied.
>This was intentionally left blank as space for testing of
>unstable OS versions and used for it for some time.
Okay.
>Once I decided to use some of this space for Windows95 residing
>at the beginning of drive but there was no standard tools to make it
>visible for Win95. So I used Norton Utilities 3.01 for Win95 and
>its Disk Editor to create new "Extended Partition" residing
>at the end of drive
I think you would have been better to create another Primary Partition.
Windows 9x and NT cannot create more than one Primary Partition on a
drive, but they are perfectly happy to use them.
>and to link it to existing Extended Partition.
>Disk Editor has feature named 'Recalculate partition' that should
>guarantee correctness of new partition record.
This really sounds messy to your extended partition fragmented like
this. It will certainly cause problems with disk checking tools, as you
have found.
>I'm not sure if similar chain of "partitions" is completely correct,
>at least this worked for me over a year with one remark: Norton Disk Doctor
>did not like the last partition but agreed it to exist and
>proposed "to mark" it so that it will not complain every time it is run.
>Then all worked very well and this new "disk E:" was formatted as FAT32 and
>used as usual.
>
>Now we are back to FreeBSD. "Disk D:" can be mounted as /dev/ad0s5.
>If I do not allow NDD to touch "Disk E:" it can be mounted as /dev/ad0s6
>and used by FreeBSD. However, when NDD "marks" it, FreeBSD cannot mount this
>"disk" anymore. Diagnostic is "mountmsdosfs(): bad FAT32 filesystem".
>
>The reason is that NDD changes the only byte in FAT32 signature:
>it changes BOOTSIG2 from 0 to 0x52. The filesystem is still usable
>by Windows but cannot be mounted by FreeBSD.
>
>Well, I can live with this, applying the following patch before each
>"buildworld". I just think that somebody else can hit this hole too.
I think very few people will do anything similar to you with extended
partitions.
On the other hand as NDD has a feature for tagging strange partitions
some other people may also find their FAT32 partitions ignored by
FreeBSD. I expect NDD is mostly right that the partition information
should be complained about, but if the user has been made aware and told
NDD to ignore it FreeBSD should ignore it too.
>So I propose the patch that handles this situation.
>The patch is for RELENG_4 but that piece of code has not changed for
>long time so it should apply to CURRENT cleanly in spite of different
>file locations.
>
>diff -ur ./bootsect.h /usr/src/sys/msdosfs/bootsect.h
>--- ./bootsect.h Sat Aug 28 08:48:06 1999
>+++ /usr/src/sys/msdosfs/bootsect.h Mon Dec 3 22:27:13 2001
>@@ -69,6 +69,7 @@
> #define BOOTSIG0 0x55
> #define BOOTSIG1 0xaa
> #define BOOTSIG2 0
>+#define BOOTSIG2_COMPAT 0x52
Please, please if this is committed comment clearly what this is for.
> #define BOOTSIG3 0
> };
> #ifdef atari
>diff -ur ./msdosfs_vfsops.c /usr/src/sys/msdosfs/msdosfs_vfsops.c
>--- ./msdosfs_vfsops.c Mon Nov 5 01:57:51 2001
>+++ /usr/src/sys/msdosfs/msdosfs_vfsops.c Mon Dec 3 22:28:30 2001
>@@ -524,7 +524,8 @@
> }
>
> if (pmp->pm_RootDirEnts == 0) {
>- if (bsp->bs710.bsBootSectSig2 != BOOTSIG2
>+ if ((bsp->bs710.bsBootSectSig2 != BOOTSIG2
>+ && bsp->bs710.bsBootSectSig2 != BOOTSIG2_COMPAT)
> || bsp->bs710.bsBootSectSig3 != BOOTSIG3
> || pmp->pm_Sectors
> || pmp->pm_FATsecs
>
>
>Please CC me when replying. Thank you.
>Eugene Grosbein
Tony
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-fs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Usa06KAinID8IwoI>
