Advice please - Replacing/upgrading SATA Controller

muzmurray

Cadet
Joined
Jan 21, 2021
Messages
3
Hello all, I need some advice please as I am a relative TrueNAS newbie. If this explanation is TL;DR please jump to the bottom :smile:
I did search on this question before posting, but only found one similar question from 2011 that had no answers, so here goes.....

I have an Intel motherboard based machine that I have been running TrueNAS Core 12 on for quite a while now, this was intended as an experiment, but has now turned into my main storage option. Unfortunately I have been having some reported drive failure problems recently that do not appear to be the actual drives being faulty.
The machine has a Crucial M4 SSD attached to a motherboard SATA port used as the Boot/OS drive, plus 4 x 2TB Seagate Baracuda drives attached as a ZFS pool via a no-name generic PCIe SATA controller. The system randomly shows SMART failure problems and occasional red/write errors degrading the pool and/or faultin a drive. I have tested the drives and they don't appear to be faulty, so I am suspecting the PCIe SATA card is the culprit.
I now realise using a generic chinese PCIe SATA adapter is a big no-no and I have purchased a LSI 9211-4i (reflashed to TI mode) to replace it.

My question is: can I do a direct swap of the different SATA controllers (if I keep the port allocations the same), or will I lose the data and need to completely re-create the ZFS pool?
How does TrueNas/ZFS identify discrete physical drives?

Many thanks,
Muz
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
I did search on this question before posting, but only found one similar question from 2011 that had no answers,

Quite frankly, I don't think you searched very hard. I realize that the search function sucks if you don't know what to ask it, but even so.. The question is asked at least weekly, and the answer is basically "just do it".

can I do a direct swap of the different SATA controllers (if I keep the port allocations the same), or will I lose the data and need to completely re-create the ZFS pool?
How does TrueNas/ZFS identify discrete physical drives?

FreeBSD is responsible for attaching the disks, and while, yes, it does have hardwired device ID's that could be a problem if you used them (like "da3" and "da4" can switch places if you switch drives), modern developers typically use abstractions to avoid those 1980's-class problems. In the case of TrueNAS, gptid's are used to identify your disk partitions, so your disks have a partition named with a long hex string on them, which is the only thing ZFS knows about. Do an "ls /dev/gptid" on your NAS to see them. Then type "zpool status" to see how ZFS uses that. So it doesn't matter if it moves from da3 to ada1 as long as the system sees the gptid partition and ZFS uses it that way. And that's the point of the abstraction layer. You can move your disks around without it being a problem.

In particular, if you move from AHCI SATA, where your devices are recognized as "adaX" devices, to an LSI HBA where they are recognized as "daX" devices under the MPR driver, it doesn't matter and some of us do this occasionally as we change out the chassis that runs a pool.
 
Top