From owner-freebsd-geom@FreeBSD.ORG Thu Sep 29 09:02:31 2005 Return-Path: X-Original-To: freebsd-geom@freebsd.org Delivered-To: freebsd-geom@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3D06316A41F for ; Thu, 29 Sep 2005 09:02:31 +0000 (GMT) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (arm132.internetdsl.tpnet.pl [83.17.198.132]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9338143D48 for ; Thu, 29 Sep 2005 09:02:29 +0000 (GMT) (envelope-from pjd@garage.freebsd.pl) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id AD8C952CD7; Thu, 29 Sep 2005 11:02:28 +0200 (CEST) Received: from localhost (pjd.wheel.pl [10.0.1.1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 4D8F152D13; Thu, 29 Sep 2005 11:02:19 +0200 (CEST) Date: Thu, 29 Sep 2005 11:02:12 +0200 From: Pawel Jakub Dawidek To: Victor Sudakov Message-ID: <20050929090212.GA1715@garage.freebsd.pl> References: <20050916073012.GA31056@admin.sibptus.tomsk.ru> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="n8g4imXOkfNTN/H1" Content-Disposition: inline In-Reply-To: <20050916073012.GA31056@admin.sibptus.tomsk.ru> X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 7.0-CURRENT i386 User-Agent: mutt-ng devel (FreeBSD) X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-5.9 required=3.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.0.4 Cc: freebsd-geom@freebsd.org Subject: Re: Create a mirror on disk with valid data X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Sep 2005 09:02:31 -0000 --n8g4imXOkfNTN/H1 Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Sep 16, 2005 at 02:30:12PM +0700, Victor Sudakov wrote: +> Colleagues, +>=20 +> gmirror(8) says that a mirror can be created from a disk with existing +> data. However, other sources like=20 +> http://ezine.daemonnews.org/200502/diskmirror.html=20 +> say that the mirror device should be first partitioned, labelled and +> formatted. +>=20 +> The second way seems to me more feasible. From experimenting with +> different disks I have found out that (according to fdisk) the size of g= m0 +> is several sectors smaller than that of ad0. I said to myself, that is +> the overhead of the gmirror metadata. +>=20 +> How could it then be possible to create a mirror from a disk with +> existing data, like the man page suggests? The gmirror metadata could +> then be overwritten with user data or vice versa. +>=20 +> Any input is very much appreciated.=20 You are right. Last sector is used for metadata and will be overwritten. The example is there actually to show that you can create a mirror with only one disk and add another one later. I added a note to clarify that. In real world it is really hard to trigger, because both fdisk(8) and bsdlabel(8) like to cut much more than one sector at the end of the disk/slice, so in most cases it is safe, but I always recommended to dump -> [ fdisk -> bsdlabel -> ] gmirror label -> [ fdisk -> bsdlabel -> ] = restore. Thanks. --=20 Pawel Jakub Dawidek http://www.wheel.pl pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --n8g4imXOkfNTN/H1 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (FreeBSD) iD8DBQFDO62UForvXbEpPzQRAo7GAKDw1WXBYYJCiRm4cmbLu7E0ekHusQCg5rDl ArBzJzc7qNuevPq/03D6HEw= =U2fy -----END PGP SIGNATURE----- --n8g4imXOkfNTN/H1--