From owner-freebsd-hackers Sat Jun 21 22:29:32 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id WAA09455 for hackers-outgoing; Sat, 21 Jun 1997 22:29:32 -0700 (PDT) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.19]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id WAA09450; Sat, 21 Jun 1997 22:29:10 -0700 (PDT) Received: (from bde@localhost) by godzilla.zeta.org.au (8.8.5/8.6.9) id PAA21334; Sun, 22 Jun 1997 15:26:46 +1000 Date: Sun, 22 Jun 1997 15:26:46 +1000 From: Bruce Evans Message-Id: <199706220526.PAA21334@godzilla.zeta.org.au> To: hackers@FreeBSD.ORG, wosch@apfel.de Subject: Re: vnconfig and MSDOS FS Cc: joerg@FreeBSD.ORG Sender: owner-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk >I made a backup of a MSDOS hard disk with dd(1) into >a single 425 MB large file. Now I want mount this file with vnconfig >and mount_msdos, but it will not work: > ># vnconfig -u /dev/vn0c ># vnconfig /dev/vn0c /usr/tmp/adk ># mount_msdos /dev/vn0c /mnt >mount_msdos: /dev/vn0c: Invalid argument > >What's wrong? Does vnconfig not support MSDOS FS? Hint: which slices are the DOS partition(s) on? They probably aren't on the whole disk slice. You need to enable slices using `vnconfig ... -s slices ...' (-s is documented only in the usage message and the slices option isn't documented :-(). You shouldn't use /dev/vn0c, which is the the c partition for the first FreeBSD slice, if slices are not enabled. Use the whole disk device /dev/vn0 if that is what you want. /dev/vn0c happens to work because of sloppy checking for aliases in the driver. All minors for (non-raw) vn0* devices are are aliases for each other. For images on floppies, the problem is a litter harder to fix. The MBR overlaps the boot block and the boot block normally ends with 0xAA55 which is interpreted as a signature for a valid partition table. You have to either edit the boot block to destroy the signature or run fdisk to fix the partition table. I found some bugs in mkdosfs when I tested this on a floppy-sized file system: 1) the file system is named msdos, but the program to create it is named mkdosfs. 2) mkdosfs doesn't clear all the directory entries. For a 1200K file system, it writes malloced garbage to the last 7 sectors in the directory. Bruce