From owner-freebsd-questions@FreeBSD.ORG Mon Apr 10 15:35:25 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8151216A406 for ; Mon, 10 Apr 2006 15:35:25 +0000 (UTC) (envelope-from petermatulis@yahoo.ca) Received: from web60024.mail.yahoo.com (web60024.mail.yahoo.com [209.73.178.72]) by mx1.FreeBSD.org (Postfix) with SMTP id 1186743D48 for ; Mon, 10 Apr 2006 15:35:24 +0000 (GMT) (envelope-from petermatulis@yahoo.ca) Received: (qmail 25117 invoked by uid 60001); 10 Apr 2006 15:35:24 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.ca; h=Message-ID:Received:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=OV76hseRNEfN9RjRJBjfqydSCBEARg7hf5DrKP+eCN9Ig2C7oRqCoGvmICSSqnAJvzFwvmzJuPMRCWLEk5DSOS+6GJWxAZOt7kMb0l1MfgehRxdhFdbfBT9yuzk53Dz2HACHzhXN41CrUNwyxbqCyMoHGh4/Cib12tXB2XFsmC0= ; Message-ID: <20060410153524.25115.qmail@web60024.mail.yahoo.com> Received: from [70.81.189.3] by web60024.mail.yahoo.com via HTTP; Mon, 10 Apr 2006 11:35:24 EDT Date: Mon, 10 Apr 2006 11:35:24 -0400 (EDT) From: Peter To: Jerry McAllister In-Reply-To: <200604101417.k3AEHY3S015943@clunix.cl.msu.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Cc: freebsd-questions Subject: Re: seeking help on "adding a disk" 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, 10 Apr 2006 15:35:25 -0000 --- Jerry McAllister wrote: > > > > Hi everyone. I am having trouble adding a IDE 300 GB Maxtor to my > 6.0 > > system. It is recognized as ad2. Here is dmesg: > > > > ad0: 39205MB at ata0-master UDMA133 > > ad1: 190782MB at ata0-slave UDMA100 > > ad2: 286188MB at ata1-master UDMA133 > > > > I want to devote the entire disk to FreeBSD and use a single slice > and > > partition and mount it on directory /images. > > > > This is what happened: > > > > # dd if=/dev/zero of=/dev/ad2 bs=1k count=64 > > 64+0 records in > > 64+0 records out > > 65536 bytes transferred in 0.005377 secs (12188086 bytes/sec) > > > > # fdisk -B -I /dev/ad2 > > ******* Working on device /dev/ad2 ******* > > fdisk: invalid fdisk partition table found > > fdisk: Geom not found > > > > # bsdlabel -w -B /dev/ad2s1 > > > > # fdisk ad2 > > ******* Working on device /dev/ad2 ******* > > parameters extracted from in-core disklabel are: > > cylinders=581463 heads=16 sectors/track=63 (1008 blks/cyl) > > > > Figures below won't work with BIOS for partitions not in cyl 1 > > parameters to be used for BIOS calculations are: > > cylinders=581463 heads=16 sectors/track=63 (1008 blks/cyl) > > > > 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 586114641 (286188 Meg), flag 80 (active) > > beg: cyl 0/ head 1/ sector 1; > > end: cyl 854/ head 15/ sector 63 > > The data for partition 2 is: > > > > The data for partition 3 is: > > > > The data for partition 4 is: > > > > > > # bsdlabel ad2s1 > > # /dev/ad2s1: > > 8 partitions: > > # size offset fstype [fsize bsize bps/cpg] > > a: 586114625 16 unused 0 0 > > c: 586114641 0 unused 0 0 # "raw" > part, > > don't edit > > > > > > Now shouldn't I have some values in the first (a:) row? > > > > Anyway, when I try to create a filesystem with newfs I get an > error: > > > > # newfs /dev/ad2s1a > > ..., 450493504, 450869856, 451246208,newfs: wtfs: 65536 bytes at > sector > > 451622560: Input/output error > > > > Now please let me know if my method is sound. I feel the drive > size is > > not being properly recognized and that > > the last command is trying to write past the edge of the disk. I > would > > also like to not be using s1a but s1e instead. > > > > Furthermore, the docs [1] for this drive say that an 80-wire cable > is > > required. I didn't have one handy so I had to > > use a 40-wire cable. Could this be causing the trouble? > > > > Thanks for any insights (I have a hell of a time working with disks > on > > FreeBSD). > > It looks like things worked up to the bsdlabel which didn't do > anything. > Namely, after doing the fdisk, even though you saw some errors, > you seem to have gotten a single slice with everything in it just > as you wanted. > > > The data for partition 1 is: > > sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD) > > start 63, size 586114641 (286188 Meg), flag 80 (active) > > beg: cyl 0/ head 1/ sector 1; > > end: cyl 854/ head 15/ sector 63 > > The data for partition 2 is: > > I usually do fdisk -BI -v -b /boot/mbr ad2 > but, I believe the -b /boot/mbr is default with you use -B > and I think it will take /dev/ad2 as well as just ad2. Actually I > am usually working on SCSI drives so it is da2, etc, but that > shouldn't > be any different. > > To answer your question on that, It looks like the data in the > bsdlabel read you did is probably correct. It shows values for size and > offset although the offset seems weird. I would expect it to be 0. Maybe > that is because you didn't do the first bsdlabel step. Which first step? > For the disklabel you need two steps - noting that you were writing > the label to make it bootable, you need: > > bsdlabel -w -B ad2s1 auto > and then > bsdlabel -e ad2s1 > > The first step (which you appear to have skipped) makes the base > label on the slice and the second edits it to be the way you want. I cannot find the 'auto' option in the bsdlabel man page. Also, I do not need the drive to be bootable. I redid the procedure like this: # dd if=/dev/zero of=/dev/ad2 bs=1k count=64 # fdisk -I ad2 { same "error" msg as before } # bsdlabel -w ad2s1 # bsdlabel -e ad2s1 ------------------------ # /dev/ad2s1: 8 partitions: # size offset fstype [fsize bsize bps/cpg] e: 586114625 16 unused 2048 16384 89 c: 586114641 0 unused 0 0 # "raw" part, don't edit ------------------------ # newfs -U /dev/ad2s1e > > e: * * 4.2BSD 2048 16384 89 > > You may actually want bigger fsize, bsize and some different bps/cpg > I sometimes set bps/cpg to 64 on larger disks and 16 on smaller, but > I usually let it do whatever bps/cpg that it wants, but often specify > the fsize and bsize. bsize should be 8X fsize. How do you explain this on another (5.4) system of mine: # bsdlabel ad0s3 # /dev/ad0s3: 8 partitions: # size offset fstype [fsize bsize bps/cpg] a: 524288 0 4.2BSD 0 0 0 b: 4142736 524288 swap c: 24900750 0 unused 0 0 # "raw" part, don't edit d: 524288 4667024 4.2BSD 0 0 0 e: 524288 5191312 4.2BSD 0 0 0 f: 19185150 5715600 4.2BSD 0 0 0 > The newfs should then work after the bsdlabel is fixed up. Nope. Same error. Retries of newfs causes crashes at random sectors. I am guessing that the 40-wire cable is causing poor signaling. I also tried changing the offset of 'e' to 0 and modifying the 'size' so that it matches 'c'. __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com