gmirror problem on 5.3-R i386 (SOLVED)
Doug Poland
doug at polands.org
Fri Jan 14 19:52:29 PST 2005
On Sat, Jan 15, 2005 at 12:12:28AM +0100, Christian Hiris wrote:
> On Friday 14 January 2005 20:43, Doug Poland wrote:
> >
> > size=`fdisk ad6 | grep ', size ' | head -1 | sed -e 's;^.*size
> > \([0-9]*\).*$;\1;'` (echo "p 1 165 63 $size"; echo "a 1") | fdisk -v -B -f-
> > -i /dev/ad4
> >
> > That command returned: "improperly placed quotes ()". I set the value
> > of $size manually but it was some small number like 50000. I wrote it
> > to ad4 but the command on line 33 puked. So I simply issued the command
> > shown on line 32.
>
> I ever handled this by sysinstall. The above commands simply sets up the first
> slice (1) to a FreeBSD-type slice (165) starting at offset (63) with length
> ($size) of the first slice of ad6 and sets the active flag on the first slice
> (1).
>
> The command 'fdisk ad6' shows the size of the slice(s) on ad6. The same length
> should be used for ad4. I tried to run the above commands under /bin/sh:
>
> # size=`fdisk ad6 | grep ', size ' | head -1 | sed -e 's;^.*size
> \([0-9]*\).*$;\1;'`
>
> # (echo "p 1 165 63 $size"; echo "a 1")
> p 1 165 63 240107427
> a 1
>
> # (echo "p 1 165 63 $size"; echo "a 1") | fdisk -v -t -B -f -i mirror/mirror0
> ******* Working on device /dev/mirror/mirror0 *******
>
> So all the commands seem to work properly. Did you run this under /bin/sh?
>
Yes, I tried it under both tcsh and sh. I didn't take it apart the same
way you did however. Also, when size came up as 50000 (24MB) I knew
something wasn't write and didn't pursue that further. What did the
command:
fdisk -v -B -I /dev/ad4
do? It would seem my mirror is correct and consistent.
> > Question: On line 27 we issue the command to...
> > # instruct boot stage 2 loader on first disk to boot
> > # with the boot stage 3 loader from the second disk
> > # (mainly because BIOS might not allow easy booting from second ATA disk
> > # or at least requires manual intervention on the console)
> >
> > So how do I get rid of that boot.config file? Should I get rid of it?
>
> If you have a modern machine the BIOS (hopefully) can boot from every
> harddisks that has a partition/slice on it with the active flag set. I for
> myself use a bootmanager on every gmirror disk. You can install it with
> boot0cfg(8) or sysinstall (I only would use boot0cfg, if your mirror already
> has been set up).
>
So I can safely remove /boot.config? Otherwise wouldn't the boot stage
2 loader always then load boot stage 3 off disk 2?
> > Question: On line 25 we set swapoff=YES. Is this necessary if I'm going
> > to run 5-STABLE? What are the implications of having swap on a mirror
> > like this?
>
> No, if you run stable you don't need this:
> http://lists.freebsd.org/pipermail/cvs-all/2005-January/099589.html
> http://lists.freebsd.org/pipermail/cvs-all/2005-January/099590.html
>
> On 5-STABLE systems, younger than the cvsdate of the above commits,
> the /etc/rc.d/swap1 script runs on system shutdown and ensures that
> (eventually mirrored) swap devices are stopped before gmirror shuts down.
> Otherwise the mirror will brake. This is the reason why you need to set
> swapoff=YES. The recommend method to reboot your gmirrored system is
> 'shutdown -r now' instead of 'reboot'.
>
Great, thanks for all your help.
--
Regards,
Doug
More information about the freebsd-questions
mailing list