From nobody@FreeBSD.org  Sun Feb 16 10:55:53 2014
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1])
	(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by hub.freebsd.org (Postfix) with ESMTPS id BB31FD61
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 16 Feb 2014 10:55:53 +0000 (UTC)
Received: from newred.freebsd.org (cgiserv.freebsd.org [IPv6:2001:1900:2254:206a::50:4])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mx1.freebsd.org (Postfix) with ESMTPS id A6E3F1333
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 16 Feb 2014 10:55:53 +0000 (UTC)
Received: from cgiserv.freebsd.org ([127.0.1.6])
	by newred.freebsd.org (8.14.7/8.14.7) with ESMTP id s1GAtrp6067846
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 16 Feb 2014 10:55:53 GMT
	(envelope-from nobody@cgiserv.freebsd.org)
Received: (from nobody@localhost)
	by cgiserv.freebsd.org (8.14.7/8.14.7/Submit) id s1GAtr2C067845;
	Sun, 16 Feb 2014 10:55:53 GMT
	(envelope-from nobody)
Message-Id: <201402161055.s1GAtr2C067845@cgiserv.freebsd.org>
Date: Sun, 16 Feb 2014 10:55:53 GMT
From: "Vladislav V. Prodan" <admin@support.od.ua>
To: freebsd-gnats-submit@FreeBSD.org
Subject: After adding a disk in the disk pool is lost geom disk
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         186816
>Category:       kern
>Synopsis:       [geom] After adding a disk in the disk pool is lost geom disk
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    jmg
>State:          feedback
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Feb 16 11:00:00 UTC 2014
>Closed-Date:    
>Last-Modified:  Mon Feb 24 19:40:02 UTC 2014
>Originator:     Vladislav V. Prodan
>Release:        FreeBSD 10.0
>Organization:
support.od.ua
>Environment:
FreeBSD vm-10-1.domain.com 10.0-STABLE FreeBSD 10.0-STABLE #0: Sun Feb 16 06:09:42 EET 2014     root@vm-10-1.domain.com:/usr/obj/usr/src/sys/GENERIC  amd64
>Description:


I tried to increase the size of the pool by adding a larger disk. 

# gpart show
=>      34  16777149  ada0  GPT  (8.0G)
        34      1024     1  freebsd-boot  (512K)
      1058       990        - free -  (495K)
      2048   2097152     2  freebsd-swap  (1.0G)
   2099200  14677983     3  freebsd-zfs  (7.0G)

=>      34  20971453  ada1  GPT  (10G)
        34      1024     1  freebsd-boot  (512K)
      1058       990        - free -  (495K)
      2048   2097152     2  freebsd-swap  (1.0G)
   2099200  18872287     3  freebsd-zfs  (9.0G)

=>      34  20971453  diskid/DISK-VB7f1c16c2-98b6ad8e  GPT  (10G)
        34      1024                                1  freebsd-boot  (512K)
      1058       990                                   - free -  (495K)
      2048   2097152                                2  freebsd-swap  (1.0G)
   2099200  18872287                                3  freebsd-zfs  (9.0G)

#zpool attach zroot gpt/system-ada0 gpt/system-ada1 
# zpool status
  pool: zroot
 state: ONLINE
status: One or more devices is currently being resilvered.  The pool will
        continue to function, possibly in a degraded state.
action: Wait for the resilver to complete.
  scan: resilver in progress since Sun Feb 16 12:42:08 2014
        3,64G scanned out of 6,70G at 6,71M/s, 0h7m to go
        3,64G resilvered, 54,40% done
config:

        NAME                 STATE     READ WRITE CKSUM
        zroot                ONLINE       0     0     0
          mirror-0           ONLINE       0     0     0
            gpt/system-ada0  ONLINE       0     0     0
            gpt/system-ada1  ONLINE       0     0     0  (resilvering)

errors: No known data errors


And now I can not prescribe the boot sector at the beginning of the disc.

# gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ada1
gpart: No such geom: ada1.

# gpart show
=>      34  16777149  ada0  GPT  (8.0G)
        34      1024     1  freebsd-boot  (512K)
      1058       990        - free -  (495K)
      2048   2097152     2  freebsd-swap  (1.0G)
   2099200  14677983     3  freebsd-zfs  (7.0G)

=>      34  20971453  diskid/DISK-VB7f1c16c2-98b6ad8e  GPT  (10G)
        34      1024                                1  freebsd-boot  (512K)
      1058       990                                   - free -  (495K)
      2048   2097152                                2  freebsd-swap  (1.0G)
   2099200  18872287                                3  freebsd-zfs  (9.0G)

# ll /dev/gpt
total 0
crw-r-----  1 root  operator  0x57 16 &#1092;&#1077;&#1074; 11:54 boot-0
crw-r-----  1 root  operator  0x72 16 &#1092;&#1077;&#1074; 12:39 boot-1
crw-r-----  1 root  operator  0x59 16 &#1092;&#1077;&#1074; 11:54 swap-ada0
crw-r-----  1 root  operator  0x73 16 &#1092;&#1077;&#1074; 12:39 swap-ada1
crw-r-----  1 root  operator  0x5b 16 &#1092;&#1077;&#1074; 11:54 system-ada0
crw-r-----  1 root  operator  0x75 16 &#1092;&#1077;&#1074; 12:39 system-ada1

# ll /dev | grep ad
lrwxr-xr-x  1 root  wheel        4 16 &#1092;&#1077;&#1074; 11:54 ad4@ -> ada0
lrwxr-xr-x  1 root  wheel        6 16 &#1092;&#1077;&#1074; 11:54 ad4p1@ -> ada0p1
lrwxr-xr-x  1 root  wheel        6 16 &#1092;&#1077;&#1074; 11:54 ad4p2@ -> ada0p2
lrwxr-xr-x  1 root  wheel        6 16 &#1092;&#1077;&#1074; 11:54 ad4p3@ -> ada0p3
lrwxr-xr-x  1 root  wheel        4 16 &#1092;&#1077;&#1074; 11:54 ad6@ -> ada1
crw-r-----  1 root  operator  0x48 16 &#1092;&#1077;&#1074; 11:54 ada0
crw-r-----  1 root  operator  0x4b 16 &#1092;&#1077;&#1074; 11:54 ada0p1
crw-r-----  1 root  operator  0x4d 16 &#1092;&#1077;&#1074; 11:54 ada0p2
crw-r-----  1 root  operator  0x4f 16 &#1092;&#1077;&#1074; 11:54 ada0p3
crw-r-----  1 root  operator  0x51 16 &#1092;&#1077;&#1074; 11:54 ada1



>How-To-Repeat:
gpart show
zpool attach zroot gpt/system-ada0 gpt/system-ada1 
gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ada1
gpart show
>Fix:


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-geom 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Mon Feb 24 07:02:45 UTC 2014 
Responsible-Changed-Why:  
reclassify. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=186816 
State-Changed-From-To: open->feedback 
State-Changed-By: jmg 
State-Changed-When: Mon Feb 24 18:58:53 UTC 2014 
State-Changed-Why:  
I'll take this over as I believe the user was just using the wrong 
device..  waiting for feedback (submitted as follow up, should be 
there shortly).. 


Responsible-Changed-From-To: freebsd-geom->jmg 
Responsible-Changed-By: jmg 
Responsible-Changed-When: Mon Feb 24 18:58:53 UTC 2014 
Responsible-Changed-Why:  
I'll take this over as I believe the user was just using the wrong 
device..  waiting for feedback (submitted as follow up, should be 
there shortly).. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=186816 

From: John-Mark Gurney <jmg@funkthat.com>
To: bug-followup@FreeBSD.org, admin@support.od.ua
Cc:  
Subject: Re: kern/186816: [geom] After adding a disk in the disk pool is lost geom disk
Date: Mon, 24 Feb 2014 10:58:39 -0800

 Ahh, the problem is probably this:
 => 34 20971453 diskid/DISK-VB7f1c16c2-98b6ad8e GPT (10G)
 
 try using the gpart bootcode command w/ this device instead of ada1...
 
 When the diskid device gets mounted/used, ada1 becomes invalidated..
 They aren't aliases for each other...
 
 -- 
   John-Mark Gurney				Voice: +1 415 225 5579
 
      "All that I will do, has been done, All that I have, has not."

From: "Vladislav V. Prodan" <admin@support.od.ua>
To: John-Mark Gurney <jmg@funkthat.com>
Cc: bug-followup@freebsd.org
Subject: Re: kern/186816: [geom] After adding a disk in the disk pool is lost
 geom disk
Date: Mon, 24 Feb 2014 21:36:27 +0200

 --90e6ba10abe9a0bb4a04f32c179d
 Content-Type: text/plain; charset=UTF-8
 
 2014-02-24 20:58 GMT+02:00 John-Mark Gurney <jmg@funkthat.com>:
 
 > Ahh, the problem is probably this:
 > => 34 20971453 diskid/DISK-VB7f1c16c2-98b6ad8e GPT (10G)
 >
 > try using the gpart bootcode command w/ this device instead of ada1...
 >
 > When the diskid device gets mounted/used, ada1 becomes invalidated..
 > They aren't aliases for each other...
 >
 >
 This method worked in 9.2:
 gpart show
 zpool attach zroot gpt/system-ada0 gpt/system-ada1
 gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ada1
 gpart show
 
 
 I suspect that this is because of partitioning via gpart restore -l ada1 <
 ada0.backup
 
 If the disc ada1 break in manual mode:
 # gpart create-s gpt ada1
 # gpart add -b 34-s 64k -t freebsd-boot ada1
 # gpart add -s 4G -t freebsd-swap -l swap1 ada1
 # gpart add -t freebsd-zfs -l disk1 ada1
 
 that all partitions ada1 available in the system.
 
 
 -- 
 Vladislav V. Prodan
 System & Network Administrator
 http://support.od.ua
 +380 67 4584408, +380 99 4060508
 VVP88-RIPE
 
 --90e6ba10abe9a0bb4a04f32c179d
 Content-Type: text/html; charset=UTF-8
 Content-Transfer-Encoding: quoted-printable
 
 <div dir=3D"ltr"><br><div class=3D"gmail_extra"><br><br><div class=3D"gmail=
 _quote">2014-02-24 20:58 GMT+02:00 John-Mark Gurney <span dir=3D"ltr">&lt;<=
 a href=3D"mailto:jmg@funkthat.com" target=3D"_blank">jmg@funkthat.com</a>&g=
 t;</span>:<br>
 
 <blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-=
 left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;p=
 adding-left:1ex">Ahh, the problem is probably this:<br>
 =3D&gt; 34 20971453 diskid/DISK-VB7f1c16c2-98b6ad8e GPT (10G)<br>
 <br>
 try using the gpart bootcode command w/ this device instead of ada1...<br>
 <br>
 When the diskid device gets mounted/used, ada1 becomes invalidated..<br>
 They aren&#39;t aliases for each other...<br>
 <span class=3D""><font color=3D"#888888"><br></font></span></blockquote><di=
 v><br></div><div>This method worked in 9.2:<br></div><div><span style=3D"co=
 lor:rgb(0,0,0);font-family:verdana,sans-serif;font-size:11px">gpart show</s=
 pan><br style=3D"color:rgb(0,0,0);font-family:verdana,sans-serif;font-size:=
 11px">
 
 <span style=3D"color:rgb(0,0,0);font-family:verdana,sans-serif;font-size:11=
 px">zpool attach zroot gpt/system-ada0 gpt/system-ada1=C2=A0</span><br styl=
 e=3D"color:rgb(0,0,0);font-family:verdana,sans-serif;font-size:11px"><span =
 style=3D"color:rgb(0,0,0);font-family:verdana,sans-serif;font-size:11px">gp=
 art bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ada1</span><br style=3D=
 "color:rgb(0,0,0);font-family:verdana,sans-serif;font-size:11px">
 
 <span style=3D"color:rgb(0,0,0);font-family:verdana,sans-serif;font-size:11=
 px">gpart show</span><br></div><div><br></div><div><br></div><div><div>I su=
 spect that this is because of partitioning via gpart restore -l ada1 &lt; a=
 da0.backup=C2=A0</div>
 
 <div><br></div><div>If the disc ada1 break in manual mode:=C2=A0</div><div>=
 # gpart create-s gpt ada1=C2=A0</div><div># gpart add -b 34-s 64k -t freebs=
 d-boot ada1=C2=A0</div><div># gpart add -s 4G -t freebsd-swap -l swap1 ada1=
 =C2=A0</div><div>
 
 # gpart add -t freebsd-zfs -l disk1 ada1=C2=A0</div><div><br></div><div>tha=
 t all partitions ada1 available in the system.</div></div><div>=C2=A0</div>=
 </div><div><br></div>-- <br>Vladislav V. Prodan =C2=A0 =C2=A0 =C2=A0 =C2=A0=
  =C2=A0 =C2=A0<br>System &amp; Network Administrator<br>
 
 <a href=3D"http://support.od.ua" target=3D"_blank">http://support.od.ua</a>=
  =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<br>+380 67 4584408, +380 99 4060508<br>=
 VVP88-RIPE
 </div></div>
 
 --90e6ba10abe9a0bb4a04f32c179d--
>Unformatted:
