From owner-freebsd-questions@FreeBSD.ORG Sun Jul 8 02:36:37 2012 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2993F106566C for ; Sun, 8 Jul 2012 02:36:37 +0000 (UTC) (envelope-from wblock@wonkity.com) Received: from wonkity.com (wonkity.com [67.158.26.137]) by mx1.freebsd.org (Postfix) with ESMTP id DA2F38FC0A for ; Sun, 8 Jul 2012 02:36:36 +0000 (UTC) Received: from wonkity.com (localhost [127.0.0.1]) by wonkity.com (8.14.5/8.14.5) with ESMTP id q682aaZn045210 for ; Sat, 7 Jul 2012 20:36:36 -0600 (MDT) (envelope-from wblock@wonkity.com) Received: from localhost (wblock@localhost) by wonkity.com (8.14.5/8.14.5/Submit) with ESMTP id q682aawp045207 for ; Sat, 7 Jul 2012 20:36:36 -0600 (MDT) (envelope-from wblock@wonkity.com) Date: Sat, 7 Jul 2012 20:36:36 -0600 (MDT) From: Warren Block To: FreeBSD In-Reply-To: Message-ID: References: User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7 (wonkity.com [127.0.0.1]); Sat, 07 Jul 2012 20:36:36 -0600 (MDT) Subject: Re: Format a USB flash drive using gpart X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jul 2012 02:36:37 -0000 On Sat, 7 Jul 2012, Carmel wrote: > This is probably a dumb question, but does gpart even work on a USB > flash drive? I have not been able to figure out how to do it. I want to > erase the entire drive and format it for a FreeBSD UFS2 file system. Yes, gpart will work with pretty much any storage device. If you want the drive to be bootable, it needs boot blocks. This is easier with GPT than MBR. For an 8G drive: # gpart create -s gpt da0 # gpart add -t freebsd-boot -s 512k da0 # gpart bootcode -b /boot/pmbr -p /boot/gptboot -i 1 da0 # gpart add -t freebsd-ufs -b 1M -s 7G da0 # gpart add -t freebsd-swap da0 # newfs -U /dev/da0p2