vinum drive referenced / disklabel inconsistency

Clark C. Evans cce at clarkevans.com
Sun Jun 29 12:54:18 PDT 2003


I am trying to setup vinum on a box using 4.8 RELENG_4 (as of about a
week ago snapshot).  This box was running 4.6 /w vinum on same hard 
drives for the last 4 months wonderfully... but since it is my 
current 'scratch/backup' box, I just reinstalled with -STABLE.

# uname -a
  FreeBSD polya.axista.com 4.8-STABLE FreeBSD 4.8-STABLE #22: Tue Jun 24
  17:01:07 EDT 2003     cce at cantor.local:/usr/obj/usr/src/sys/GENERIC i386

Anyway, my problems seem to be coming from a disklabel issue.  Following
the instructions in the handbook (for disk addition), I go through the
following steps:

   # dd if=/dev/zero of=/dev/ad2 bs=1k count=1
   # fdisk -BI ad2
   # disklabel -B -w -r ad2s1 auto

And at this point, I use the following to extract the current
label, and then I edit it with vi, and then update it:
  
   # disklabel ad2s1 > label
   # vim label
   # disklabel -R -r ad2s1 label

Following is the tail end of the label (I don't edit anything else)
where I add 'swap' and 'vinum' partitions:

  a: 4193280 0 swap
  c: 156301425        0    unused        0    0 
  e: 152107200 4193280 vinum

The results, when "restoring" the label, however, are inconsistent, with

  # disklabel ad2s1
  # disklabel ad2
  # disklabel -r ad2s1
  # disklabel -r ad2
  # disklabel /dev/ad2s1
  # disklabel -r /dev/ad2s1

the results are expected (and identical):

  <snip/>

  8 partitions:
  #        size   offset    fstype   [fsize bsize bps/cpg]
    a:  4193280        0      swap                # (Cyl.    0 - 4159)
    c: 156301425        0    unused        0    0 # (Cyl.    0 - 155060*)
    e: 152107200  4193280     vinum               # (Cyl. 4160 - 155059)

However, for the other two permutations... the results are different: 

  # disklabel /dev/ad2

  <snip/>

  8 partitions:
  #        size   offset    fstype   [fsize bsize bps/cpg]
 c: 156301488        0    unused        0     0   # (Cyl.    0 - 155060)
  
  # disklabel -r /dev/ad2
  disklabel: bad pack magic number (label is damaged, or pack is unlabeled)

At this point, I use the following vinum configuration file to
setup vinum "vinum create -f vinum.conf"

    drive d2 device /dev/ad2s1e
    volume tmp setupstate
     plex name tmp.2 org concat
      sd length 2000m drive d2

And this produces...

  1 drives:
  D d2                State: referenced       Device  Avail: 0/0 MB
  
  1 volumes:
  V tmp             State: down     Plexes:       1 Size:       2000 MB
  
  1 plexes:
  P tmp.2         C State: faulty   Subdisks:     1 Size:       2000 MB
  
  1 subdisks:
  S tmp.2.s0        State: crashed  PO:        0  B Size:       2000 MB


And of course, this is where I get stuck...  With 4.6 I didn't have any
of these problems (from the bad pack magic number to the missing device
in the vinum state).   Anyway, following is the full output from the
disklabel.

# disklabel -r /dev/ad2s1
  # /dev/ad2s1:
  type: unknown
  disk: amnesiac
  label:
  flags:
  bytes/sector: 512
  sectors/track: 63
  tracks/cylinder: 16
  sectors/cylinder: 1008
  cylinders: 155060
  sectors/unit: 156301425
  rpm: 3600
  interleave: 1
  trackskew: 0
  cylinderskew: 0
  headswitch: 0           # milliseconds
  track-to-track seek: 0  # milliseconds
  drivedata: 0
  
  8 partitions:
  #        size   offset    fstype   [fsize bsize bps/cpg]
    a:  4193280        0      swap                  # (Cyl.    0 - 4159)
    c: 156301425        0    unused        0     0  # (Cyl.    0 - 155060*)
    e: 152107200  4193280     vinum                 # (Cyl. 4160 - 155059)

Thank you for any suggestions you may have,

Clark


More information about the freebsd-stable mailing list