Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 2 Feb 2001 11:55:43 +1030
From:      Greg Lehey <grog@lemis.com>
To:        Tony Landells <ahl@austclear.com.au>
Cc:        Randy Primeaux <randy@Cloudfactory.ORG>, freebsd-questions@FreeBSD.ORG
Subject:   Re: installing onto vinum
Message-ID:  <20010202115543.A82163@wantadilla.lemis.com>
In-Reply-To: <200102012238.JAA00291@tungsten.austclear.com.au>; from ahl@austclear.com.au on Fri, Feb 02, 2001 at 09:38:52AM %2B1100
References:  <200102010816.AAA13008@relay.ultimanet.com> <200102012238.JAA00291@tungsten.austclear.com.au>

next in thread | previous in thread | raw e-mail | index | archive | help
On Friday,  2 February 2001 at  9:38:52 +1100, Tony Landells wrote:
> Hi Randy,
>
> Let's see if I can give Greg a break (having just been through
> this)...

Thanks.  A couple of comments, though.

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

It would also slow down configuration updates, since the configuration
gets written to each drive.  There should never be more than one drive
per spindle.  That's precisely why we have subdisks as well.

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

Correct.

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

In fact, in my original instructions I specified single user mode so
that you wouldn't need to mount everything.  In particular, you'll
probably have trouble changing the swap partition if it's mounted.
You should do, anyway.

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

Partitions b, d and e look to me as if you have taken the 265 sectors
off the beginning of partition e rather than the end of partition b.
I suspect you just allocated 1048841 sectors to swap on the initial
install, rather than the more logical 1048576.  For other readers,
it's very important that you don't move the start of any of the file
system partitions.  You can pretty much do what you want with swap.

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

All correct, but I'd be inclined to specify it exactly.

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

Hmm, what have you seen here?  About the only thing vinum objects to
(not gets confused by) is if you try to change the name of the drive.
This is a feature, not a bug, designed to stop you from accidentally
creating a drive on the wrong spindle, and you can get round it with
"create -f configfile".

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

Yes, that one's in the man page.

Thanks for the description, it saved me a lot of time.

Greg
--
When replying to this message, please copy the original recipients.
If you don't, I may ignore the reply.
For more information, see http://www.lemis.com/questions.html
Finger grog@lemis.com for PGP public key
See complete headers for address and phone numbers


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?20010202115543.A82163>