Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 01 Feb 2001 17:44:04 -0800
From:      Randy Primeaux <randy@Cloudfactory.ORG>
To:        Tony Landells <ahl@austclear.com.au>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: installing onto vinum 
Message-ID:  <200102020228.SAA04507@relay.ultimanet.com>
In-Reply-To: Message from Tony Landells <ahl@austclear.com.au>  of "Fri, 02 Feb 2001 09:38:52 %2B1100." <200102012238.JAA00291@tungsten.austclear.com.au> 

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

Tony,
   It will be several hours before I can resume testing.  In the
meantime, I have a question.

Per `man 8 vinum`:
     vinum uses the first 265 sectors on each partition for configuration in-
     formation, so the maximum size of a subdisk is 265 sectors smaller than
     the drive.

My new interpretation is that I should reserve 265 sectors per subdisk
for configuration information.  Following method one, where each
subdisk overlays a partition, I might choose to layout /var, /usr, and
/home initially 265s larger, then shrink each of them.

Part of my confusion stems from the fact that Greg's example provided
for two subdisks, and I chose to test with three.

Greg's example:
>
> 6.  Carefully calculate the offsets and the lengths of the file
>     systems.  Create a Vinum configuration file something like this:
>
>     drive root dev /dev/ad0s1d
>     volume usr
>      plex org concat
>       sd length 256m
>     volume home
>      plex org concat
>       sd length 8g driveoffset 524553s
>
>     The lengths and offsets need to be exact, of course.  The best way
>     to get offset and length is from the last 8 lines of disklabel
>     ouput.

My first interpretation for three subdisks:
>
> 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

So on to my query.  Using this example, should my second vinum subdisk
actually be 8388608s - 265s = 8388343s, where the original 4.2BSD
partition was 8388608s, thereby reserving 265s per each subdisk?

If not, then why?

At this point, when I resume testing, I'll need to modify /vinum.cfg
and replace keyword `dev` with `device`, then try again.

BTW, I just read Greg's recent response, so I am taking that into
consideration as well.  Thank you for the response.  A few comments
follow, below.


Tony Landells writes:
> 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.)

Yes, this example would be clearer if I showed this "Before" table,
and an "After" table.

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

Ok, Tony, I'll try that.  I feared hitting this error again, based
upon a mis-interpretation on my part: 
disklabel: ioctl DIOCWDINFO: open partition would move or shrink

As an aside, I had commented out partitions e, f, and g on my first
attempt.  On my second attempt I left them intact, and added d:.

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

--
Randy Primeaux
randy@cloudfactory.org         http://cloudfactory.org/~randy/
tranze@hyperreal.org		http://hyperreal.org/~tranze/


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?200102020228.SAA04507>