From owner-freebsd-questions@FreeBSD.ORG Tue Dec 11 08:40:20 2012 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DE2AADFF for ; Tue, 11 Dec 2012 08:40:20 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mx02.qsc.de (mx02.qsc.de [213.148.130.14]) by mx1.freebsd.org (Postfix) with ESMTP id 98CA78FC1D for ; Tue, 11 Dec 2012 08:40:19 +0000 (UTC) Received: from r56.edvax.de (port-92-195-51-39.dynamic.qsc.de [92.195.51.39]) by mx02.qsc.de (Postfix) with ESMTP id 86B12276B3; Tue, 11 Dec 2012 09:32:42 +0100 (CET) Received: from r56.edvax.de (localhost [127.0.0.1]) by r56.edvax.de (8.14.5/8.14.5) with SMTP id qBB8WinR002328; Tue, 11 Dec 2012 09:32:44 +0100 (CET) (envelope-from freebsd@edvax.de) Date: Tue, 11 Dec 2012 09:32:44 +0100 From: Polytropon To: tak.official@gmail.com Subject: Re: mount -u effects Message-Id: <20121211093244.b507db13.freebsd@edvax.de> In-Reply-To: References: <20121211084354.a3b3fdd8.freebsd@edvax.de> 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: Tue, 11 Dec 2012 08:40:20 -0000 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, ...