ZFS From device name to GPT name

I've got a zpool with name "ZUSB4" and device "da1p1".
How to give it a gpt label , ie no bios numbering.
And import the zpool with that specific gpt label.
[I want zfs indiscriminate of disk ordering ]
The device da1p1 looks at first like hard-wired.
 
Thanks T-deamon;
This did the trick,
Code:
zpool export -f ZUSB4
zpool import ZUSB4 -d /dev/gpt/ZUSB4
minus d was the trick.
 
Still problems,
Code:
zpool list -v
NAME            SIZE  ALLOC   FREE  CKPOINT  EXPANDSZ   FRAG    CAP  DEDUP    HEALTH  ALTROOT
ZHD             904G   313G   592G        -         -     8%    34%  1.00x    ONLINE  -
  ada0s2        834G   313G   519G        -         -     8%  37.6%      -    ONLINE
special            -      -      -        -         -      -      -      -         -
  gpt/special    73G   434M  72.1G        -         -    30%  0.58%      -    ONLINE
ZT              330G   152G   178G        -         -    49%    46%  1.00x    ONLINE  -
  ada2p3        150G  70.8G  78.2G        -         -    48%  47.5%      -    ONLINE
  ada2p10       182G  81.4G  99.6G        -         -    50%  45.0%      -    ONLINE
logs               -      -      -        -         -      -      -      -         -
  ada1s3         14G  1.68M  13.5G        -         -     0%  0.01%      -    ONLINE
cache              -      -      -        -         -      -      -      -         -
  ada1s1         27G  26.9G   103M        -         -     0%  99.6%      -    ONLINE
All those disk-sort-ids. Its no good. I should do gpt something ... Without ordening numbering of partition/slice. Just the name.
How do i give a gpt label xxx to ada0s2 and then export/import that specific abel ?
Same for ada2p3 & afa2p10 & ada1s3.
Purpose is to have no bios-ordening. Just name&label.
 
If something is mirrored, would removing/detaching the one with partioning and then re-attaching it with the /dev/gpt work?

This is partially in context of mirrored boot pools can't really export and import them
 
gpt labeling worked for external drives, daxpy, but not for internal adaXpY. I have no explanation.
How do I gpt label, do i use glabel or gpart ?
I should find the devices immediatly in /dev/*/*
I tried
Code:
gpart modify -i 3 -l ada2p3 ada2
but nothing in /dev/
A bug ?
 
How do I gpt label, do i use glabel or gpart ?
I see you have in pool "ZT" GPT partitions (ada2p3 , ada2p10) and MBR slices (ada1s3 , ada1s1). GPT partitions and MBR slices only glabel(8) can label both. The device nodes will be created under /dev/label.

Import the pool executing zpool import -d /dev/label ZT.

The same apply to "ZHD" pool.
 
I should find the devices immediatly in /dev/*/*
I don't think so.
Device Withering is the operative term.
If you gpart a device say looking like this:
gpart show -l
=> 40 488397088 ada0 GPT (233G)
40 1024 1 gptboot0 [bootme] (512K)
1064 984 - free - (492K)
2048 4194304 2 swap0 (2.0G)
4196352 484200448 3 zfs0 (231G)
488396800 328 - free - (164K)

means that ada0p2 could be referenced by /dev/gpt/zfs0 OR /dev/ada0p2,
Now you want to import or reference ada0p2 you can do it by /dev/gpt/zfs0 or /dev/ada0p2 If you use /dev/ada0p2 (like adding it to a mirror) then the kernel makes /dev/gpt/zfs0 disappear, meaning if you "ls /dev/gpt" you don't see the zfs0

Withering comes about from exclusive access. Until the first exclusive access all ways of refering to it are available. But once you use one of them, the others are invisible. mount command, import are exclusive access.
In my output if I reference /dev/gpt/zfs0 in the commands (import) then /dev/ada0p2 goes away.

You have something imported using the ada0 path, if that is root stuff you can't export it and then import it so the gpt paths are not going to be visible.
Even on the external stuff, I'm guessing that the /dev/gpt paths aren't visible until you have exported the pool. Exporitng the pool gets rid of the exclusive access and makes all paths visible.
 
T-Daemon thanks.
I had already had things gpart labeled, one of the mirror was already using the gpt label so

zpool detach storage ada2p1
zpool attach storage gpt/existing label gpt/label for ada2p1

seems to be working as desired. Just need to wait for resilvering to finish.

To tie that in with my post #9:
Before doing the "zpool detach" my /dev/gpt did not show the label for ada2p1
After the zpool detach /dev/gpt showed the label for ada2p1.
That's what the withering is all about.
 
You need to remove ada2p3 from the pool, glabel(8) it and add back.
If it's a mirror the steps I did would work. But if it's not a mirror (zpool add vs zpool attach a mistake I've made in the past) doesn't removing a device require a "replace" of the device while it's in degraded condition?
 
Back
Top