I am running TrueNAS Scale Dragonfish-24.04.2.2. In my system, I have some hot swap/hot plug bays for adding/removing 3.5" backup HDDs. I would prefer it if I could power off these disks before ejecting them, but I don’t see any way to do this in the UI.
Is there any way to power off an HDD in the UI or shell?
I could also be convinced that there are no concerns with ejecting an HDD while it’s powered on. I did enable Hot Plug in the BIOS for the hot swap/hot plug bays in question.
You can offline the drive from ZFS’ point of view but, as already pointed out, a hot-swapped drive is by definition powered on, and there are obvious concerns with unplugging a powered interface. Make sure your hot-swap bays have proper capacitors.
And, for the sake of safety, do cold-swaps whenever possible and practical.
Eh, I agree with the removal aspect, however when inserting a drive, depending on the hot swap tray design, it is possible on some to have the SATA power connector not line up properly and then the person installs it, POW! There goes a power connector, possibly the power supply, and you know, just nothing good.
If you must hot-swap, “MUST”, then I would assume this is for a HA server and you have high quality components so you can not cause a drive installation misalignment. Then in that situation, sure you can.
I highly recommend cold swapping as it is a much safer operation.
There is no way to secure the power to a drive unless you have a drive bay that has individual power on/off switches. I have a 5 drive bay that works that way, so it isn’t completely a hot swap as the system is still operational, however it is a much safer operation. I no longer use that drive bay, it is collecting dust somewhere.
I blew up that HDD in a supermicro system, and the slot was dead as well. Thankfully I had another bunch of open slots I could use, for another new hard drive. I thought the tolerances were nice and tight. Guess I found a flaw in my thinking, and shitting my pants was no fun either.
I don’t actually have them yet. I was testing with an old, blank drive. However, I did take a look at the drives I intend to buy (Western Digital Red Pro), and I don’t see any mention of hot swap support.
I think I read somewhere that SATA drives should support hot swap per the spec and that the confusion comes from the fact (or belief) that the older IDE drives did not support this. However, I have no idea yet if any of that is true.
I get that, but it would still be nice to have. The difference is that ejecting them while the power on is moving the drive while the platters are still spinning. I do the same thing with my USB drives - I power them off in my OS before I eject and physically move them.
Of course, I could shut the whole system down, but it would save a good amount of time if I could just power the drive off in TrueNAS and avoid that.
Understood. I will probably just do a full system shutdown if there’s no way to power off the disk in TrueNAS. I’m just trying to avoid that because booting up, decrypting all of my datasets, and starting up my VMs is something I’d like to avoid if I can.
I guess my ultimate wish here is a way to turn power on and off to a SATA port in TrueNAS. With such a feature, I could do the following without having to shut down my entire system:
Insert a drive “cold” without the risks you describe, then power it on in the TrueNAS UI
Power off a drive and remove it after it has stopped moving
This is important to me because I don’t want to allocate the funds necessary to build a second TrueNAS system for backup purposes. Therefore, I intend to use large internal HDDs (I don’t trust removable USB drives and they’re too small anyway). In this case, when I want to prepare an offsite backup, I can just pop in the drive, mount it, run the backup, remove it, and take it offsite.
The drives are designed to park the heads immediately upon power loss, so no issue there. SATA connectors, the power lines are shorter than the data lines, this means power is removed before the data lines are disconnected. And the reverse is true for inserting a drive.
The tricky part, is any data being written to the drive, regardless of if the drive is good or bad, when you start to remove the drive? That is where it would be good to Offline the drive in the GUI first.
But still, highly recommend shutting the system down.