Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 13 Mar 2008 03:32:37 +0100
From:      "Snow Mountains" <snow.mountains.4@gmail.com>
To:        "Josh Paetzel" <josh@tcbug.org>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: no ad1s3a,b,d... on ad1s3 after bsdlabel
Message-ID:  <3cf9f8920803121932j32caaa79i407dbab8106b3dd8@mail.gmail.com>
In-Reply-To: <200803121429.14760.josh@tcbug.org>
References:  <3cf9f8920803101018i573a5c26l986b9508495fcd5a@mail.gmail.com> <444pbcdvwj.fsf@be-well.ilk.org> <3cf9f8920803120530k7f6420bfl5aa203864c058c90@mail.gmail.com> <200803121429.14760.josh@tcbug.org>

next in thread | previous in thread | raw e-mail | index | archive | help
2008/3/12, Josh Paetzel <josh@tcbug.org>:
> On Wednesday 12 March 2008 07:30:34 am Snow Mountains wrote:
>  > 2008/3/12, Lowell Gilbert <freebsd-questions-local@be-well.ilk.org>:
>  > > "Snow Mountains" <snow.mountains.4@gmail.com> 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:
<UNUSED>
The data for partition 3 is:
<UNUSED>
The data for partition 4 is:
<UNUSED>

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3cf9f8920803121932j32caaa79i407dbab8106b3dd8>