From owner-freebsd-questions@FreeBSD.ORG Wed May 15 00:10:44 2013 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 38D29BE4 for ; Wed, 15 May 2013 00:10:44 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mx01.qsc.de (mx01.qsc.de [213.148.129.14]) by mx1.freebsd.org (Postfix) with ESMTP id DEC128BE for ; Wed, 15 May 2013 00:10:43 +0000 (UTC) Received: from r56.edvax.de (port-92-195-6-62.dynamic.qsc.de [92.195.6.62]) by mx01.qsc.de (Postfix) with ESMTP id 8C3D23D0C7; Wed, 15 May 2013 02:10:42 +0200 (CEST) Received: from r56.edvax.de (localhost [127.0.0.1]) by r56.edvax.de (8.14.5/8.14.5) with SMTP id r4F0ApFd003818; Wed, 15 May 2013 02:10:52 +0200 (CEST) (envelope-from freebsd@edvax.de) Date: Wed, 15 May 2013 02:10:51 +0200 From: Polytropon To: "Ronald F. Guilmette" Subject: Re: Hot Swapping SATA drive? Message-Id: <20130515021051.6df78597.freebsd@edvax.de> In-Reply-To: <9749.1368574451@server1.tristatelogic.com> References: <20130514144721.aa321c25.freebsd@edvax.de> <9749.1368574451@server1.tristatelogic.com> Organization: EDVAX X-Mailer: Sylpheed 3.1.1 (GTK+ 2.24.5; i386-portbld-freebsd8.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: Polytropon List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 May 2013 00:10:44 -0000 On Tue, 14 May 2013 16:34:11 -0700, Ronald F. Guilmette wrote: > > In message <20130514144721.aa321c25.freebsd@edvax.de>, > Polytropon wrote: > > >I've been using SCSI "hot swap" devices for many years, and > >they usually required a re-scan of the bus. The same often > >works for USB-connected devices which also use CAM, and maybe > >SATA and eSATA also support it today? > > OK, so what command should I use when I plug a drive in? Would that be > "camcontrol rescan foo" where "foo" is something like /dev/ada0? No. You use the typical "SCSI-like device notation", bus:unit:lun, for example 0:1:0, or "all" for all buses and devices. > I'm > guessing that that can't be correct, because ada0 is an actual drive. > So what is the "device id" for the bus itself? With "camcontrol devlist", you can get a list that will show you what devices have been recognized and how the bus:unit:lun corresponds to the device files. Example: $ camcontrol devlist at scbus0 target 0 lun 0 (pass0,cd0) at scbus0 target 1 lun 0 (pass1,cd1) at scbus3 target 0 lun 0 (pass2,da0) at scbus3 target 0 lun 1 (pass3,da1) at scbus3 target 0 lun 2 (pass4,da2) at scbus4 target 0 lun 0 (pass5,da3) The disk you're attaching will probably be something like the entries for the USB disk (last line). > >Again, it may be nice (to the system) to detach the ATA device > >from the bus; see "man atacontrol" (and "man camcontrol" in > >comparison) for the proper command to do this. From the "electrical > >point of view", there should be no problem. > > I am a firm believer in being nice. I just need to know the proper > command. Would that be "camcontrol stop foo" ? Yes. You can use the "start" and "stop" commands like the "attach" and "detach" commands for atacontrol. Additionally, you can use "tur" for "test (if) unit (is) ready", and "readcap" to print the capabilities. Also "reset" and "rescan" are helpful. See "man camcontrol" for details about what those commands do, and how to properly call them. In most cases, # camcontrol will be the correct form. > >The only thing that might be worth looking at in the CMOS setup > >would be the "method" of the driver, making the device come up > >as da0 (for example) or ada0, depending if EHCI or XHCI can be > >selected. > > Ummm... my new little SATA plug-in bay is strictly SATA... not eSATA, > and *definitely* not USB, so I think that EHCI and/or XHCI are probably > irrelevant. Those are strictly USB things, no? I'm not fully sure about that, but I assume you're right, if the manufacturer has properly glued the SATA ports onto the mainboard instead of creating some strange abomination of a "SATA through USB something". :-) -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...