From owner-freebsd-questions@FreeBSD.ORG Sat Dec 24 12:09:22 2011 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 55311106564A for ; Sat, 24 Dec 2011 12:09:22 +0000 (UTC) (envelope-from rsmith@xs4all.nl) Received: from smtp-vbr16.xs4all.nl (smtp-vbr16.xs4all.nl [194.109.24.36]) by mx1.freebsd.org (Postfix) with ESMTP id D179C8FC14 for ; Sat, 24 Dec 2011 12:09:21 +0000 (UTC) Received: from slackbox.erewhon.net (slackbox.xs4all.nl [213.84.242.160]) by smtp-vbr16.xs4all.nl (8.13.8/8.13.8) with ESMTP id pBOC8o3A047928; Sat, 24 Dec 2011 13:08:50 +0100 (CET) (envelope-from rsmith@xs4all.nl) Received: by slackbox.erewhon.net (Postfix, from userid 1001) id EE67EBACE; Sat, 24 Dec 2011 13:08:49 +0100 (CET) Date: Sat, 24 Dec 2011 13:08:49 +0100 From: Roland Smith To: Da Rock Message-ID: <20111224120849.GA40495@slackbox.erewhon.net> References: <4EF4010B.5040704@herveybayaustralia.com.au> <20111223142252.GC660@slackbox.erewhon.net> <4EF49DDB.2060609@herveybayaustralia.com.au> <20111223173139.GA7648@slackbox.erewhon.net> <4EF4FAAA.1020603@herveybayaustralia.com.au> <20111223232102.GA20961@slackbox.erewhon.net> <4EF51572.4060507@herveybayaustralia.com.au> <20111224013458.GA25515@slackbox.erewhon.net> <4EF53795.1090409@herveybayaustralia.com.au> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Q68bSM7Ycu6FN28Q" Content-Disposition: inline In-Reply-To: <4EF53795.1090409@herveybayaustralia.com.au> X-GPG-Fingerprint: 1A2B 477F 9970 BA3C 2914 B7CE 1277 EFB0 C321 A725 X-GPG-Key: http://www.xs4all.nl/~rsmith/pubkey.txt X-GPG-Notice: If this message is not signed, don't assume I sent it! User-Agent: Mutt/1.5.21 (2010-09-15) X-Virus-Scanned: by XS4ALL Virus Scanner Cc: freebsd-questions@freebsd.org Subject: Re: PolicyKit confusion X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Dec 2011 12:09:22 -0000 --Q68bSM7Ycu6FN28Q Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Dec 24, 2011 at 12:23:17PM +1000, Da Rock wrote: > On 12/24/11 11:34, Roland Smith wrote: > > On Sat, Dec 24, 2011 at 09:57:38AM +1000, Da Rock wrote: > >>> FreeBSD be default already does buffering in the VFS layer (unless yo= u turn > >>> that off). I don't think that adding more buffering would help. It mi= ght even > >>> make matters worse. If data is buffered and not immediately written t= o the USB > >>> stick, it will show no activity. This might even give the user a false > >>> impression it is finished... > >> That there is exactly the problem. Any way to prevent that though? > > Yes. Using the '-o sync' option with mount. To the best of my understan= ding > > that means that a write action will be executed immediately and that wr= ite(2) > > will not return until it is finished. > Just discovered something: what about async as an option? The major=20 > problem with async is on UFS+SU - the SU's get in the road and can=20 I've had problems with filesystems becoming inconsistent with softupdates. I've disabled them on most filesystems.=20 > result in inconsistencies. But vfat is another kettle of fish altogether. The mount(8) manual warns that async is dangerous because it doesn't guaran= tee that the fs structure on disk stays consistent. The other side of the coin = is (as you say) that vfat doesn't have much of a structure. :-) =20 > I just had a brainwave and looked it up, after a google or two and=20 > reading the mount_msdosfs man page it is possible; but is it a solution?= =20 > The writes are done sequentially (I think), and the app can move on=20 > while the system writes the disk. Unless I'm missing something here... In my script to mount USB drives I use the following options for mount_msdo= sfs:=20 "-o noatime -o sync -o noexec -o nosuid" And yes, that will block write calls until they're truely done. But OTOH, if you use async, an umount will block until all data is written. So it is a question of waiting now or waiting later. ;-) Personally I like the security and consistency that -o sync brings. Since I mostly use cp from an xterm to copy things to/from USB disks, it doesn't bother me when is stays busy a wh= ile longer. Roland --=20 R.F.Smith http://www.xs4all.nl/~rsmith/ [plain text _non-HTML_ PGP/GnuPG encrypted/signed email much appreciated] pgp: 1A2B 477F 9970 BA3C 2914 B7CE 1277 EFB0 C321 A725 (KeyID: C321A725) --Q68bSM7Ycu6FN28Q Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAk71wNEACgkQEnfvsMMhpyUI8ACeKd8Jzr7pgKGNXAQYtWe8Qq2P 86gAoJNKLiUGWXDSx6Ap3rEj9GNXB+U1 =cmbL -----END PGP SIGNATURE----- --Q68bSM7Ycu6FN28Q--