Solved Resize ZFS Storage

I recently setup a raidz2 server with 4x1TB disks and somehow I ended up with 712G of unallocated space per disk
gpart show -lp
Code:
=>        34  1953525101    ufsid/52a0f5122e690fca  GPT  (932G)
          34           6                            - free -  (3.0K)
          40        1024  ufsid/52a0f5122e690fcap1  (null)  (512K)
        1064   461373440  ufsid/52a0f5122e690fcap2  disk0  (220G)
   461374504  1492150631                            - free -  (712G)

=>        34  1953525101    ada3  GPT  (932G)
          34           6          - free -  (3.0K)
          40        1024  ada3p1  (null)  (512K)
        1064   461373440  ada3p2  disk3  (220G)
   461374504  1492150631          - free -  (712G)

=>        34  1953525101    ufsid/52a0f53ee01d7083  GPT  (932G)
          34           6                            - free -  (3.0K)
          40        1024  ufsid/52a0f53ee01d7083p1  (null)  (512K)
        1064   461373440  ufsid/52a0f53ee01d7083p2  disk1  (220G)
   461374504  1492150631                            - free -  (712G)

=>        34  1953525101    ufsid/52a0f56322d7540a  GPT  (932G)
          34           6                            - free -  (3.0K)
          40        1024  ufsid/52a0f56322d7540ap1  (null)  (512K)
        1064   461373440  ufsid/52a0f56322d7540ap2  disk2  (220G)
   461374504  1492150631                            - free -  (712G)
I tried to use google for way to recover the wasted disk space and found this article.
As my disk are not corrupted, I gues I will have to run the following command but not sure what do input where i typed the ???:
Code:
% sysctl kern.geom.debugflags=16
% gpart resize -i 2 ada0
% gpart resize -i 2 ada1
% gpart resize -i 2 ada2
% gpart resize -i 2 ada3
% zpool set autoexpand=on zroot
% zpool online -e zroot ?????
Could someone with experience in that area please advise if the methode above is correct and if it is, what to replace the ??? with and do I need to do anything to revert the kern.geom.debugflags: 0 -> 16 entry

Thank you in advance
 
1 more question... why am I getting information only for disk ada3?
Code:
root@FredBSD:~ # gpart show ada0
gpart: No such geom: ada0.
root@FredBSD:~ # gpart show ada1
gpart: No such geom: ada1.
root@FredBSD:~ # gpart show ada2
gpart: No such geom: ada2.
root@FredBSD:~ # gpart show ada3
=>        34  1953525101  ada3  GPT  (932G)
          34           6        - free -  (3.0K)
          40        1024     1  freebsd-boot  (512K)
        1064   461373440     2  freebsd-zfs  (220G)
   461374504  1492150631        - free -  (712G)
 
There are multiple pathways to access a disk via GEOM:
* the device node itself: /dev/adaX
* the disk ID: /dev/diskid/XXXXXXXXXXXXXXXXX
* the GPT ID (auto-generated): /dev/gptid/XXXXXXXXXXXXXXXX
* the UFS ID (auto-generated, if there's a UFS filesystem): /dev/ufsid/blahblahblah
* the GEOM label (managed via glabel(8): /dev/label/somename
* the GPT label: /dev/gpt/somename

Once one of the pathways is in use, all the other pathways "disappear", so that you only access things once. Look at your gpart(8) output. You'll see that the UFSID pathway is in use for several of them; thus, you can't use the device node pathway to access those.

Unless you have a really good reason to use the UFS IDs (I've yet to hear of one), add the following to your /boot/loader.conf and reboot:
Code:
kern.geom.label.gptid.enable="0"        # Disable the auto-generated GPT UUIDs for disks
kern.geom.label.ufsid.enable="0"        # Disable the auto-generated UFS UUIDs for filesystems

Then you'll get access to the device node pathways.
 
HI phoenix ,
No I haven't got any good reason to use UFS IDs I am simply trying to understand how things work.
I reall need to recover the wasted space and I really stuck as to how to put my pool online
I am thinking of
Code:
zpool online -e zroot ada0 ada1 ada2 ada3
but I got the feeling that this is wrong and I will mess up my system
 
Thank you gkontos :)
Bellow is the solution if other are interested..
Code:
gpart resize -i 2 -s 920G /dev/ufsid/52a0f53ee01d7083
gpart resize -i 2 -s 920G /dev/ufsid/52a0f56322d7540a
gpart resize -i 2 -s 920G /dev/ufsid/52a0f5122e690fca
gpart resize -i 2 -s 920G /dev/ada3

zpool set autoexpand=on root

zpool online -e zroot /dev/ufsid/52a0f5122e690fcap2
zpool online -e zroot /dev/ufsid/52a0f53ee01d7083p2
zpool online -e zroot /dev/ufsid/52a0f56322d7540ap2
zpool online -e zroot /dev/ada3p2
 
Back
Top