Bug 186816 - [geom] After adding a disk in the disk pool is lost geom disk
Summary: [geom] After adding a disk in the disk pool is lost geom disk
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 10.0-STABLE
Hardware: Any Any
: Normal Affects Only Me
Assignee: John-Mark Gurney
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-16 11:00 UTC by Vladyslav V. Prodan
Modified: 2018-05-28 19:42 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vladyslav V. Prodan 2014-02-16 11:00:00 UTC

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 фев 11:54 boot-0
crw-r-----  1 root  operator  0x72 16 фев 12:39 boot-1
crw-r-----  1 root  operator  0x59 16 фев 11:54 swap-ada0
crw-r-----  1 root  operator  0x73 16 фев 12:39 swap-ada1
crw-r-----  1 root  operator  0x5b 16 фев 11:54 system-ada0
crw-r-----  1 root  operator  0x75 16 фев 12:39 system-ada1

# ll /dev | grep ad
lrwxr-xr-x  1 root  wheel        4 16 фев 11:54 ad4@ -> ada0
lrwxr-xr-x  1 root  wheel        6 16 фев 11:54 ad4p1@ -> ada0p1
lrwxr-xr-x  1 root  wheel        6 16 фев 11:54 ad4p2@ -> ada0p2
lrwxr-xr-x  1 root  wheel        6 16 фев 11:54 ad4p3@ -> ada0p3
lrwxr-xr-x  1 root  wheel        4 16 фев 11:54 ad6@ -> ada1
crw-r-----  1 root  operator  0x48 16 фев 11:54 ada0
crw-r-----  1 root  operator  0x4b 16 фев 11:54 ada0p1
crw-r-----  1 root  operator  0x4d 16 фев 11:54 ada0p2
crw-r-----  1 root  operator  0x4f 16 фев 11:54 ada0p3
crw-r-----  1 root  operator  0x51 16 фев 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
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2014-02-24 07:02:45 UTC
Responsible Changed
From-To: freebsd-bugs->freebsd-geom

reclassify.
Comment 2 John-Mark Gurney 2014-02-24 18:58:39 UTC
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."
Comment 3 John-Mark Gurney freebsd_committer freebsd_triage 2014-02-24 18:58:53 UTC
State Changed
From-To: open->feedback

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).. 


Comment 4 John-Mark Gurney freebsd_committer freebsd_triage 2014-02-24 18:58:53 UTC
Responsible Changed
From-To: freebsd-geom->jmg

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)..
Comment 5 Vladyslav V. Prodan 2014-02-24 19:36:27 UTC
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
Comment 6 Eitan Adler freebsd_committer freebsd_triage 2018-05-28 19:42:55 UTC
batch change:

For bugs that match the following
-  Status Is In progress 
AND
- Untouched since 2018-01-01.
AND
- Affects Base System OR Documentation

DO:

Reset to open status.


Note:
I did a quick pass but if you are getting this email it might be worthwhile to double check to see if this bug ought to be closed.