From nobody@FreeBSD.org  Mon Jun  4 19:53:36 2012
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0C9F010656D3
	for <freebsd-gnats-submit@FreeBSD.org>; Mon,  4 Jun 2012 19:53:36 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id EC7B88FC17
	for <freebsd-gnats-submit@FreeBSD.org>; Mon,  4 Jun 2012 19:53:35 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id q54JrZ5J095943
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 4 Jun 2012 19:53:35 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id q54JrZI9095942;
	Mon, 4 Jun 2012 19:53:35 GMT
	(envelope-from nobody)
Message-Id: <201206041953.q54JrZI9095942@red.freebsd.org>
Date: Mon, 4 Jun 2012 19:53:35 GMT
From: Warren Block <wblock@FreeBSD.org>
To: freebsd-gnats-submit@FreeBSD.org
Subject: gmirror(8) needs option to limit mirror capacity
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         168681
>Category:       bin
>Synopsis:       gmirror(8) needs option to limit mirror capacity
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jun 04 20:00:29 UTC 2012
>Closed-Date:    Mon Jan 20 23:33:27 UTC 2014
>Last-Modified:  Mon Jan 20 23:33:27 UTC 2014
>Originator:     Warren Block
>Release:        9-STABLE
>Organization:
>Environment:
FreeBSD lightning 9.0-STABLE FreeBSD 9.0-STABLE #0 r236565: Mon Jun  4 09:50:54 MDT 2012     root@lightning:/usr/obj/usr/src/sys/LIGHTNING  amd64
>Description:
gmirror(8) can create mirrors with disks of different capacities.  The mirror capacity is limited to that of the smallest disk present when the mirror is created.  If ada0 is 250G, and ada1 500G, 'gmirror label gm0 ada0 ada1' will create a mirror that is 250G.

Unfortunately, there is no command-line access to control this size.  If an existing system is to be swapped onto a mirror, creating the mirror on the new, larger drive alone (gmirror label gm0 ada1) creates a 500G mirror.  The old 250G drive cannot be inserted into this mirror, it is too small.  With a new command-line option (say, "-c" for capacity), gmirror could be told to limit the size to 250G, allowing easy mirroring of existing drives: 'gmirror label -c 250G gm0 ada1' would create a 250G single-drive mirror, data from ada0 could be copied to it, and then ada0 could be inserted into the mirror.

This new capacity option would help assist users of older systems, where it may be difficult or impossible to find a drive that is not larger than the existing drive.  For example, try to buy a 40G drive today.

Preferably, the option would take SI units like gpart(8), but even just a total number of blocks or bytes would give the user control.
>How-To-Repeat:

>Fix:


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: wblock 
State-Changed-When: Mon Jan 20 23:32:18 UTC 2014 
State-Changed-Why:  
The new Handbook section on gmirror(8) shows how to use gnop(8) to limit 
capacity: 
http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/geom-mirror.html#geom-mirror-existing-drive 

http://www.freebsd.org/cgi/query-pr.cgi?pr=168681 
>Unformatted:
