Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 27 Dec 2006 13:46:22 -0300
From:      "Fernan Aguero" <fernan.aguero@gmail.com>
To:        freebsd-geom@freebsd.org
Subject:   gmirror issues (fdisk?, disklabel?, newfs?)
Message-ID:  <520894aa0612270846s89a58cdh4b2bacfe92f75dff@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
Hi!

I've got two identical disks (ad4, ad6) that I want to set
up to use geom (swap in slice1, stripe slice2, mirror slice3).

I'm following the article at
http://people.freebsd.org/~rse/mirror/
and the geom chapter of the FreeBSD handbook, however the
examples are not exactly what I want to achieve, and I'm
confused by a bsdlabel error, and by newfs taken a very long
time (hung?).

ad4 has FreeBSD installed (single slice, simple partition scheme).

I'm trying to set up the mirror with a single slice (ad6s3) first,
then copy data
from ad4 to ad6, then reformat ad4 and add ad4s3 to the mirror.

But, I could not get it done. It seems like I'm able to make my box freeze by
trying to newfs the partitions in gm0s3c (note the 'c').

This is what I did with ad6:

dd if=/dev/zero of=/dev/ad6 bs=512 count=79 => SUCCESS

next I created 3 slices using sysinstall (express install
(experts), selected ad6 and created 3 slices (s1: 8Gb, s2:
40Gb, s3: all remaining space ~ 100 Gb), made s3 bootable,
wrote, quit. Then sysinstall asked me about installing an MBR and I said yes,
and then exit from sysinstall.

fdisk now prints the following:
gama# fdisk /dev/ad6
******* Working on device /dev/ad6 *******
parameters extracted from in-core disklabel are:
cylinders=310101 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=310101 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 16771797 (8189 Meg), flag 0
        beg: cyl 0/ head 1/ sector 1;
        end: cyl 1023/ head 254/ sector 63
The data for partition 2 is:
sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD)
    start 16771860, size 83875365 (40954 Meg), flag 0
        beg: cyl 1023/ head 255/ sector 63;
        end: cyl 1023/ head 254/ sector 63
The data for partition 3 is:
sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD)
    start 100647225, size 211929480 (103481 Meg), flag 80 (active)
        beg: cyl 1023/ head 255/ sector 63;
        end: cyl 1023/ head 254/ sector 63
The data for partition 4 is:
<UNUSED>

Now I set up the mirror:

gmirror label -n -v -b round-robin gm0s3 /dev/ad6s3 => SUCCESS
Metadata value stored on /dev/ad6s3
Done.
gmirror load => SUCCESS

Next I try to create partitions on the newly created gm0s3:

bsdlabel -w -B /dev/mirror/gm0s3 => FAIL
bsdlabel: write /dev/mirror/gm0s3: Operation not permitted

Why is this failing? when I list the mirror providers/consumers, I see that
the provider is 'gm0s3' but the consumer is 'ad6s3c' and not 'ad6s3':


gmirror list
Geom name: gm0s3
State: COMPLETE
Components: 1
Balance: round-robin
Slice: 4096
Flags: NOAUTOSYNC
GenID: 0
SyncID: 1
ID: 853713771
Providers:
1. Name: mirror/gm0s3
   Mediasize: 108507893248 (101G)
   Sectorsize: 512
   Mode: r0w0e0
Consumers:
1. Name: ad6s3c
   Mediasize: 108507893760 (101G)
   Sectorsize: 512
   Mode: r1w1e1
   State: ACTIVE
   Priority: 0
   Flags: BROKEN
   GenID: 0
   SyncID: 1
   ID: 538599761

So I figured out I could just try to partition gm0s3c instead ...

bsdlabel -w -B /dev/mirror/gm0s3c => SUCCESS
bsdlabel -e /dev/mirror/gm0s3c

and this is the partition table:

bsdlabel /dev/mirror/gm0s3c
# /dev/mirror/gm0s3c:
8 partitions:
#        size   offset    fstype   [fsize bsize bps/cpg]
  a:  2097152       16    4.2BSD        0     0     0
  c: 211929480        0    unused        0     0         # "raw" part, don't
edit
  d:  2097152  2097168    4.2BSD        0     0     0
  e: 20971520  4194320    4.2BSD        0     0     0
  f: 41943040 25165840    4.2BSD        0     0     0
  g: 62914560 67108880    4.2BSD        0     0     0
  h: 81906040 130023440    4.2BSD        0     0     0


Now it's impossible to newfs the partitions. It seems like this is getting the
box to freeze ...

newfs -U /dev/mirror/gm0s3a

would never finish even though it's only 1Gb ... even more, it's immune to
Ctrl-C and kill -9.

This is how top shows newfs:
 836 root        1  -8    0  1464K  1020K gwrite   0:00 0.00% newfs

after a while the system becomes unresponsive and needs a hard reset.

This is all on FreeBSD-6.1p10, i386.

What am I doing wrong?

Thanks in advance,

Fernan

-- 
Fernan Aguero



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