partitioning and labeling geom devices

Brooks Davis brooks at one-eyed-alien.net
Tue Jan 11 08:10:42 PST 2005


On Tue, Jan 11, 2005 at 12:00:12PM +0100, Shaun Jurrens wrote:
> 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...

Ideally you should use gpt, fdisk+bsdlabel are headed the way of to
dodo (though they will take a long time to get there).

> 	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)

You probalby need to answer yes yere.  You don't care what the BIOS
might think, you care what freebsd thinks.

> 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.

Times in /dev are irrelevent, ignore them.  I suspect the problem is
that you have an entierly bogus MBR partion table on the disk and
now you've modified it, possiably exposing a bogus bsdlabel.  Before
attempting to label a disk, it's generally best to do something like:

dd if=/dev/zero of=/dev/<disk> count=64

That way you've nuked the MBR partition table and any bsdlabel labels in
the first slice.

You might take a look at the sysutils/diskprep port.  It's a config file
driven disk labeler.

-- Brooks

-- 
Any statement of the form "X is the one, true Y" is FALSE.
PGP fingerprint 655D 519C 26A7 82E7 2529  9BF0 5D8E 8BE9 F238 1AD4
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-geom/attachments/20050111/c71c81a0/attachment.bin


More information about the freebsd-geom mailing list