From owner-freebsd-questions@FreeBSD.ORG Thu Mar 13 02:32:37 2008 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 F0ECF1065682 for ; Thu, 13 Mar 2008 02:32:37 +0000 (UTC) (envelope-from snow.mountains.4@gmail.com) Received: from wf-out-1314.google.com (wf-out-1314.google.com [209.85.200.168]) by mx1.freebsd.org (Postfix) with ESMTP id D51A18FC22 for ; Thu, 13 Mar 2008 02:32:37 +0000 (UTC) (envelope-from snow.mountains.4@gmail.com) Received: by wf-out-1314.google.com with SMTP id 25so3181215wfa.7 for ; Wed, 12 Mar 2008 19:32:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=5aQB94uReqc8XJePF24SU32X28JoG/pIZpXKgu27sJI=; b=dXlQQXVMuk6HN+pFA3Cw8OJEiU1FDlfdEKgVAU5QJ1aL/vC5Q4Pl1Dqoh0Y12KHHcQRGmParTeSFPr4LDHU+dFASr/YOBpCcTeazP148lhVqJxY9EUqahG24oXI0o+DwhdJKUQo8DCY6+kteGPCxgDeVFjTVgcJWsjCLMTZ3nq4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=aVekTAZ85fYW21wT8MUqWYdx5no0hW2OgEWm00uKpG94dOkvNBMCz/IirjBoMi0fbAMXPjuytFSB2t9fvYF9k7ERTyyBoFi7OXd8L6lJP89OcCo8MjP4Skj/NV0tlCrlKSUmoRtM8vwD3rCAKqjFjbjH2lw6Euy9LkCQEqHKT04= Received: by 10.142.242.8 with SMTP id p8mr3964393wfh.212.1205375557190; Wed, 12 Mar 2008 19:32:37 -0700 (PDT) Received: by 10.142.165.3 with HTTP; Wed, 12 Mar 2008 19:32:37 -0700 (PDT) Message-ID: <3cf9f8920803121932j32caaa79i407dbab8106b3dd8@mail.gmail.com> Date: Thu, 13 Mar 2008 03:32:37 +0100 From: "Snow Mountains" To: "Josh Paetzel" In-Reply-To: <200803121429.14760.josh@tcbug.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <3cf9f8920803101018i573a5c26l986b9508495fcd5a@mail.gmail.com> <444pbcdvwj.fsf@be-well.ilk.org> <3cf9f8920803120530k7f6420bfl5aa203864c058c90@mail.gmail.com> <200803121429.14760.josh@tcbug.org> Cc: freebsd-questions@freebsd.org Subject: Re: no ad1s3a,b,d... on ad1s3 after bsdlabel 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: Thu, 13 Mar 2008 02:32:38 -0000 2008/3/12, Josh Paetzel : > On Wednesday 12 March 2008 07:30:34 am Snow Mountains wrote: > > 2008/3/12, Lowell Gilbert : > > > "Snow Mountains" writes: > > > > I try to understand bsdlabel. > > > > I have former fat slice (ad1s3) on my disk and I want to make several > > > > BSD partitions on it. I did this: > > > > > > > > # dd if=/dev/zero of=/dev/ad1s3 bs=1k count=1024 > > > > 1024+0 records in > > > > 1024+0 records out > > > > 1048576 bytes transferred in 0.318986 secs (3287217 bytes/sec) > > > > # bsdlabel -w ad1s3 > > > > # bsdlabel -e ad1s3 > > > > (edit) > > > > # bsdlabel ad1s3 > > > > # /dev/ad1s3: > > > > 8 partitions: > > > > # size offset fstype [fsize bsize bps/cpg] > > > > a: 10000000 16 4.2BSD 0 0 0 > > > > b: 10000000 10000016 4.2BSD 0 0 0 > > > > c: 47616660 0 unused 0 0 # "raw" part, > > > > don't edit d: 27616644 20000016 4.2BSD 0 0 0 > > > > # newfs -U /dev/ad1s3a > > > > newfs: /dev/ad1s3a: could not find special device > > > > # ls /dev/ad1s3* > > > > /dev/ad1s3 > > > > # > > > > > > > > What I miss because I don't have ad1s3a,b,d? > > > > If repeat same procedure on disk (big file) mounted as /dev/md0, a see > > > > /dev/md0,a,b,d,e... after this group of commands. > > > > > > On what version of FreeBSD? > > > > This happens on: > > > > # uname -r > > 6.2-RELEASE-p11 > > > > SergiM > > > Did you delete and recreate the slice or is it still marked as FAT when you do > fdisk /dev/ad1 Josh, you are right! No, I did not do it. It was still marked as FAT. I thought that it is enough to overwrite first 1M of slice with zeros. I entered sysinstall and just changed slice's type with T. That was enough. Then, fresh bsdlabel appeared on it. After editing, I now have all BSD partitions (a,b,d...) mountable. However, here handbook is not precise, I think. Please see this: http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/disks-adding.html I deduced from it that fdisk is necessary only for dedicated and new disks (fdisk -BI da1 #Initialize your new disk). > If it's still a FAT/DOS slice you might try deleting and recreating it as a > native FreeBSD slice, I'm not entirely sure putting a bsdlabel on a FAT slice > is going to do the right thing (although I could be wrong here) > It seems that you are right. But this still confuses me: # dd if=/dev/zero of=/home/minidisk.bin bs=1k count=100000 ......... # mdconfig -a -t vnode -f /home/minidisk.bin -u 2 # ls /dev/md2* /dev/md2 # bsdlabel -w md2 # ls /dev/md2* /dev/md2 /dev/md2a /dev/md2c # bsdlabel -e md2 .......... # ls /dev/md2* /dev/md2 /dev/md2b /dev/md2d /dev/md2a /dev/md2c /dev/md2e and then # fdisk /dev/md2 ******* Working on device /dev/md2 ******* ................ The data for partition 1 is: sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD) start 63, size 192717 (94 Meg), flag 80 (active) beg: cyl 0/ head 1/ sector 1; end: cyl 11/ head 254/ sector 63 The data for partition 2 is: The data for partition 3 is: The data for partition 4 is: So bsdlabel was enough in this case. Why is this different from real hard disk? And one more question: is disk geometry data somehow written in fdisk W (write) actions? I mean, is it possible to spoil something on existing FreeBSD slices (which contain data) if I set wrong geometry for entire drive when I edit something in fdisk editor? Thank you very much SergiM