From owner-freebsd-stable@FreeBSD.ORG Sun Jan 15 12:49:54 2006 Return-Path: X-Original-To: freebsd-stable@freebsd.org Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1915516A41F for ; Sun, 15 Jan 2006 12:49:54 +0000 (GMT) (envelope-from b.candler@pobox.com) Received: from thorn.pobox.com (thorn.pobox.com [208.210.124.75]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9F40843D48 for ; Sun, 15 Jan 2006 12:49:53 +0000 (GMT) (envelope-from b.candler@pobox.com) Received: from thorn (localhost [127.0.0.1]) by thorn.pobox.com (Postfix) with ESMTP id 0649CD6 for ; Sun, 15 Jan 2006 07:50:15 -0500 (EST) Received: from mappit.local.linnet.org (212-74-113-67.static.dsl.as9105.com [212.74.113.67]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by thorn.sasl.smtp.pobox.com (Postfix) with ESMTP id CDB5027A9 for ; Sun, 15 Jan 2006 07:50:14 -0500 (EST) Received: from brian by mappit.local.linnet.org with local (Exim 4.60 (FreeBSD)) (envelope-from ) id 1Ey7KR-0006CI-DZ for freebsd-stable@freebsd.org; Sun, 15 Jan 2006 12:49:51 +0000 Date: Sun, 15 Jan 2006 12:49:51 +0000 From: Brian Candler To: freebsd-stable@freebsd.org Message-ID: <20060115124950.GA23753@uk.tiscali.com> References: <20060115123445.GA14271@uk.tiscali.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20060115123445.GA14271@uk.tiscali.com> User-Agent: Mutt/1.4.2.1i Subject: Re: newfs_msdos onto an image file X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jan 2006 12:49:54 -0000 On Sun, Jan 15, 2006 at 12:34:46PM +0000, Brian Candler wrote: > I am trying to prepare an MS-DOS disk image file (for later dd to a USB > device) but am having difficulties getting newfs_msdos to work in this way. > This is under 5.4-RELEASE. P.S. it seems that the total disk size given by -s is in sectors not bytes (this isn't very clear in the manpage). This doesn't help the simple case: # newfs_msdos -h 64 -u 32 -s 256000 /dev/md0 newfs_msdos: Cannot get number of sectors, Operation not supported # newfs_msdos -h 64 -u 32 -s 256000 -S 512 /dev/md0 newfs_msdos: Cannot get number of sectors, Operation not supported But finally I found an incantation that works: # newfs_msdos -h 64 -u 32 -s 256000 -f 1440 -a 125 -F 16 -b 4096 -c 8 /dev/md0 /dev/md0: 255728 sectors in 31966 FAT16 clusters (4096 bytes/cluster) bps=512 spc=8 res=1 nft=2 rde=224 mid=0xf0 spf=125 spt=32 hds=64 hid=0 bsec=256000 # mount -t msdos /dev/md0 /mnt # df -k | grep md0 /dev/md0 127872 8 127864 0% /mnt That was a lot harder work than I was expecting, especially having to use trial-and-error on the sectors per FAT value. Is there any chance that newfs_msdos could gain some intelligence and be able to choose suitable default values? Furthermore, why do I still have to pretend that the device is a 1440K floppy disk? If I remove -f 1440 I get: # newfs_msdos -h 64 -u 32 -s 256000 -a 125 -F 16 -b 4096 -c 8 /dev/md0 newfs_msdos: Cannot get number of sectors, Operation not supported Regards, Brian.