From owner-freebsd-questions@FreeBSD.ORG Mon Oct 5 09:43:13 2009 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 854171065672 for ; Mon, 5 Oct 2009 09:43:13 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (lurza.secnetix.de [IPv6:2a01:170:102f::2]) by mx1.freebsd.org (Postfix) with ESMTP id 07E068FC1D for ; Mon, 5 Oct 2009 09:43:12 +0000 (UTC) Received: from lurza.secnetix.de (localhost [127.0.0.1]) by lurza.secnetix.de (8.14.3/8.14.3) with ESMTP id n959gudU058785; Mon, 5 Oct 2009 11:43:11 +0200 (CEST) (envelope-from oliver.fromme@secnetix.de) Received: (from olli@localhost) by lurza.secnetix.de (8.14.3/8.14.3/Submit) id n959guoP058784; Mon, 5 Oct 2009 11:42:56 +0200 (CEST) (envelope-from olli) Date: Mon, 5 Oct 2009 11:42:56 +0200 (CEST) Message-Id: <200910050942.n959guoP058784@lurza.secnetix.de> From: Oliver Fromme To: freebsd-questions@FreeBSD.ORG In-Reply-To: <4AC9B387.4040800@chamonix.reportlab.co.uk> X-Newsgroups: list.freebsd-questions User-Agent: tin/1.8.3-20070201 ("Scotasay") (UNIX) (FreeBSD/6.4-PRERELEASE-20080904 (i386)) MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.1.2 (lurza.secnetix.de [127.0.0.1]); Mon, 05 Oct 2009 11:43:11 +0200 (CEST) Cc: Subject: Re: fix remote degraded gmirror 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: Mon, 05 Oct 2009 09:43:13 -0000 Robin Becker wrote: > mojo fms wrote: > ....... > > > > > > What about shrinking the old mirror drive a few megs so its smaller than > > the new one? > > The original problem has gone away for the moment as my hoter found an AAJS > drive with the same number of sectors and the mirror synchronized fine. > > I looked around for ways to shrink the slice, but didn't discover anything very > authoritative or easy. Is there a slice reduction beast? You can shrink slices and partitions, but you cannot shrink file systems. In theory you could write a shrinkfs tool, but it's more complicated than growfs(8) so nobody has bitten the bullet yet, given the fact that disk sizes tend to grow most of the time, but rarely ever shrink. Apart from that, there is no way to shrink a gmirror, as far as I know. The best way to resolve the problem is to create a new mirror on the new (smaller) drive, copy all data over to the new mirror, boot from the new drive, destroy the old mirror and insert the old disk into the new mirror. I've done that procedure several times; it takes some time and involves a short downtime (for reboot), but it works fine. You can do that remotely without single user mode, but it's always better to be prepared to have access to the console. And of course, you should always have good backups. A RAID is never a substitute for a backup. Best regards Oliver -- Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M. Handelsregister: Registergericht Muenchen, HRA 74606, Geschäftsfuehrung: secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht Mün- chen, HRB 125758, Geschäftsführer: Maik Bachmann, Olaf Erb, Ralf Gebhart FreeBSD-Dienstleistungen, -Produkte und mehr: http://www.secnetix.de/bsd "I learned Java 3 years before Python. It was my language of choice. It took me two weekends with Python before I was more productive with it than with Java." -- Anthony Roberts