From owner-freebsd-questions@freebsd.org Sat Aug 29 20:08:13 2015 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67D1C9C567F for ; Sat, 29 Aug 2015 20:08:13 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mx01.qsc.de (mx01.qsc.de [213.148.129.14]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2D4FFE92 for ; Sat, 29 Aug 2015 20:08:12 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from r56.edvax.de (port-92-195-125-111.dynamic.qsc.de [92.195.125.111]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx01.qsc.de (Postfix) with ESMTPS id DB6803CF58; Sat, 29 Aug 2015 22:08:09 +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 t7TK891p002583; Sat, 29 Aug 2015 22:08:09 +0200 (CEST) (envelope-from freebsd@edvax.de) Date: Sat, 29 Aug 2015 22:08:09 +0200 From: Polytropon To: Chris Stankevitz Cc: Quartz , freebsd-questions Subject: Re: Stop using a SATA drive Message-Id: <20150829220809.438bbf30.freebsd@edvax.de> In-Reply-To: References: <20150824214252.53aa04c6.freebsd@edvax.de> <55DEF869.1010202@sneakertech.com> <55DEFB5A.3080408@FreeBSD.org> <55DEFC74.3040609@sneakertech.com> <20150828000602.b9a288a8.freebsd@edvax.de> Reply-To: Polytropon 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 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Aug 2015 20:08:13 -0000 On Fri, 28 Aug 2015 13:17:58 -0700, Chris Stankevitz wrote: > On Thu, Aug 27, 2015 at 3:06 PM, Polytropon wrote: > > But on the other hand, what's wrong with _ignoring_ a > > device file you don't want to have anything to do with? > > From my OP: > > > I imagine I would feel confident that nothing is using it > > if the drive disappeared from /dev > > My only interest in the device file going away was that I would > suddenly become confident that it is not in use (e.g. by smartd, > gpart, etc). If there is another way to become confident that a > device is not in use then that would be okay too. > > "Device file disappearing" would only be useful to me if it happened > before the drive was "ejected", not after. The remaining question is: Is it technically valid to remove a device special file from the devfs file system corresponding to a device that currently is not in use (anymore), but is _present_ (attached to the system in some way)? You can _almost_ be sure that a storage device is not in use when it is not mounted. The only case where this is not the case is when you're accessing raw devices, for example when making a backup from (or to) an unmounted partition. In this case, paying attention is required. :-) So relying on mount itself is not sufficient. You'd have to query the device driver for pending actions (like reads or writes). Only when there's noting to be done, device removal should be safe. -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...