ZFS zpool export/import changed disks from disk/<id> to e.g. ada2

susannej

Member

Reaction score: 8
Messages: 33

Hello together,

I reinstalled my FreeBSD server at home with a zpool where the disks (mirror) where named - if I executed the zpool status - like "disk/<id...>". (don't know why, I created the pool in the past with ada2 + ada3).

Now after a zfs export and then a new install and a zfs import, the disks are named again ada2 and ada3.

As far as I think I know now, it's not perfect to use e.g. adaX and would like to switch to the disk/<id...> again (still not knowing, why or how it changed to disk/<id>)

Uh, hope you understand my "problem"?! :)

Do you have some tips or explanation?
 
Last edited by a moderator:
OP
susannej

susannej

Member

Reaction score: 8
Messages: 33

Thanks memreflect !

That's interesting to read! But I think that's a little bit different in my case. I remebered, that I added a SSD-HD to the system to a formerly free SATA port (ada1). Maybe that caused the difference in displaying the disk-id? (don't know). (it was a disk/<something> instead of gpt/<something>)

I'll spend some time for testing in reataching my disk... zdb -l showed me some id's and maybe it's not so important anymore to have gpt partitions and id's on the disk (because I used the whole disk for zfs, without partitioning them before). I'll see. :)

Just to mention, my old loader.conf doesn't contain the kern.geom.label.xxx entries, whereas my new installation does.

Thanks a lot! :)
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 8,775
Messages: 33,056

As far as I think I know now, it's not perfect to use e.g. adaX and would like to switch to the disk/<id...> again (still not knowing, why or how it changed to disk/<id>)
ZFS actually doesn't care once they've been added to the pool. ZFS uses the information that's stored on the drive itself. So even if you moved all the disks around, put them on other controllers or whatnot, ZFS is still able to find the correct disks, in the right order, for that pool.
 
OP
susannej

susannej

Member

Reaction score: 8
Messages: 33

1 or 2 years ago, I moved my zfs-pool from one pc to another (with a different count of harddisks) and everything was working fine, but I remember reading a story (was it in zfs-mastery? don't know yet) that a pool was messed up, because one disk was failing... (something that I would be afraid of ...)

But if you think, that doesn't matter anymore, that would be gorgeous! :) I like the easyness of adding a whole disk without partitioning etc.
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 8,775
Messages: 33,056

but I remember reading a story (was it in zfs-mastery? don't know yet) that a pool was messed up, because one disk was failing... (something that I would be afraid of ...)
That can always happen if you use a non-redundant pool (single disk or striped set aka RAID0), one drive dies and the whole pool is gone. Redundant pools (mirror, RAID-Z, Z2, etc) can recover from one or more failing drives.
 
OP
susannej

susannej

Member

Reaction score: 8
Messages: 33

That's something that I was hoping! (Even more after I saw the output of zdb -l)
As far as I can remember, the situation was, that they had e.g. 2 pools (maybe mirrored?) e.g. pool1 = ada1 + ada2 and pool2 = ada3 + ada4. The first hd was failing, they reboot and the disk gets renumbered (old ada2 gets ada1 and so on) and the system resilvers the new ada1 + 2 ... uhhh, hope I got it correct from my memories ...

A few weeks ago, I added a new HD to my computer (on the 2nd sata port, my pool is on sata3+4) but I couldn't remember if the disks after this port gets renumbered... everything was working fine and smooth as before. (missing the chance to have a look at it more closely and learn a bit more...)
 

garry

Member

Reaction score: 62
Messages: 72

...the disks are named again ada2 and ada3... As far as I think I know now, it's not perfect to use e.g. adaX ... Do you have some tips or explanation?
I had a similar problem when I simultaneously moved disks on the ports while adding storage AND exporting the pool into Linux. FreeBSD still knew the providers by gpt/label and could still access the pool but Linux had apparently imported them as sdc/sdd before they were moved. The new locations were sda/sdb and Linux failed to access the pool anymore. Indeed it's not perfect to use adaX / sdX !

In FreeBSD I suggest using gpt labels for naming providers and I don't know why any FreeBSD would ever import that pool using other device names. Maybe your disks were accessed by adaX names just before the pool was imported -- you were checking those disks? "Tasting" the disk as adaX will cause the corresponding other names to disappear from /dev

In any case, I adopted the discipline of putting my zfs data mirrors FIRST in the sata ports and the boot disk(s) LAST, so that a boot disk may appear at ada5 or ada6 for example, but those zfs mirror providers always stay put and show up at ada1 .. ada4. This discipline should not be necessary but in my case (pun?) it gives a little protection against (Linux?) error.
 
Top