From owner-freebsd-questions Tue Jan 23 22:32:22 2001 Delivered-To: freebsd-questions@freebsd.org Received: from wantadilla.lemis.com (wantadilla.lemis.com [192.109.197.80]) by hub.freebsd.org (Postfix) with ESMTP id 5E86F37B401 for ; Tue, 23 Jan 2001 22:32:00 -0800 (PST) Received: by wantadilla.lemis.com (Postfix, from userid 1004) id 3091B6AB73; Wed, 24 Jan 2001 17:01:57 +1030 (CST) Date: Wed, 24 Jan 2001 17:01:57 +1030 From: Greg Lehey To: Tony Landells Cc: freebsd-questions@freebsd.org Subject: Re: installing onto vinum Message-ID: <20010124170157.X37060@wantadilla.lemis.com> References: <200101240527.QAA14731@tungsten.austclear.com.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <200101240527.QAA14731@tungsten.austclear.com.au>; from ahl@austclear.com.au on Wed, Jan 24, 2001 at 04:27:21PM +1100 Organization: LEMIS, PO Box 460, Echunga SA 5153, Australia Phone: +61-8-8388-8286 Fax: +61-8-8388-8725 Mobile: +61-418-838-708 WWW-Home-Page: http://www.lemis.com/~grog X-PGP-Fingerprint: 6B 7B C3 8C 61 CD 54 AF 13 24 52 F8 6D A4 95 EF Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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