From owner-freebsd-questions@FreeBSD.ORG Fri Sep 13 00:18:14 2013 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 8A8FCF54 for ; Fri, 13 Sep 2013 00:18:14 +0000 (UTC) (envelope-from vagabond@blackfoot.net) Received: from nightmare.dreamchaser.org (nightmare.dreamchaser.org [12.32.44.142]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 384CC27BC for ; Fri, 13 Sep 2013 00:18:14 +0000 (UTC) Received: from breakaway.dreamchaser.org (breakaway.dreamchaser.org. [12.32.36.73]) by nightmare.dreamchaser.org (8.13.6/8.13.6) with ESMTP id r8D0I790071517; Thu, 12 Sep 2013 18:18:07 -0600 (MDT) (envelope-from vagabond@blackfoot.net) Message-ID: <523259BF.2070302@blackfoot.net> Date: Thu, 12 Sep 2013 18:18:07 -0600 From: Gary Aitken User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130730 Thunderbird/17.0.7 MIME-Version: 1.0 To: Polytropon Subject: Re: initialize msdosfs on memory stick? References: <5232348E.4070607@dreamchaser.org> <20130912235137.186fb207.freebsd@edvax.de> <52323C77.6050901@blackfoot.net> <20130913002643.aaa708a9.freebsd@edvax.de> In-Reply-To: <20130913002643.aaa708a9.freebsd@edvax.de> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0.2 (nightmare.dreamchaser.org [12.32.36.65]); Thu, 12 Sep 2013 18:18:08 -0600 (MDT) Cc: FreeBSD Mailing List X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Sep 2013 00:18:14 -0000 On 09/12/13 16:26, Polytropon wrote: > On Thu, 12 Sep 2013 16:13:11 -0600, Gary Aitken wrote: >> On 09/12/13 15:51, Polytropon wrote: >>> On Thu, 12 Sep 2013 15:39:26 -0600, Gary Aitken wrote: >>>> I can't seem to find how to do this in the handbook or man pages. >>>> I need to initialize a usb memory stick with an msdos file system. >>>> Is it possible, or do I have to find a windoze system? >>> >>> It is possible. The OS provides the newfs_msdos tool. >>> There is no need to deal with "Windows" for this task. >>> >> >> Great, thanks. >> I checked the newfs manpage but didn't look too carefully when the summary >> line said "construct a new UFS1/UFS2 file system" > > That's correct: newfs "refers to newfs_ufs" (which obviously > initializes a UFS file system), but there are other newfs_* > just as there are corresponding (and more) mount_* commands. > > See "man newfs_msdos" for more details. I see that; but was surprised newfs didn't see-also newfs_msdosfs. Anyhoo... ugh, I think I just screwed it up, not thinking things through. After doing # newfs_msdos -F 32 -S 4096 /dev/da0 newfs_msdos: trim 62 sectors to adjust to a multiple of 63 /dev/da0: 979584 sectors in 30612 FAT32 clusters (131072 bytes/cluster) BytesPerSec=4096 SecPerClust=32 ResSectors=4 FATs=2 Media=0xf0 SecPerTrack=63 Heads=255 HiddenSecs=0 HugeSectors=979650 FATsecs=30 RootCluster=2 FSInfo=1 Backup=2 I can't mount it, and there are no partitions: # ls /dev/da0* /dev/da0 # mount -t msdosfs /dev/da0 /mnt/memstick mount_msdosfs: /dev/da0: Invalid argument Normally there is a /dev/da0s1. I suspect I *should* have used /dev/da0s1 in the newfs_msdos cmd. So, attempting to re-establish the partitions: #gpart create -s MBR da0 da0 created # gpart show -l da0 => 63 7837633 da0 MBR (3.8G) 63 7837633 - free - (3.8G) # gpart add -t mbr da0 gpart: Invalid argument now what? Is mbr the wrong kind of partition type? man gpart indicates the MBR scheme requires the GEOM_PART_MBR kernel option; since the create succeeded, I'm assuming this is present?