From owner-freebsd-questions@FreeBSD.ORG Mon Jul 30 21:12:59 2007 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 7178B16A417 for ; Mon, 30 Jul 2007 21:12:59 +0000 (UTC) (envelope-from jerrymc@gizmo.acns.msu.edu) Received: from gizmo.acns.msu.edu (gizmo.acns.msu.edu [35.8.1.43]) by mx1.freebsd.org (Postfix) with ESMTP id 37A5713C48A for ; Mon, 30 Jul 2007 21:12:59 +0000 (UTC) (envelope-from jerrymc@gizmo.acns.msu.edu) Received: from gizmo.acns.msu.edu (localhost [127.0.0.1]) by gizmo.acns.msu.edu (8.13.6/8.13.6) with ESMTP id l6ULA0jr027193; Mon, 30 Jul 2007 17:10:00 -0400 (EDT) (envelope-from jerrymc@gizmo.acns.msu.edu) Received: (from jerrymc@localhost) by gizmo.acns.msu.edu (8.13.6/8.13.6/Submit) id l6ULA0DK027189; Mon, 30 Jul 2007 17:10:00 -0400 (EDT) (envelope-from jerrymc) Date: Mon, 30 Jul 2007 17:10:00 -0400 From: Jerry McAllister To: Cyrus Message-ID: <20070730211000.GA27043@gizmo.acns.msu.edu> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.2i Cc: freebsd-questions Subject: Re: secondary hdd 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: Mon, 30 Jul 2007 21:12:59 -0000 On Mon, Jul 30, 2007 at 01:20:31PM -0700, Cyrus wrote: > ok, i origainly had windows xp pro on my machine, i installed freebsd 6.2. > my machine has a 40gb seagate disk for o/s, and a 160 gb WD disk for > storage. > > my question is, how do i go about formating the 160 gb, from ntfs to ufs for > use in freebsd? and make it automount when system boots? That is pretty well documented in the handbook, FAQs and online publications. A brief rundown is: You don't have to literally "reformat" it. That is a low level process done at the factory and normally not redone. But, we know what you mean - you want to do whatever is necessary to use it in FreeBSD and don't care what the process is actually called. NOTE: If it is SCSI the name is da1: if IDE/SATA it is probably ad1: ALSO NOTE: I am presuming you do not intend to make this disk bootable. If you do, add a -B flag to the fdisk and to the first bsdlabel NOTE too: This all must be done as root. First: use fdisk to create one slice (da1s1) of FreeBSD type on it that occupies the whole disk. dd if=/dev/zero of=/dev/da1 bs=512 count=1024 fdisk -I da1 the dd wipes out old stuff. It might not be needed, but is easy just to make sure. Second: use bsdlabel to write the partitions in that slice. Partition layout Depends on how you want to use it. For example, I will use one chunk of extra swap and two mountable partitions d & e. bsdlabel -w da1s1 [this puts the base label there] bsdlabel -e da1s1 [this puts you in mode to edit partitions] you will then see something like this: 8 partitions: # size offset fstype [fsize bsize bps/cpg] c:335544320 0 unused 0 0 # "raw" part, don't edit Edit it to look something like: 8 partitions: # size offset fstype [fsize bsize bps/cpg] b: 2097162 0 swap c:335544320 0 unused 0 0 # "raw" part, don't edit d: 33554432 * 4.2BSD 2048 16384 8 e: * * 4.2BSD 2048 16384 28552 This will give you a 1 GB swap partition, a 16 GB da1s1d partition and a da1s1e partition that takes up all the rest of the disk. NOTE: The numbers under size and offset are in 512 byte blocks. You can use values like 16GB, but this was is consistent. NOTE too: When you use * for offset and the final size, bsdlabel calculates them for you - correctly. But you can specify them yourself if you want - if you are doing something weird like leaving a hole in the middle or whatever. Third: You must run newfs on the two mountable partitions newfs /dev/da1s1d newfs /dev/da1s1e Nowdays the defaults are generally good for most usages, but there may be times you need to adjust them to get more inodes if you have a large filesystem with lots of vary small files. NOTE: newfs seems to want the full device name still, even though fdisk and bsdlabel now will fill in if you just give them da1 without /dev. Fourth: You must create mount points for the mountable partitions. Say you want to mount them as /work and /scratch, then mkdir /work mkdir /scratch Fifth: You must edit /etc/fstab to add lines for each of the three new partitions. The swap should look like your existing swap line with the new device name, something like: /dev/ad0s3b none swap sw 0 0 The mountable partition should look about like one of the other mountable partition lines but with the new names: /dev/da1s1d /work ufs rw 2 2 /dev/da1s1e /scratch ufs rw 2 2 Thereafter, it should all work just fine and dandy. Again, note, these examples are for SCSI. For IDE/SATA the device names would be ad.... in place of da.... such as bsdlabel ad1s1 and /dev/as1s1d for mounts. The documentation is quite complete on this. You should do some reading. ////jerry > > Thank you > Cyrus > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"