Aha... I manage to do the basic installation using raid1(mirror). As attach was the method that I use :) Will put it in my page later.
Any comment are welcome :) On 10/24/05, Ken Gunderson <[EMAIL PROTECTED]> wrote: > On Sun, 23 Oct 2005 22:42:35 -0400 > Nick Holland <[EMAIL PROTECTED]> wrote: > > > Ken Gunderson wrote: > > > Greets: > > > > > > I've been exploring root on raidframe w/a pair of mirrored disks. Once > > > I bring something like this up I then go ahead and do my best to break > > > it, test out recovery scenarios, etc. > > > > smart. VERY smart. :) > > Thnx;-) > > > > Which brings me to the question > > > at hand. > > > > > > Following a hard failure the system must perfomr a parity check on > > > the raid volume(s) prior to fsck'ing and completing booting. Depending > > > on disk size, speed, and number of volumes, this can easly require a > > > few hours of wait time before being able to bring the system back > > > online. > > > > > > Now my question is whether there is some way to shorten > > > this delay that I'm missing? > > > > yes. > > RAIDframe as absolutely little as you NEED to. > > > > Soft-mirroring (or hardware-mirroring, for that matter) more than you > > absolutely need to is foolish. > > > > Let's look at a simple mail server for an example (since you didn't > > describe your app): > > The application in this case is a routing firewall/proxy server for a 3 > legged network configuration. Resources to implement a carp setup are > not available. The objective for the system: > > 1) to be as self healing as possible > 2) minimize downtime resulting from this single point of failure failing > 3) maximiz capability for remote system management > 4) minimizing requrement for assistance from on site personnel. > > /home, /tmp and /var/tmp are inconsequential. No users on this system. > But the system will be doing smtp relaying and in the unlikely event > some malicious type was able to induce obsd to crash I'd like to have > the packets logged... Logging to remote machine is good practice but not > an option at present. So we've got a large /var on this puppy. Hence > the long wait. Otherwise if just for perimeter firewall/router a > diskless setup would probably be best. > > I've done some testing w/the /etc/rc backgound parity hack and the box > comes up after a hard failure in about 1/2 hour. Which isn't too bad > compared to the 1.5 -2 hours otherwise. > > For the sake of experimentation the raid conf is presently: > > 512M / mirror > 2048M swap stripped > couple hundred gigs mirrored for everything else. > > Thanks for your insights. Appreciate the constructive input. > > -- > Best regards, > > Ken Gunderson > > Q: Because it reverses the logical flow of conversation. > A: Why is putting a reply at the top of the message frowned upon? > -- Thanks & Regards, Ikmal aka EvoIVGSR http://www.leakage.org/ http://root.justdied.com/mylife/ http://www.openbsd.org.my/ http://mirrors.mybsd.org.my/ OpenBSD 3.7 RAID ================== 1 - Install as minimal OpenBSD. Only install this 4 main file. [x] bsd [x] bsd.rd [x] base37.tgz [x] etc37.tgz [x] comp37.tgz And install openbsd as usual. Here by OpenBSD disk structure. # disklabel wd0 # using MBR partition 3: type A6 off 63 (0x3f) size 80292807 (0x4c92bc7) # /dev/rwd0c: 16 partitions: # size offset fstype [fsize bsize cpg] a: 210.1M 0.0M 4.2BSD 2048 16384 328 # Cyl 0*- 426 c: 39205.7M 0.0M unused 0 0 # Cyl 0 - 79655 Note: For 1st slice I only use 210Mb. 2 - Disk layout # fdisk wd0 Disk: wd0 geometry: 4998/255/63 [80292870 Sectors] Offset: 0 Signature: 0xAA55 Starting Ending LBA Info: #: id C H S - C H S [ start: size ] ------------------------------------------------------------------------ 0: 00 0 0 0 - 0 0 0 [ 0: 0 ] unused 1: 00 0 0 0 - 0 0 0 [ 0: 0 ] unused 2: 00 0 0 0 - 0 0 0 [ 0: 0 ] unused *3: A6 0 1 1 - 4997 254 63 [ 63: 80292807 ] OpenBSD # fdisk wd1 Disk: wd1 geometry: 4998/255/63 [80292870 Sectors] Offset: 0 Signature: 0xAA55 Starting Ending LBA Info: #: id C H S - C H S [ start: size ] ------------------------------------------------------------------------ *0: 07 0 1 1 - 2549 254 63 [ 63: 40965687 ] HPFS/QNX/AUX 1: 0F 2550 0 1 - 4497 254 63 [ 40965750: 31294620 ] Extended LBA 2: 77 4498 0 1 - 4996 254 63 [ 72260370: 8016435 ] <Unknown ID> 3: 00 0 0 0 - 0 0 0 [ 0: 0 ] unused Offset: 40965750 Signature: 0xAA55 Starting Ending LBA Info: #: id C H S - C H S [ start: size ] ------------------------------------------------------------------------ 0: 07 2550 1 1 - 4497 254 63 [ 40965813: 31294557 ] HPFS/QNX/AUX 1: 00 0 0 0 - 0 0 0 [ 0: 0 ] unused 2: 00 0 0 0 - 0 0 0 [ 0: 0 ] unused 3: 00 0 0 0 - 0 0 0 [ 0: 0 ] unused 3 - Initialize the 2nd disk. # fdisk -i wd1 ----------------------------------------------------- ------ ATTENTION - UPDATING MASTER BOOT RECORD ------ ----------------------------------------------------- Do you wish to write new MBR and partition table? [n] y # fdisk wd1 Disk: wd1 geometry: 4998/255/63 [80292870 Sectors] Offset: 0 Signature: 0xAA55 Starting Ending LBA Info: #: id C H S - C H S [ start: size ] ------------------------------------------------------------------------ 0: 00 0 0 0 - 0 0 0 [ 0: 0 ] unused 1: 00 0 0 0 - 0 0 0 [ 0: 0 ] unused 2: 00 0 0 0 - 0 0 0 [ 0: 0 ] unused *3: A6 0 1 1 - 4997 254 63 [ 63: 80292807 ] OpenBSD 4 - After 1st boot. Create temporary slice to compile OpenBSD kernel which enable RAID in kernel. For this example, I use my 2nd disk to compile the kernel and to include RAID support. I use 1Gb partition for this purpose(don't worry about the size since we will delete it back later). Here is my OpenBSD disk2 structure. # disklabel -E wd1 # size offset fstype [fsize bsize cpg] c: 38.3G 0.0G unused 0 0 # Cyl 0 - 79655 d: 1.0G 2.5G 4.2BSD 2048 16384 328 # Cyl 5202 - 7282 # mkdir /mnt/hd # mkdir /mnt/cdrom # mount /dev/wd1d /mnt/hd # mount /dev/cd0a /mnt/cdrom # tar -xvzf /mnt/cdrom/3.7/src.tar.gz -C /mnt/hd # tar -xvzf /mnt/cdrom/3.7/sys.tar.gz -C /mnt/hd raid option in kernel. --- start --- pseudo-device raid 4 # RAIDframe disk driver # RAID options. option RAID_AUTOCONFIG # Turn on component auto-detection & auto-configuration of RAID sets option RAIDDEBUG # RAID debug information --- end --- 5 - After enable RAID support in kernel, compile the kernel, and reboot. 6 - After reboot, re-structure ur hard disk drive. # disklabel -E wd0 > a partition: [b] offset: [430416] size: [79862454] FS type: [swap] RAID > q Write new label?: [y] Here my hard disk structure # size offset fstype [fsize bsize cpg] a: 0.2G 0.0G 4.2BSD 2048 16384 328 # Cyl 0*- 426 b: 38.1G 0.2G RAID # Cyl 427 - 79655* c: 38.3G 0.0G unused 0 0 # Cyl 0 - 79655 7 - Creating disk structure on disk 2 with same structure with disk 1. # disklabel wd0 > wd0disklabel # using MBR partition 3: type A6 off 63 (0x3f) size 80292807 (0x4c92bc7) # cp wd0disklabel wd1disklabel # vi wd1disklabel --- change --- # /dev/rwd0c: --- to --- # /dev/rwd1c: --- done --- # disklabel -R -r wd1 wd1disklabel # using MBR partition 3: type A6 off 63 (0x3f) size 80292807 (0x4c92bc7) 8 - Create the RAID1 config file. # vi /etc/raid0.conf --- begin --- START array # numRow numCol numSpare 1 2 0 START disks /dev/wd0b /dev/wd1b START layout # sectPerSU SUsPerParityUnit SUsPerReconUnit RAID_level_1 128 1 1 1 START queue fifo 100 --- end --- 9 - Setting up the RAID disk. # raidctl -C /etc/raid0.conf raid0 # raidctl -I 100 raid0 # raidctl -iv raid0 and your RAID device begin re-write the parity. 10 - Create slice for raid0. # disklabel -E raid0 # size offset fstype [fsize bsize cpg] a: 3.0G 0.0G 4.2BSD 2048 16384 16 # Cyl 0 - 6143 b: 1.0G 3.0G swap # Cyl 6144 - 8191 c: 38.1G 0.0G unused 0 0 # Cyl 0 - 77990* d: 10.0G 4.0G 4.2BSD 2048 16384 16 # Cyl 8192 - 28671 e: 2.0G 14.0G 4.2BSD 2048 16384 16 # Cyl 28672 - 32767 f: 21.1G 16.0G 4.2BSD 2048 16384 16 # Cyl 32768 - 75980 g: 1.0G 37.1G 4.2BSD 2048 16384 16 # Cyl 75981 - 77990* > q 11 - Format all slice in raid0. # newfs /dev/rraid0a # newfs /dev/rraid0d # newfs /dev/rraid0e # newfs /dev/rraid0f # newfs /dev/rraid0g 12 - Create directory and mount all the filesystem. # mkdir /mnt/hd # mkdir /mnt/cdrom # mount /dev/raid0a /mnt/hd # mkdir /mnt/hd/usr # mkdir /mnt/hd/var # mkdir /mnt/hd/tmp # mkdir /mnt/hd/home # mount /dev/raid0d /mnt/hd/usr # mount /dev/raid0e /mnt/hd/var # mount /dev/raid0f /mnt/hd/home # mount /dev/raid0g /mnt/hd/tmp 13 - Mount OpenBSD cd. # cd /mnt/cdrom/3.7/i386 14 - Start OpenBSD installation. # tar -xvzpf base37.tgz -C /mnt/hd # tar -xvzpf etc37.tgz -C /mnt/hd # tar -xvzpf comp37.tgz -C /mnt/hd # tar -xvzpf game37.tgz -C /mnt/hd # tar -xvzpf man37.tgz -C /mnt/hd # tar -xvzpf misc37.tgz -C /mnt/hd # tar -xvzpf xbase37.tgz -C /mnt/hd # tar -xvzpf xetc37.tgz -C /mnt/hd # tar -xvzpf xfont37.tgz -C /mnt/hd # tar -xvzpf xserv37.tgz -C /mnt/hd # tar -xvzpf xshare37.tgz -C /mnt/hd 15 - Extract OpenBSD source and ports(optional). # tar -xvzf src.tar.gz -C /mnt/hd/usr/src # tar -xvzf sys.tar.gz -C /mnt/hd/usr/src # tar -xvzf ports.tar.gz -C /mnt/hd/usr/ 16 - Copy all /etc file. # cd /mnt/hd # dump -0f - /etc | restore -rf - 17 - Copy file system information and edit it to suit your installation disk structure. # cp /etc/fstab /mnt/hd/ # vi /mnt/etc/fstab --- Change to this --- #/dev/wd0a / ffs rw 1 1 /dev/raid0a / ffs rw 1 1 /dev/raid0b none swap sw 0 0 /dev/raid0d /usr ffs rw,nodev,softdep 1 2 /dev/raid0e /var ffs rw,nodev,nosuid,softdep 1 2 /dev/raid0f /home ffs rw,nodev,nosuid,softdep 1 2 /dev/raid0g /tmp ffs rw,nodev,nosuid,softdep 1 2 --- done --- 18 - Copy the kernel. # cp /bsd /mnt/hd/ 19 - Change root directory. # chroot /mnt/hd/ 20 - Create all the devices. # cd /dev # ./MAKEDEV all 21 - Activated the RAID device as bootable. # raidctl -A root raid0 22 - Enable the swap device. # swapctl -a /dev/raid0b 23 - Activate boot on both disk. # /usr/mdec/installboot -v /usr/mdec/boot /usr/mdec/biosboot wd0 # /usr/mdec/installboot -v /usr/mdec/boot /usr/mdec/biosboot wd1 24 - Reboot you system.