Register for the iXsystems Community to get an ad-free experience and exclusive discounts in our eBay Store.

How do I safely eject a drive mounted in a hot-swap bay?

Western Digital Drives - The Preferred Drives of FreeNAS and TrueNAS CORE
Status
Not open for further replies.

Spearfoot

He of the long foot
Moderator
Joined
May 13, 2015
Messages
2,478
My main system is housed in a Supermicro CSE-846 chassis equipped with 24 hot-swap bays, much like the unit shown in this picture:

cse-846.jpg

The most important pool on this server is a 6-disk RAIDZ2 array of 4TB HDDs containing ~2.3TB of data. I use replication to backup this data to my secondary FreeNAS server, and this backup is what I would rely on if the main FreeNAS server were to fail.

But I also use rsync to copy the data to another pool made up of a single 6TB disk. I have two of these 6TB disks configured with the same pool name, and I swap them weekly between the server and my fireproof safe. These disks are my last line of defense: if my shop were to burn down and destroy both of the FreeNAS servers -- perish the thought! -- I'd at least have some hope of recovering my data using the drive stored in the safe.

It's the process of swapping the two 6TB drives that lead me to ask the question posed in this thread. Until now, my procedure has been to update the data on the disk one last time, scrub it, detach it, power down the server, swap the drives, power up the server, and then import the volume on the new disk.

I would prefer to do this without power-cycling the server, but I don't want to pop the drives out if they're still spinning -- and I haven't found any foolproof set of FreeBSD commands guaranteed to spin down the drives. Perhaps my Google-foo is weak...

Am I unduly concerned about damaging the drives? Should I just remove the drive from it's bay and not worry about it?

Or are there one or more FreeBSD commands I should use to spin the drive down before I remove it from the chassis?

I'm hoping one of the FreeBSD gurus here on the forum will point me in the right direction. Thanks!
 

Stux

MVP
Joined
Jun 2, 2016
Messages
4,244
After offlining, I always eject the drives a touch... enough to power them down... wait for them to stop spinning... then pull.

If you pull it straight out you know you've messed up because the gyro tells you ;)

Perhaps its better to actually spin down the drives... but I never have. The ejection happens in a different plane to the head crash plane.
 
Last edited:

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
13,291
I always eject the drives a touch... enough to power them down... wait for them to stop spinning... then pull.
Ditto.
 

Spearfoot

He of the long foot
Moderator
Joined
May 13, 2015
Messages
2,478
Thanks, guys. I'm probably just over-thinking this. :rolleyes:

Anyway... I just finished burning-in a couple of new disks, so I've done some experimenting on them with the camcontrol command and I may have stumbled onto the solution: running camcontrol stop {device ID} seems to stop the drive and spin it down... but the system is loud enough that it's really hard to tell. I get 'Unit is not ready' when I run the 'Test Unit Ready' command ( camcontrol tur {device ID}), which seems like a good sign (see below). I'll report back later if I can confirm this.

In the meantime, I'm going to use camcontrol to stop the drives before I yank 'em out of the chassis.

Code:
root@bandit:~/scripts # camcontrol stop da14 -v
Unit stopped successfully
root@bandit:~/scripts # camcontrol tur da14 -v
Unit is not ready
(pass15:mps1:0:5:0): TEST UNIT READY. CDB: 00 00 00 00 00 00
(pass15:mps1:0:5:0): CAM status: SCSI Status Error
(pass15:mps1:0:5:0): SCSI status: Check Condition
(pass15:mps1:0:5:0): SCSI sense: NOT READY asc:4,2 (Logical unit not ready, initializing command required)
root@bandit:~/scripts # camcontrol start da14 -v
Unit started successfully
root@bandit:~/scripts # camcontrol tur da14 -v
Unit is ready
root@bandit:~/scripts #
 

Chris Moore

Hall of Famer
Joined
May 2, 2015
Messages
10,085
My main system is housed in a Supermicro CSE-846 chassis equipped with 24 hot-swap bays, much like the unit shown in this picture:

Am I unduly concerned about damaging the drives? Should I just remove the drive from it's bay and not worry about it?

Or are there one or more FreeBSD commands I should use to spin the drive down before I remove it from the chassis?

I'm hoping one of the FreeBSD gurus here on the forum will point me in the right direction. Thanks!
I have been working with servers and their hot swap drives since 1999 and I don't know of any system (BSD or other) that let you power a drive down with the exception of a couple of proprietary hardware RAID controllers.
The solution that Stux proposed is the one I have used from the start and it has not caused any problems I am aware of. However, most of the drives I remove are failed in some way already.
 

melloa

Wizard
Joined
May 22, 2016
Messages
1,748

Stux

MVP
Joined
Jun 2, 2016
Messages
4,244
My Icydock (5in3) in my backup system has power buttons. One for each bay, so I turn off the bays power, then eject.

Since it's trayless it's eject action is a bit different.
 
Status
Not open for further replies.
Top