Date: Mon, 24 Aug 2015 21:42:52 +0200 From: Polytropon <freebsd@edvax.de> To: Chris Stankevitz <chrisstankevitz@gmail.com> Cc: freebsd-questions <freebsd-questions@freebsd.org> Subject: Re: Stop using a SATA drive Message-ID: <20150824214252.53aa04c6.freebsd@edvax.de> In-Reply-To: <CAPi0psvT5aaHR7kU%2B28qwVDdutyMn7LjhFUGZRWctz4gGfgvgw@mail.gmail.com> References: <CAPi0psvT5aaHR7kU%2B28qwVDdutyMn7LjhFUGZRWctz4gGfgvgw@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 24 Aug 2015 11:52:49 -0700, Chris Stankevitz wrote: > How can I tell FreeBSD to stop using a SATA drive? I'd like to pull > it from my machine (while the machine is running) but I'd like to be > confident that nothing is using it. > > I imagine I would feel confident that nothing is using it if the drive > disappeared from /dev and it stopped spinning. "camcontrol stop" did > not accomplish this (that was a WAG -- camcontrol man page says that > 'stop' only sends the 0x1B command whatever that means). > > Please let me know if you can imagine a better place for me to ask > this question or learn more about the process. Ye olde atacontrol had a "detach" option. Its equivalent is "camcontrol stop" which you have discovered. This should be sufficient. The disk will not be accessed by the system anymore. In this state, it's safe to detach power and data lines. Removing power will (what a surprise!) make the drive stop spinning and also park the heads. Then it can safely be moved mechanically. St stopping the disk would probably only work for those that have a SCSI command that _does_ this to the drive. As far as I know, SATA drives don't have this ability. The device node disappearing from /dev is achieved by losening the data connection (which is the same as if removing the power). Both things are probably hard to achieve in hardware. I could imagine with a power supply where you can - by software! - address the power lines, or mainboards / controllers that allow you to address the SATA ports and make them disappear... However, I'm doing this with SATA and external USB disks a lot: Issue "sync", call umount, give it some seconds to actually complete (!) those tasks, and then power it off (external power supply off for USB, combined plug removed from SATA disk). No problems so far. The features you're implicitely asking for do not exist in x86 commodity hardware, as far as I know. More expensive and non-consumer platforms usually have those features. Look for midrange and mainframe systems. :-) -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20150824214252.53aa04c6.freebsd>