Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 1 Nov 2004 04:15:47 +0100
From:      Christian Hiris <4711@chello.at>
To:        freebsd-questions@freebsd.org
Cc:        "Matthias F. Brandstetter" <haimat@lame.at>
Subject:   Re: howto software raid under FreeBSD?
Message-ID:  <200411010415.47282.4711@chello.at>
In-Reply-To: <200410312333.44999.haimat@lame.at>
References:  <200410292355.43148.haimat@lame.at> <200410312234.38746.Emanuel.Strobl@gmx.net> <200410312333.44999.haimat@lame.at>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sunday 31 October 2004 23:33, Matthias F. Brandstetter wrote:
> Any docs for gmirror except man page out there anywhere? Something like how
> to use it for root file system, how to convert a non-gmirror system,
> kernel configuration etc.

Short time ago there was a thread on the current list:
http://lists.freebsd.org/pipermail/freebsd-current/2004-October/thread.html#39904

If you use the whole disk as provider and your disk has left free 512 bytes 
after the end of the last slice, gmirror setup works very easy and fast (no 
need to use dump/restore or dd):

- Boot into the live-filesystem.
- Do a 'gmirror load' and label your "old" disk with 'gmirror label -v ...'.
- Mount the (now mirrored) / partition on /mnt.
- echo 'geom_mirror_load="YES"' >> /mnt/boot/loader.conf
- echo 'swapoff="YES"' >> /mnt/etc/rc.conf
- Edit /mnt/etc/fstab to reflect the newly created mirror devices.
- Reboot. 
- Add a second disk to the mirror: 'gmirror insert -v ...'.   
- If you use gdm replace 'reboot' by 'shutdown -r now'.

This also works for an already existing ataraid raid1 array, you just need to 
delete the mirror before you start with the gmirror setup. 

That's how gmirror converted my devices when I a command like: 
'gmirror label -v -b split -s 4096 mirror0 ad4':

   slice  /dev/ad4s1   -->  /dev/mirror/mirror0s1
   /      /dev/ad4s1a  -->  /dev/mirror/mirror0s1a
   swap   /dev/ad4s1b  -->  /dev/mirror/mirror0s1b
   raw                 -->  /dev/mirror/mirror0s1c
   /usr   /dev/ad4s1d  -->  /dev/mirror/mirror0s1d
   /home  /dev/ad4s1e  -->  /dev/mirror/mirror0s1e

If you have a more complex slice/partition setup, it's a good idea to do at 
least a fine backup of your disklabels before you start conversion. 

HTH,
ch 

-- 
Christian Hiris <4711@chello.at> | OpenPGP KeyID 0x3BCA53BE 
OpenPGP-Key at hkp://wwwkeys.eu.pgp.net and http://pgp.mit.edu



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200411010415.47282.4711>