preventing deadlocks in snapshot directories - unexplained
olli at lurza.secnetix.de
Fri Jan 13 05:34:46 PST 2006
user <user at dhp.com> wrote:
> I have asked this before, but nobody answered ...
Many people tend to be reluctant answering questions
from anonymous users (or they don't bother reading their
questions at all).
> If you have multiple snapshots, how do you segregate them in order to
> avoid the deadlocks that the ".snap" directory is supposed to fix ?
As far as I know, using that directory is just a matter of
convention. You can place snapshots anywhere else, and it
doesn't make a difference. The only thing special about
".snap" is that it is created by default by newfs(1), and
it is expected to exist by the snapshot support of the
dump(8) and fsck(8) tools (for dumping live file systems
and background fsck, respectively).
> I understand why a snapshot is created in (mount)/.snap - but what if I
> have multiple snapshots running simultaneously ?
It doesn't make a difference.
> cd /.snap
> rm -rf snap3
> the _entire_ /.snap directory locks up until that command completes.
Well, yes, certain file system operations are blocked
until the removal of the snapshot is complete, which
can take quite some time, depending on the size of the
file system, because a lot of data has to be updated.
So, that blocking is to be expected (unfortunately).
> So, this leads me to conclude that actually, I need to do this:
No, it doesn't make a difference. As far as I know, the
snapshot code doesn't care about the directory name where
the snapshot files are placed.
Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing
Dienstleistungen mit Schwerpunkt FreeBSD: http://www.secnetix.de/bsd
Any opinions expressed in this message may be personal to the author
and may not necessarily reflect the opinions of secnetix in any way.
(On the statement print "42 monkeys" + "1 snake":) By the way,
both perl and Python get this wrong. Perl gives 43 and Python
gives "42 monkeys1 snake", when the answer is clearly "41 monkeys
and 1 fat snake". -- Jim Fulton
More information about the freebsd-fs