Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 11 Dec 2012 09:32:44 +0100
From:      Polytropon <freebsd@edvax.de>
To:        tak.official@gmail.com
Cc:        freebsd-questions@freebsd.org
Subject:   Re: mount -u effects
Message-ID:  <20121211093244.b507db13.freebsd@edvax.de>
In-Reply-To: <CAPkyVLxEy2KeagBJ3vJ6rUe-7GcTqGp9i0ZiB7OfTXbsOjAfaA@mail.gmail.com>
References:  <CAPkyVLzO1yG2VS_FNarxn-UNaJ=Wu%2B5RfDw%2BysmoTUfT=5eoSA@mail.gmail.com> <20121211084354.a3b3fdd8.freebsd@edvax.de> <CAPkyVLxEy2KeagBJ3vJ6rUe-7GcTqGp9i0ZiB7OfTXbsOjAfaA@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 11 Dec 2012 11:39:24 +0330, takCoder wrote:
> but, how to become sure my write operations are completely finished?? by
> obtaining some sort of sleep time before my restart command in my upgrade
> shell for example? or there are other special ways to do so?

Basically, no user action is needed. If you perform an umount
(or change back to -o ro), all remaining buffers will be
flushed, so writes are eventually performed at this time.
If such an operation hasn't been finished yet, mount will
complain, and you have some time to wait and try again. :-)

In case you're using -f (force), this specific check will
not be performed, so it shouldn't be used.

Similarly, the "sync" command will cause all buffers to be
flushed. The file system driver will then let the device
driver perform the operation, which should be finished in
finite time (usually below a second). See "man sync" for
details.

You could always use the "lsof" command to check if there
are still files open for writing on the respective file
system.

At the time you're getting your command prompt back, the
write operation is likely to be finished. Add some time typing
the mount command, and you should be fine. :-)



-- 
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?20121211093244.b507db13.freebsd>