Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 29 Aug 2015 22:08:09 +0200
From:      Polytropon <freebsd@edvax.de>
To:        Chris Stankevitz <chrisstankevitz@gmail.com>
Cc:        Quartz <quartz@sneakertech.com>, freebsd-questions <freebsd-questions@freebsd.org>
Subject:   Re: Stop using a SATA drive
Message-ID:  <20150829220809.438bbf30.freebsd@edvax.de>
In-Reply-To: <CAPi0psvMcrHKCQK9kBSacMmNie_042q9RQtKit6k4dvwA0GJQg@mail.gmail.com>
References:  <CAPi0psvT5aaHR7kU%2B28qwVDdutyMn7LjhFUGZRWctz4gGfgvgw@mail.gmail.com> <20150824214252.53aa04c6.freebsd@edvax.de> <55DEF869.1010202@sneakertech.com> <55DEFB5A.3080408@FreeBSD.org> <55DEFC74.3040609@sneakertech.com> <20150828000602.b9a288a8.freebsd@edvax.de> <CAPi0psvMcrHKCQK9kBSacMmNie_042q9RQtKit6k4dvwA0GJQg@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 28 Aug 2015 13:17:58 -0700, Chris Stankevitz wrote:
> On Thu, Aug 27, 2015 at 3:06 PM, Polytropon <freebsd@edvax.de> 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, ...



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20150829220809.438bbf30.freebsd>