partitioning and labeling geom devices

Shaun Jurrens shaun at shamz.net
Tue Jan 11 03:00:23 PST 2005


hi all,

I'm having problems getting a gstripe "sliced" and "labeled".  It's
probably that I've messed a step conseptually here somewhere, but I'm sort
of a lazy sysinstall weenie when it comes to setting up disks for fbsd,
mostly because it always "just worked".  I was always presented with a device
that I could create slices and partitions on that could be "newfs'd" and
mounted.

A quick aside before I continue, 'man -k geom' would be more useful if the
manpages included 'geom' in the headers... damn hard to find out what's
there...

What I've done til now:

uname -a: FreeBSD paracles 5.3-STABLE FreeBSD 5.3-STABLE #1: Wed Dec  8
16:36:46 CET 2004  (working on a new world now)

I've taken 6 9GB disks and created 3 two-disk gmirror devices called plex0,
plex1, and plex2 . 

gmirror label -v -b split -s 2048 plex0 da1 da2
gmirror label -v -b split -s 2048 plex1 da3 da4
gmirror label -v -b split -s 2048 plex2 da5 da6

The devices look like this:

paracles:/stand#> ll /dev/mirror/.
total 0
crw-r-----  1 root  operator    4, 188 Jan  4 18:01 plex0
crw-r-----  1 root  operator    4, 189 Jan  4 18:01 plex0a
crw-r-----  1 root  operator    4, 190 Jan  4 18:01 plex0c
crw-r-----  1 root  operator    4, 191 Jan  4 18:01 plex1
crw-r-----  1 root  operator    4, 200 Jan  4 18:01 plex2

wth there's a plex0a and plex0c, is beyond my comprehension atm...

-------------------------------------------------------------

The next step was to create one gstripe using plex[0-2]. This stripe I just
called stripe0, for lack of imagination at that point.

gstripe label -v -s 1024 stripe0 /dev/mirror/plex0 /dev/mirror/plex1
/dev/mirror/plex2

This seems to have worked as expected.

paracles:/stand#> ll /dev/stripe/.
total 0
crw-r-----  1 root  operator    4, 231 Jan  4 18:01 stripe0

-------------------------------------------------------------

Now I have /dev/stripe/stripe0 and i want to subdivide this into two slices
(aka. DOS partitions) and then partition the slices into various FreeBSD
partitions, (so the a-h thingies, for those catching up).  This is sort of
where the concept goes to hell.

Sysinstall just barfs literally with 'BARF 269' as error code. Being the
lazy sysinstall weenie that I am, this was discouraging. The next step is
to dig into the myriad of similar tools in the post geom FreeBSD world to
see how one can get the job done.  'fdisk' seemed to be a good place to
start, but we also have 'gpt' which almost has a longer BUGS section than
description in the manpage. So we run with fdisk...

(This gets a bit verbose, but I'm a sysinstall weenie, so bear with me...)

	******* Working on device /dev/stripe/stripe0 *******
	parameters extracted from in-core disklabel are:
	cylinders=3303 heads=255 sectors/track=63 (16065 blks/cyl)

	Figures below won't work with BIOS for partitions not in cyl 1
	parameters to be used for BIOS calculations are:
	cylinders=3303 heads=255 sectors/track=63 (16065 blks/cyl)

	Do you want to change our idea of what BIOS thinks ?

(I have no clue what to answer here, so 'no' is the answer because I
couldn't tell you the acceptable values for this if you beat me senseless)

Strangely enough the values from previous fdisk runs are still there when I
continue... I've 'cleared' the plexes and stripes twice now... And if the
partition/slice confusion isn't complete enough, fdisk tells you about
partitions when the rest of your life in FreeBSD, you'll call them
'slices'...

	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 10474317 (5114 Meg), flag 80 (active)
	        beg: cyl 0/ head 1/ sector 1;
   	        end: cyl 651/ head 254/ sector 63
	Do you want to change it? [n] 

I answer 'n' and continue with "partition" 2...

	The data for partition 2 is:
	sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD)
	    start 10474443, size 42572187 (20787 Meg), flag 0
	        beg: cyl 652/ head 1/ sector 1;
	        end: cyl 229/ head 254/ sector 63
	Do you want to change it? [n]

Again, it's the size I want, so 'n' and we move on to "partition" 3 and 4,
which I don't use and finally end up with: 

	Partition 1 is marked active
	Do you want to change the active partition? [n] 

	We haven't changed the partition table yet.  This is your last chance.
	parameters extracted from in-core disklabel are:
	cylinders=3303 heads=255 sectors/track=63 (16065 blks/cyl)

	Figures below won't work with BIOS for partitions not in cyl 1
	parameters to be used for BIOS calculations are:
	cylinders=3303 heads=255 sectors/track=63 (16065 blks/cyl)

	Information from DOS bootblock is:
	1: sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD)
	    start 63, size 10474317 (5114 Meg), flag 80 (active)
	        beg: cyl 0/ head 1/ sector 1;
	        end: cyl 651/ head 254/ sector 63
	2: sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD)
	    start 10474443, size 42572187 (20787 Meg), flag 0
	        beg: cyl 652/ head 1/ sector 1;
	        end: cyl 229/ head 254/ sector 63
	3: <UNUSED>
	4: <UNUSED>
	Should we write new partition table? [n] 

Here I answer reasonably 'y' so my math gets written to disk. You'd think
that we would have a s0 and s1 (slice 0 and 1) somewhere to be able to
continue with the next bunch of monkeys, aka disklabel, aka bsdlabel (yeah
sounds like a Bond film here)... but, alas, we have a couple new mysterious
devices suddenly:

paracles:/stand#> ll /dev/stripe/.
total 0
crw-r-----  1 root  operator    4, 231 Jan 11 12:50 stripe0
crw-r-----  1 root  operator    4, 0x00010002 Jan  4 18:01 stripe0a
crw-r-----  1 root  operator    4, 0x00010003 Jan  4 18:01 stripe0c

with a date from a week ago! Really, the box is sync'd with ntpd... There's
probably an explanation somewhere.  Now we see what the *label programs
say (I know they're the same binary, fwiw) :

paracles:/stand#> disklabel /dev/stripe/stripe0
# /dev/stripe/stripe0:
8 partitions:
#        size   offset    fstype   [fsize bsize bps/cpg]
  a: 53067776       16    unused        0     0       
  c: 53067792        0    unused        0     0         # "raw" part, don't
edit


I have no stripes to label (partition).  Anybody want to tell me what/where
I'm doing/going wrong here?  I thought the magic of geom was that it was
"stackable, cool, <your_favorite_techie_adjectiv_here>".  What magic am I
missing?

'gpt' seems to agree with fdisk:

paracles:/stand#> gpt show /dev/stripe/stripe0
     start      size  index  contents
         0         1         MBR
         1        62         
        63  10474317      1  MBR part 165
  10474380        63         
  10474443  42572187      2  MBR part 165
  53046630     21162         


So what's broken here?  I could use a hint or two...


-- 
Yours truly,

Shaun D. Jurrens
shaun at shamz.net

Norway




More information about the freebsd-geom mailing list