From owner-freebsd-questions@FreeBSD.ORG Tue May 12 16:01:58 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2EAED106566B for ; Tue, 12 May 2009 16:01:58 +0000 (UTC) (envelope-from m.seaman@infracaninophile.co.uk) Received: from smtp.infracaninophile.co.uk (gate6.infracaninophile.co.uk [IPv6:2001:8b0:151:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id A0A2B8FC0A for ; Tue, 12 May 2009 16:01:57 +0000 (UTC) (envelope-from m.seaman@infracaninophile.co.uk) Received: from happy-idiot-talk.infracaninophile.co.uk (localhost [IPv6:::1]) (authenticated bits=0) by smtp.infracaninophile.co.uk (8.14.3/8.14.3) with ESMTP id n4CG1nmk055856; Tue, 12 May 2009 17:01:50 +0100 (BST) (envelope-from m.seaman@infracaninophile.co.uk) X-DKIM: Sendmail DKIM Filter v2.8.2 smtp.infracaninophile.co.uk n4CG1nmk055856 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=infracaninophile.co.uk; s=200708; t=1242144111; bh=V9gIdt37F7OLBmxDDTDn7HTZSiENLqcvG9Gvr7qtgmM=; h=Message-ID:Date:From:MIME-Version:To:CC:Subject:References: In-Reply-To:Content-Type:Cc:Content-Type:Date:From:In-Reply-To: Message-ID:Mime-Version:References:To; z=Message-ID:=20<4A099D64.9050709@infracaninophile.co.uk>|Date:=20T ue,=2012=20May=202009=2017:01:40=20+0100|From:=20Matthew=20Seaman= 20|Organization:=20Infracaninophi le|User-Agent:=20Thunderbird=202.0.0.21=20(X11/20090420)|MIME-Vers ion:=201.0|To:=20Daniel=20Underwood=20|CC:=2 0"freebsd-questions@freebsd.org"=20 |Subject:=20Re:=20Reformatting=20external=20harddrive|References:= 20|In- Reply-To:=20|X-Enigmail-Version:=200.95.6|Content-Type:=20multipart/sign ed=3B=20micalg=3Dpgp-sha256=3B=0D=0A=20protocol=3D"application/pgp -signature"=3B=0D=0A=20boundary=3D"------------enig5A3D8B3BB51123E 2D769C81D"; b=MAx11cPObGReQev165yjw4hPkLPpJ0765zCvcJdGe7RkzSRRS7/cGtG1ltxXZ2sSz 0ybS7rWW0FjMUMJ9Ff+IgBnuZ6l5hWRZ5WxoxtoheWYfQk0VEQn1ss71c0XNFyRa0O paQ6SYTvs0oo/VvqgMOFECj39nsG5AGuN+axyJIA= X-Authentication-Warning: happy-idiot-talk.infracaninophile.co.uk: Host localhost [IPv6:::1] claimed to be happy-idiot-talk.infracaninophile.co.uk Message-ID: <4A099D64.9050709@infracaninophile.co.uk> Date: Tue, 12 May 2009 17:01:40 +0100 From: Matthew Seaman Organization: Infracaninophile User-Agent: Thunderbird 2.0.0.21 (X11/20090420) MIME-Version: 1.0 To: Daniel Underwood References: In-Reply-To: X-Enigmail-Version: 0.95.6 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enig5A3D8B3BB51123E2D769C81D" X-Virus-Scanned: clamav-milter 0.95.1 at happy-idiot-talk.infracaninophile.co.uk X-Virus-Status: Clean X-Spam-Status: No, score=-3.0 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VERIFIED,NO_RELAYS autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on happy-idiot-talk.infracaninophile.co.uk Cc: "freebsd-questions@freebsd.org" Subject: Re: Reformatting external harddrive 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: Tue, 12 May 2009 16:01:58 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig5A3D8B3BB51123E2D769C81D Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Daniel Underwood wrote: > After unsuccessfully trying to reformat my external harddrive on my > linux machine, I'm trying to reformat the disk in FreeBSD. Frankly, I > just don't know how to do that. Please help me get the disk back to > working order; I don't need to keep any data that is currently on the > disk. >=20 > The command >=20 > $ /dev/da0 ITYM: fdisk /dev/da0 > gives the following output: >=20 > ******* Working on device /dev/da0 ******* > parameters extracted from in-core disklabel are: > cylinders=3D38913 heads=3D255 sectors/track=3D63 (16065 blks/cyl) >=20 > Figures below won't work with BIOS for partitions not in cyl 1 > parameters to be used for BIOS calculations are: > cylinders=3D38913 heads=3D255 sectors/track=3D63 (16065 blks/cyl) >=20 > Media sector size is 512 > Warning: BIOS sector numbering starts with sector 1 > Information from DOS bootblock is: > The data for partition 1 is: > sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD) > start 63, size 625137282 (305242 Meg), flag 80 (active) > beg: cyl 0/ head 1/ sector 1; > end: cyl 0/ head 254/ sector 63 > The data for partition 2 is: > > The data for partition 3 is: > > The data for partition 4 is: > This says that you have written a partition table onto the drive that indicates the whole disk is being used for FreeBSD. That's a good start if your intention is to use the disk dedicated for FreeBSD. The way the partition naming scheme works you should now have a /dev/da0s= 1 device file (indicating 'slice 1' or disk 'da0') In order to make the disk usable with FreeBSD, you need to follow somethi= ng like these steps: * Use bsdlabel(8) to create BSD partitions on slice1. To write a=20 default label: # bsdlabel -w /dev/da0s1 Then to edit the default label and define the partitions you want, # bsdlabel -e da0s1 Edit mode will pop up an editor with the existing BSD partition table -- that's vi(1) by default but you can override it by setting = the EDITOR environment variable. If your aim is to use this disk as one big filesystem for storing da= ta then creating a 'd' partition covering all the available space would= be appropriate. After saving the edited partition table you should now= have a device file: /dev/da0s1d * Use newfs(8) to create a filesystem on the drive. I'd just leave it= with the default settings unless you know you're going to be using the di= sk=20 for unusually large files or unusually many very small files. newfs /dev/da0s1d * Mount the new filesystem to make it available to FreeBSD. Add a lin= e like the following to /etc/fstab: /dev/da0s1d /data ufs rw 2 2 Then create the mount point: # mkdir -p /data and mount the drive: # mount /data The drive will be remounted automatically on system reboots and is = expected to be permanently present. If you want to have the disk be removab= le, then read all about amd(8) and feel free to ask again here. Cheers, Matthew --=20 Dr Matthew J Seaman MA, D.Phil. 7 Priory Courtyard Flat 3 PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate Kent, CT11 9PW --------------enig5A3D8B3BB51123E2D769C81D Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.11 (FreeBSD) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEAREIAAYFAkoJnW0ACgkQ8Mjk52CukIwEAgCgi7M2A4CYkwLQKRekiB8QAt6S OgwAn2wpnd6ZZzJVWlaSl64pwBUHjsop =Onkf -----END PGP SIGNATURE----- --------------enig5A3D8B3BB51123E2D769C81D--