From owner-freebsd-questions@FreeBSD.ORG Sun Oct 12 09:25:31 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1387A106568E for ; Sun, 12 Oct 2008 09:25:31 +0000 (UTC) (envelope-from citium@gmail.com) Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.235]) by mx1.freebsd.org (Postfix) with ESMTP id DD9638FC0A for ; Sun, 12 Oct 2008 09:25:30 +0000 (UTC) (envelope-from citium@gmail.com) Received: by rv-out-0506.google.com with SMTP id b25so1084481rvf.43 for ; Sun, 12 Oct 2008 02:25:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:mime-version:content-type; bh=f9aNosXCiM0D5w5NDNcivfn7s4ciTb0oL8da1UL14fg=; b=sSWUL+IIcDemxOBD+OB0aP71jOoeMDInIXJTYngJulInt2xffSKYPeiawQma7SpTRP h8bDMTm4T4omkq6kHtzuXrOJ97jxP7Wil4Cjq/5NKbHTQyNyx2DgRDDcfcNT/CkEuM74 9HGCbLhxI7TtxTMunIIDrCv37W2zr0srESqTc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type; b=QHyP2FacewiM8g9xyXTI0LFK8eHSWvkrH1OVq7qR4NYb7CqUts/6fFFZRYEzem3Zrr 1Q9bPtacUwBNkBki0szzravkbjEJjJeAZqm7a0xdh/f3mczJ07pAEtrLZ2Ih4xS8Z4rH IYFJPMrDhZGmBDiWJcobBv1lR9HuzmdDBv9uw= Received: by 10.140.166.16 with SMTP id o16mr2693237rve.3.1223801730516; Sun, 12 Oct 2008 01:55:30 -0700 (PDT) Received: by 10.140.143.2 with HTTP; Sun, 12 Oct 2008 01:55:30 -0700 (PDT) Message-ID: Date: Sun, 12 Oct 2008 15:55:30 +0700 From: "Cong Do" To: freebsd-questions@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: Gvinum Auto recovery. X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Oct 2008 09:25:31 -0000 I'm making a script to manage my raid.This is what my script is doing to recover my raid. umount /dev/gvinum/r5 #remove the raid gvinum rm -r d0 gvinum rm -r d1 gvinum rm -r d2 gvinum rm -r d3 gvinum rm r5.p0.s$1 bsdlabel -w /dev/da$1 gvinum create myraid.conf gvinum setstate -f stale r5.p0.s$1 gvinum start r5 fsck -t ufs /dev/gvinum/r5 #myraid.conf drive d0 device /dev/da0 drive d1 device /dev/da1 drive d2 device /dev/da2 drive d3 device /dev/da3 volume r5 plex org raid5 512k sd drive d0 sd drive d1 sd drive d2 sd drive d3 Is this the way that I should be recovering my raid? With hot swap do I have to do the same for SCSI and SATA, or gvinum will auto detected? I notice that when I change my hard disk around gvinum stop working. I'm planning to reserved the last sector of the harddisk to record the the ordering of the harddisk. In case it move around the myraid.conf can be reconfigure. Using bsdlabel, and dd to record the information. # /dev/da0: 8 partitions: # size offset fstype [fsize bsize bps/cpg] a: 208879 16 unused 0 0 b: 1 208895 unused 0 0 c: 208896 0 unused 0 0 # "raw" part, don't edit Thanks, Cong