From owner-freebsd-questions Tue Jan 30 23:43:20 2001 Delivered-To: freebsd-questions@freebsd.org Received: from relay.ultimanet.com (relay.ultimanet.com [205.179.129.1]) by hub.freebsd.org (Postfix) with ESMTP id 4CCA137B6C8 for ; Tue, 30 Jan 2001 23:42:59 -0800 (PST) Received: from Cloudfactory.ORG (cloudfactory.org [205.179.129.18]) by relay.ultimanet.com (8.9.3/8.9.3) with ESMTP id AAA17134; Wed, 31 Jan 2001 00:25:50 -0800 Message-Id: <200101310825.AAA17134@relay.ultimanet.com> To: Greg Lehey Cc: Tony Landells , freebsd-questions@FreeBSD.ORG Subject: Re: installing onto vinum In-Reply-To: Message from Greg Lehey of "Wed, 24 Jan 2001 17:01:57 +1030." <20010124170157.X37060@wantadilla.lemis.com> Date: Tue, 30 Jan 2001 23:42:39 -0800 From: Randy Primeaux Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Greg, I attempted to follow this process using the following on a pair of IBM DTLA-307045 (just setting up the first one). I think I may have mis-calculated the offset or size field(s) in the new disklabel. ad4s1a / 256M ad4s1b swap 1048841 ad4s1e /var 256M ad4s1f /usr 4G ad4s1g /home 79574302 I attempted to use `disklabel -e ad4s1` to modify the disklabel as such: 8 partitions: # size offset fstype [fsize bsize bps/cpg] a: 524288 0 4.2BSD 1024 8192 16 b: 1048576 524288 swap c: 90060327 0 unused 0 0 d: 88487463 1572864 vinum I got an error at this point: disklabel: ioctl DIOCWDINFO: open partition would move or shrink I continued to follow the list, not realizing that the new disklabel had not been written. I got a second set of errors in vinum, which i did not capture. I later got a third set of errors in vinum: vinum: var.p1 is faulty vinum: usr.p1 is faulty vinum: home.p1 is faulty How do I obtain correct calculations for the new disklabel? Greg Lehey writes: > 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 Pa > ss# > /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 > -- 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