Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 5 Oct 2009 11:42:56 +0200 (CEST)
From:      Oliver Fromme <olli@lurza.secnetix.de>
To:        freebsd-questions@FreeBSD.ORG
Subject:   Re: fix remote degraded gmirror
Message-ID:  <200910050942.n959guoP058784@lurza.secnetix.de>
In-Reply-To: <4AC9B387.4040800@chamonix.reportlab.co.uk>

next in thread | previous in thread | raw e-mail | index | archive | help
Robin Becker <robin@reportlab.com> 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200910050942.n959guoP058784>