Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 20 May 2001 08:56:03 +0930
From:      Greg Lehey <grog@lemis.com>
To:        Drew Tomlinson <drewt@writeme.com>
Cc:        "FreeBSD Questions (E-mail)" <freebsd-questions@FreeBSD.org>
Subject:   Re: www.vinumvm.org
Message-ID:  <20010520085601.K64759@wantadilla.lemis.com>
In-Reply-To: <BA5D0CE1CBB2D411B6AA00A0CC3F02390AF9EF@ldcmsx01.lc.ca.gov>; from drewt@writeme.com on Thu, May 17, 2001 at 02:45:02PM -0700
References:  <20010516114223.C35292@wantadilla.lemis.com> <BA5D0CE1CBB2D411B6AA00A0CC3F02390AF9EF@ldcmsx01.lc.ca.gov>

next in thread | previous in thread | raw e-mail | index | archive | help
> X-Mailer: Microsoft Outlook CWS, Build 9.0.2416 (9.0.2911.0)

[Format recovered--see http://www.lemis.com/email/email-format.html]

Your MUA wraps quoted text incorrectly.

On Thursday, 17 May 2001 at 14:45:02 -0700, Drew Tomlinson wrote:
> On  Tuesday, May 15, 2001 7:12 PM, Greg Lehey wrote:
>
> [snip]
>
>>>>> I am trying to setup vinum on my 4.3 system for the first time and
>>>>> need some help as I'm not understanding this very well.
>>>>> Specifically, I have 3 4.3G drives with a 100M root
>> partition on the
>>>>> first and a 192M swap partition on the other two.  The
>> remainder of
>>>>> the first drive has a second partition mounted as /usr.  What I
>>>>> would really like to have to keep the 100M root partition (only
>>>>> because ASFAIK one can't use vinum on root) and have a
>> striped 384M
>>>>> swap and the remainder all of the space on all of the
>> drives as one
>>>>> large striped partition mounted as /usr.  Is this possible?
>>>>
>>>> Only if all the Vinum drives (partitions) are thee same size.
>>>
>>> How would I do that?  Take a backup of /usr, then delete it, create
>>> my Vinum drive, and then restore it?  Or is there a better way?
>>> What "gotchas" might I come across?
>>
>> Well, in fact, all you need is to have same-sized subdisks.  But if
>> you only want one volume, you'd have space left over if the drives
>> weren't all the same size.
>>
>> The trick way to turn /usr into a Vinum volume is to make swap 265
>> sectors longer when installing, then place /usr immediately after
>> swap.  After installation, reboot in single user mode, shorten swap by
>> 265 sectors and make an overlapping Vinum drive start there.  The real
>> /usr will then be at the beginning of the subdisk space, so you just
>> need to define a plex with the same location as the /usr partition.
>> I'll write this up in more detail some day.
>
> I don't know much about drive geometry but I decided to give this a try.  I want
> a 100M root partition, 384M of total swap space, and the rest in a large stripe
> set for /usr.  I have 3 identical 4.3G drives in this system and labeled them as
> follows:
>
> da0s1:
> #        size   offset    fstype   [fsize bsize bps/cpg]
>   a:   204800        0    4.2BSD     1024  8192    16   # (Cyl.    0 - 12*)
>   b:   127232   204800      swap                        # (Cyl.   12*- 20*)
>   c:  8380080        0    unused        0     0         # (Cyl.    0 - 521*)
>   e:  8048048   332032    4.2BSD     1024  8192    16   # (Cyl.   20*- 521*)
>
> da1s1 & da2s1:
> #        size   offset    fstype   [fsize bsize bps/cpg]
>   b:   331776        0      swap                        # (Cyl.    0 - 20*)
>   c:  8380080        0    unused        0     0         # (Cyl.    0 - 521*)
>   e:  8048304   331776    4.2BSD                        # (Cyl.   20*- 521*)
>
> ... I ... was able to shorten swap on da0 but because da0s1e is
> mounted as /usr, I can't lengthen it and change the fstype to
> "vinum" 

A good thing too.  If you did, you'd have effectively sawn off the
branch you were sitting on.

> It now looks like this:
>
> #        size   offset    fstype   [fsize bsize bps/cpg]
>   a:   204800        0    4.2BSD     1024  8192    16   # (Cyl.    0 - 12*)
>   b:   126976   204800      swap                        # (Cyl.   12*- 20*)
>   c:  8380080        0    unused        0     0         # (Cyl.    0 - 521*)
>   e:  8048048   332032    4.2BSD     1024  8192    16   # (Cyl.   20*- 521*)

Watch what I said above:

>> After installation, reboot in single user mode, shorten swap by 265
>> sectors and make an overlapping Vinum drive start there.

You shouldn't change the /usr partition.   Add a new partition.  In
this example,

>   h:  8048313   331767     vinum     1024  8192    16   # (Cyl.   20*- 521*)

This overlaps the /usr file system.

> I did change the disklabel on both da1 and da2.  They are the same and look like
> this:
>
> #        size   offset    fstype   [fsize bsize bps/cpg]
>   b:   331776        0      swap                        # (Cyl.    0 - 20*)
>   c:  8380080        0    unused        0     0         # (Cyl.    0 - 521*)
>   e:  8048304   331776     vinum                        # (Cyl.   20*- 521*)
>
> And when I get the partition tables right, I plan to use this configuration file
> to create my vinum volume for /usr:
>
> drive disk1 device /dev/da0e

  drive disk1 device /dev/da0h

> drive disk2 device /dev/da1e
> drive disk3 device /dev/da2e
> volume user
>   plex org striped 300k
>     sd length 3929m drive disk1
>     sd length 3929m drive disk2
>     sd length 3929m drive disk3

This volume is completely wrong.  You already have a /usr file system,
and it's a single contiguous partition.  Vinum doesn't move data when
you create things, so you need to describe what's there, not what you
want.

> So where do I go from here?  Am I close?  I suspect that I need to
> change the label on da0s1e to fstype vinum, add 256

Use 256 and everything will go wrong.  The value is 265.

> to the size, and subtract 256 from the offset.  Then I can create my
> vinum volume.  Is this correct?  If so, how can I edit the partition
> that /usr lives on.  I can't when /usr is mounted and I can't run
> the disklabel utility when /usr isn't mounted.

You can't change the size or the organization of the partition like
this.  You'll either have to live with the partition, or change it
later.  For the former,

drive 1 device /dev/da0h
drive 2 device /dev/da1e
drive 3 device /dev/da2e
volume usr
   plex org concat
     sd length 8048048s offset 265s drive 1
volume foo
  plex org striped 297k
     sd length 0m drive 2
     sd length 0m drive 3

Note the exact specification of the length and offset of the subdisk
usr.p0.s0: this ensures that you put the subdisk over the correct
data.  The second volume can be anything you want.  Since both drives
are the same size, and you appear to want to use them all for the one
volume, just specify length 0m.

I've also changed the names of the drives.  This is cosmetic, of
course, but it highlights the fact that they're not disks.

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?20010520085601.K64759>