ZPOOL_IMPORT_PATH on SCALE

javaguru

Cadet
Joined
Dec 22, 2021
Messages
4
I'd like to use the /dev/disk/by-id style disk names in my `zpool list`. I've changed ZPOOL_IMPORT_PATH="/dev/disk/by-vdev:/dev/disk/by-id" in /etc/default/zfs and the file change persists on reboot but the pool is still imported with UUID disk names. Is there some additional step I need to do? Apologies if I've overlooked something obvious.

Thanks
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
Welcome to the forums.

TrueNAS is not a generic "Linux distro" where you are allowed to make changes like this under the hood to how subsystems operate. It is an appliance OS and all these decisions have been made for you by developers with extensive experience in ZFS, who have written a middleware that is based on these design choices. The fact that a common open-source OS has been used and that you've been given shell access to access it does not actually mean that you're being encouraged to rethink the design of the system or participate in making these choices; you can always lobby for changes by posting a Jira ticket, but this is a pretty fundamental choice that is long established, so my guess is that any ticket requesting it would be closed without action.

The system has been designed to work a certain way and the middleware may not function correctly if you tinker in this manner.

Please note: "You have been warned." :smile:
 

javaguru

Cadet
Joined
Dec 22, 2021
Messages
4
All right, fair enough. It is a personal system and I would never tinker in this way with something I couldn't tolerate going offline, though you're right that the risk is probably not worth it for such a small reward. I still want to ask why it behaves this way as an academic question, though any explanation might become out of date in a future version.

Also yes indeed, I have been warned, any misdeeds are my own and I won't ask you to bail me out :)
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
why it behaves this way as an academic question, though any explanation might become out of date in a future version.

It behaves this way because the developers need a consistent way to identify disks, and they are not trying to generally solve a difficult problem for the benefit of all users everywhere, but rather to solve the problem for their limited use case. iXsystems develops TrueNAS for their TrueNAS hardware, hard drives have a label with the serial number on top, industry practices often include marking those serial numbers on the drive tray for front visibility, and that identifier is typically easily and reliably accessible from inside the OS. You need an identifier that can uniquely identify the drive, so that the NAS can identify when disks move around, and that the NAS can understand the inventory of available drives and not make catastrophic mistakes like thinking that /dev/da34 and /dev/da62 are different devices, when one is actually a secondary SAS appearance of the other. Because if it thinks they're separate devices, and it's used one, and thinks the other is free, horrible things *could* happen to your pool if it started to blank da62, killing da34 which is already part of a pool.

iXsystems is a small company, and there is neither a huge amount of idle engineering talent sitting around just waiting to tackle intractable issues like these in software just for the benefit of people wanting "alternative choices", nor are there good general solutions for these problems, which most frequently manifests in the form of people trying to hook up USB drives using bridges which all have the same serial number hard-coded.

iXsystems is focused instead on making a NAS for its hardware, and to the extent that you can create a box similar to theirs and submit to their appliance-based design, they have made their work available to you to enjoy for free.

any explanation might become out of date in a future version.

Unlikely, unless some BETTER identifier magically apparates. Generally, as members of the community, it's helpful to remember that this is a commercial PRODUCT and is made available for free. The reason for this is because we are beta-testers, bug-finders, and anything that is beyond what paying iX customers would need is dubious; the product is effectively out there on an "as-is" basis (from the viewpoint of your by-id request) but they are definitely interested in bugs and feature requests that could improve the product that they sell.

This doesn't mean you can't open a Jira ticket and prove me wrong. I'm happy to be wrong. But I've been here more than a decade and seen this for a long time. You are unlikely to get a detailed answer from iX if they reject your feature request, so I'm trying to do the courtesy of giving you that glimpse into the "why" of it.
 
Top