Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 02 Feb 2001 09:38:52 +1100
From:      Tony Landells <ahl@austclear.com.au>
To:        Randy Primeaux <randy@Cloudfactory.ORG>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: installing onto vinum 
Message-ID:  <200102012238.JAA00291@tungsten.austclear.com.au>
In-Reply-To: Your message of "Wed, 31 Jan 2001 23:32:52 -0800." <200102010816.AAA13008@relay.ultimanet.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
Hi Randy,

Let's see if I can give Greg a break (having just been through this)...

> It's not clear to me how to properly calculate the sector offset and
> sizes, as I do not have a clear example to follow.  Does the vinum
> partition overlay all of the original var usr and home plus the last
> 265 sectors of swap?

Yes.

Basically there are two ways to use your disk space with vinum.  The
first, not so good way, is to do all your partitioning, and then define
each partition as a vinum drive.  I assume this would then require 265
sectors for vinums configuration data on each partition, which is pretty
wasteful.

The second method is just to give vinum a big slab of disk space, and
then slice it up within vinum.  This means that there is only one set
of vinum configuration (for that space).  The other advantage is that
you can make more slices on a large disk because vinum isn't limited
to the a through h stuff.

Since sysinstall doesn't understand vinum, Greg's "cheat" does all the
installs on "standard" slices, and then sets up the vinum configuration
to match.  But since vinum can only allocate space it controls, the
vinum slice you create with disklabel needs to overlap the other slices
you want to configure under vinum.

So onto the specifics of what you've done...

> I start out with the following disklabel:
> 
> 8 partitions:
> #        size   offset    fstype   [fsize bsize bps/cpg]
>   a:   524288        0    4.2BSD     1024  8192    16   # (Cyl.    0 - 32*)
>   b:  1048841   524288      swap                        # (Cyl.   32*- 97*)
>   c: 90060327        0    unused        0     0         # (Cyl.    0 - 5605*)
>   e:   524288  1573129    4.2BSD     1024  8192    16   # (Cyl.   97*- 130*)
>   f:  8388608  2097417    4.2BSD     1024  8192    16   # (Cyl.  130*- 652*)
>   g: 79574302 10486025    4.2BSD     1024  8192    16   # (Cyl.  652*- 5605*)
> 
> 
> This is a test layout, in which I want / and swap to be static, and
> /var, /usr, /home to be on vinum, to be mirrored on ad5 when I am
> done.
> 
> My intended layout is as such:
> ad4s1a /          256M
> ad4s1b swap   1048841
> ad4s1e /var       256M
> ad4s1f /usr         4G
> ad4s1g /home 79574302

Well, this is actually the way you allocated it originally (you haven't
taken the vinum space out of swap here), but I know what you meant.  (I
only mention it for others following the example.)

> I booted a release CD, then operated the fixit floppy so I had vi
> available without mounting /usr.  I then changed the disklabel as follows.

A safe way to go, though I found that you can do pretty much everything
in single user mode after executing "mount -a".  Really.

> 8 partitions:
> #        size   offset    fstype   [fsize bsize bps/cpg]
>   a:   524288        0    4.2BSD     1024  8192    16   # (Cyl.    0 - 32*)
>   b:  1048576   524288      swap                        # (Cyl.   32*- 97*)
>   c: 90060327        0    unused        0     0         # (Cyl.    0 - 5605*)
>   d: 88487463  1572864     vinum                        # (Cyl.   97*- 5605*)
>   e:   524288  1573129    4.2BSD     1024  8192    16   # (Cyl.   97*- 130*)
>   f:  8388608  2097417    4.2BSD     1024  8192    16   # (Cyl.  130*- 652*)
>   g: 79574302 10486025    4.2BSD     1024  8192    16   # (Cyl.  652*- 5605*)

So far so good.  I assume you confirmed that this was the label on the disk?

> I modified /etc/fstab following your example above, with
> /dev/vinum/var added.
> 
> I then ran `vinum create vinum.cfg`
> I got:
> 
> vinum: loaded
>   3: drive root dev /dev/ad4s1d
> **3 Drive root, invalid keyword: dev: Invalid argument
> 
> 
> vinum.cfg:
> drive root dev /dev/ad4s1d
>  volume var
>   plex org concat
>    sd length 256m driveoffset 265s
>  volume usr
>   plex org concat
>    sd length 4g driveoffset 1048841s
>  volume home
>   plex org concat
>    sd length 79574302s driveoffset 8913161s
> 
> 
> does "drive root dev /dev/ad0s1d" need to be `device` ?

Yes.

Some other comments...  Given that you specified all the sizes in
"user friendly" form when you did the initial slicing, I tend to
use the (final) disklabel as the basis for my vinum config and specify
all the lengths in sectors.  It's really just paranoia, so from:

8 partitions:
#        size   offset    fstype   [fsize bsize bps/cpg]
  a:   524288        0    4.2BSD     1024  8192    16   # (Cyl.    0 - 32*)
  b:  1048576   524288      swap                        # (Cyl.   32*- 97*)
  c: 90060327        0    unused        0     0         # (Cyl.    0 - 5605*)
  d: 88487463  1572864     vinum                        # (Cyl.   97*- 5605*)
  e:   524288  1573129    4.2BSD     1024  8192    16   # (Cyl.   97*- 130*)
  f:  8388608  2097417    4.2BSD     1024  8192    16   # (Cyl.  130*- 652*)
  g: 79574302 10486025    4.2BSD     1024  8192    16   # (Cyl.  652*- 5605*)

I'd have:

drive root device /dev/ad0s1d

volume var
	plex org concat
		sd length 524288s
volume usr
	plex org concat
		sd length 8388608s
volume home
	plex org concat
		sd length 79574302s

The "driveoffset 265s" for the first sub-disk is the default, and for
all the following sub-disks the space is allocated sequentially, so
unless there is an error creating one of the sub-disks, things will
be allocated correctly.  Since home extends to the end of the partition
you could specify the length as "0" (zero).

A couple of other points:

	1. If you mess up after you've started doing the vinum stuff
	and want to start again, I've found that occasionally vinum
	gets confused by old data on the disk.  If you're starting
	again (including the fdisk and disklabel stuff), you may
	also want to nuke any old vinum information after you've
	finished the disklabel setup with

		"dd if=/dev/zero of=/dev/ad0s1d count=265"

	2. When you create and attach the second plex for a mirror
	(assuming that's where you're going), it (and its sub-disks)
	will come up as (apparently) faulty.  This only indicates that
	it doesn't have current data on and can't be used.  Once you
	"start" the sub-disks they will copy the data from the first
	plex, and when that's finished the plex will come up.

Hang in there, it gets easier!

Tony
-- 
Tony Landells					<ahl@austclear.com.au>
Senior Network Engineer				Ph:  +61 3 9677 9319
Australian Clearing Services Pty Ltd		Fax: +61 3 9677 9355
Level 4, Rialto North Tower
525 Collins Street
Melbourne VIC 3000
Australia




To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




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