Re: mounting msdosfs

From: Tim Robbins <tjr_at_freebsd.org>
Date: Sun, 2 May 2004 11:57:41 +1000
On Sun, Apr 25, 2004 at 06:15:31PM +0200, Christer Solskogen wrote:

> On Sun, 2004-04-18 at 05:44, Tim Robbins wrote:
> 
> > That fix looks reasonable. I'll see if I can get around to merging
> > this and any other useful fixes from NetBSD later tonight.
> > 
> 
> I just upgraded to CURRENT, and it seems like my problem is not fixed.
> The NetBSD import did not the trick :/
> 
> If I can help you with some info, please tell me.

Apologies for the late reply. Can you apply this patch & show me the
output of running fsck_msdosfs on the partitions that failed the backup
boot block check?

==== //depot/user/tjr/freebsd-tjr/src/sbin/fsck_msdosfs/boot.c#3 - /home/tim/p4/src/sbin/fsck_msdosfs/boot.c ====
_at__at_ -56,6 +56,7 _at__at_
 	u_char fsinfo[2 * DOSBOOTBLOCKSIZE];
 	u_char backup[DOSBOOTBLOCKSIZE];
 	int ret = FSOK;
+	int i, j;
 	
 	if (read(dosfs, block, sizeof block) < sizeof block) {
 		perror("could not read boot block");
_at__at_ -159,6 +160,23 _at__at_
 			perror("could not read backup bootblock");
 			return FSFATAL;
 		}
+		printf("Boot block:\n");
+		for (i = j = 0; i < 512; i++) {
+			j += printf("%02x ", block[i]);
+			if (j > 70) {
+				putchar('\n');
+				j = 0;
+			}
+		}
+		printf("Backup block:\n");
+		for (i = j = 0; i < 512; i++) {
+			j += printf("%02x%c", backup[i],
+			    backup[i] == block[i] ?  ' ' : '*');
+			if (j > 70) {
+				putchar('\n');
+				j = 0;
+			}
+		}
 		backup[65] = block[65];				/* XXX */
 		if (memcmp(block + 11, backup + 11, 79)) {
 			/* Correct?					XXX */
Received on Sat May 01 2004 - 16:58:20 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:52 UTC