Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 24 Jan 2001 17:01:57 +1030
From:      Greg Lehey <grog@lemis.com>
To:        Tony Landells <ahl@austclear.com.au>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: installing onto vinum
Message-ID:  <20010124170157.X37060@wantadilla.lemis.com>
In-Reply-To: <200101240527.QAA14731@tungsten.austclear.com.au>; from ahl@austclear.com.au on Wed, Jan 24, 2001 at 04:27:21PM %2B1100
References:  <200101240527.QAA14731@tungsten.austclear.com.au>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wednesday, 24 January 2001 at 16:27:21 +1100, Tony Landells wrote:
> I'm in the process of setting up a number of FreeBSD boxes and I'd
> like to have them all mirroring with vinum.
>
> What I can't work out is how to get vinum up and running with my
> mirrors for /var, /usr, etc. before I start installing packages.
>
> I've tried using the 2nd CD and doing the fdisk and disklabel from
> the command line, but while my fdisk seems to set the correct label
> on the disks (as shown by disklabel -r), I can't get it to update
> the "in core" data, which I think may then be upsetting vinum.
> Perhaps I just haven't done things in the right order...
>
> At the moment my best option seems to be to install on one disk,
> and then work through the boot disks for the other systems by
> installing them as a second disk, setting everything up and
> installing packages on it, then putting it back in the box it
> belongs to.
>
> There must be a better way.  I hope.

The "better way" is obviously to make sysinstall (or its successor)
Vinum-aware.  In the meantime, however, you can do this:

1.  Create the root file system normally.
2.  Next, create a swap partition *exactly* 265 (no, that's not a
    typo, 265, not 256) sectors larger than you want.
3.  Create all following file systems normally.
4.  Install FreeBSD.
5.  When you have finished the install, reboot to single user mode and
    use disklabel -e to shrink the size of the swap partition by 265
    sectors.  Create a Vinum partition starting from the new end of
    the swap partition and going to the end of the drive, overlaying
    all the file system partitions.  After that you can go into
    multi-user mode if you want.
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 driveoffset 265s
    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
    output.

7.  Change your /etc/fstab to look something like this:

     Device                Mountpoint      FStype  Options         Dump    Pass#
     /dev/ad0s1b           none            swap    sw              0       0
     /dev/ad0s1a           /               ufs     rw              1       1
     /dev/vinum/usr        /usr            ufs     rw              1       1
     /dev/vinum/home       /home           ufs     rw              1       1
     /dev/ad0s1e           /usr            ufs     rw,noauto       1       1
     /dev/ad0s1f           /home           ufs     rw,noauto       1       1

    The duplicate allocations are deliberate in case there are
    problems.

8.  Create the Vinum objects ("vinum create configfile").  This
    doesn't change anything in the file systems, which can be mounted
    at the time.

9.  Check you did it right by doing 'fsck -n /dev/vinum/usr', etc.
    You will get some errors, which you can ignore.  They come from
    the fact that fsck will be reading from disk, while there's
    modified metadata in buffer cache.  What you don't want to see are
    messages saying it can't find the superblock, which would indicate
    that you miscalculated the offsets.

10. Reboot.  You should come up running from Vinum.  If you have
    trouble, mount the disk partitions instead.

This method assumes you don't want swap under Vinum control.  If you
do, you'll need to move the swap partition 265 sectors further and
have the Vinum drive start immediately after the root file system.

Let me know how this works; normally I try these things out, but today
I had a power supply catch fire and kill the memory on the test box I
would have used, and I won't have it fixed in 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?20010124170157.X37060>