Setting up RAID1 with gmirror
Andrew Lewis
al at xms.co.za
Thu Jan 27 05:03:08 PST 2005
Got a live system I'm trying to setup RAID1 on, using gmirror. This is my first attempt at such a thing.
Two hard-disks: ad0 has a UFS2+softupdates formatted / partition and a swap partition. ad2 is a clean disk.
I've been following the instructions @:
http://people.freebsd.org/~rse/mirror/
I used 'Approach 1' from the instructions @ the URL above:
dd if=/dev/zero of=/dev/ad2 bs=512 count=79
gmirror label -v -n -b round-robin gm0 /dev/ad2
gmirror load
fdisk -v -B -I /dev/mirror/gm0
bsdlabel -w -B /dev/mirror/gm0s1
bsdlabel -e /dev/mirror/gm0s1
newfs -U /dev/mirror/gm0s1a
mount /dev/mirror/gm0s1a /mnt
dump -L -0 -f- / | (cd /mnt; restore -r -v -f-)
cp -p /mnt/etc/fstab /mnt/etc/fstab.orig
sed -e 's/dev\/ad0/dev\/mirror\/gm0/g' </mnt/etc/fstab.orig >/mnt/etc/fstab
echo 'swapoff="YES"' >>/mnt/etc/rc.conf
echo 'geom_mirror_load="YES"' >>/mnt/boot/loader.conf
echo "2:ad(2,a)/boot/loader" >/boot.config
reboot.
Machine no longer boots with F1, booted with F5 (Second disk) fine; I neglected to look @ what it was complaining about. Assuming this wasn't supposed to happen?
Seems GEOM is working, so now I continue with the instructions for joining the first disk to the mirror.
dd if=/dev/zero of=/dev/ad0 bs=512 count=79
gmirror configure -a gm0
-bash-2.05b# gmirror insert gm0 /dev/ad0
Provider ad0 too small.
^- Oops.
Where did I go wrong? And what should I do now to get it working properly without killing everything? :) Seems I nuked swap, which is fine, because this machine can handle without it...
*sigh* :)
Thanks for the help in advance.
-AL.
More information about the freebsd-questions
mailing list