CCD mirroring setup difficulties: eventual success & micro HOWTO I was trying to set up a simple mirror (ie, software raid 1) under
OpenBSD 3.8 using CCD and the generic kernel, mirroring the entirety of
two one-partition disks. This should have been bone-simple but it was
pretty frustrating. The various net HOWTOs on how to set up a mirror
with ccd/ccdconfig were less than fully informative (and in some places
just plain wrong). And it doesn't help when mis-specifying the
parameters to simple commands like newfs will give you instant kernel
panics and crash your system hard...
I'm not sure why this area of the system's not as robust as everything
else in OpenBSD, but in case it helps others, here's what I found I had
to do to not get the usual failures and error messages and to make it
work. (Google bait follows: " inappropriate file type or format /
CCDIOCSET / error 22 on component 0 / device not configured / write
error ")
My scheme:
0) Obviously, get the bios to recognize the two disks (my fault in this
case, since I had to find the semi-hidden setting to turn on the
secondary IDE channel in the BIOS). They should both be seen by the
kernel at boot. FWIW, I've got two Seagate 40GB ide drives, wd0 and
wd1.
1) fdisk -i wd0 (ditto for wd1)
Writes a default partition table on each drive with one slice taking up
the whole drive.
2) disklabel -e -d wd0 (ditto for wd1)
This gets you an "a" partition on each diskthat takes up the whole disk
(minus the first cylinder). Change the "fstype" field in this first
partition from "unused" to "4.2BSD". Ignore the "c" partition that
represents the whole physical disk.
3) newfs wd0a (ditto for wd1a)
Make an identical file system on each drive *separately*, not on the
combined mirror. (Don't ask me why, all I know is this what made it
work for me.) Use whatever newfs options appeal to you, as long as both
drives are configured identically.
4) edit /etc/ccd.conf:
Mine reads:
ccd0 16 CCDF_MIRROR /dev/wd0a /dev/wd1a
(No, I don't know what the interleave factor of "16" does for a mirror
set, either. I just left it alone.)
5) ccdconfig -C
This creates your mirror. Check it's there with ccdconfig -v -g.
In my case, I got a new disk, /dev/ccd0c, for my troubles.
6) mount the mirror set and edit /etc/fstab so it's permanent:
For me, this was done with "mount /dev/ccd0c /archive". My final
/etc/fstab entry looks like:
/dev/ccd0c /samba ffs rw,nodev,nosuid,noexec 1 2
(of course you may have different mount options than these...this is my
archive backup disk set so I don't expect to be putting executables
there)
Hope this helps, but if not post your questions to the group, not to me
- all I know about the subject I've just written here. Good luck.
-jon- |