From owner-freebsd-questions@freebsd.org Thu Nov 29 00:41:40 2018 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 744941142DC5 for ; Thu, 29 Nov 2018 00:41:40 +0000 (UTC) (envelope-from jd1008@gmail.com) Received: from mail-it1-x132.google.com (mail-it1-x132.google.com [IPv6:2607:f8b0:4864:20::132]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C95B78F057 for ; Thu, 29 Nov 2018 00:41:39 +0000 (UTC) (envelope-from jd1008@gmail.com) Received: by mail-it1-x132.google.com with SMTP id z7so989812iti.0 for ; Wed, 28 Nov 2018 16:41:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-transfer-encoding; bh=amMU6fO8JB5jf0k/p/RrNeSoMKxOgxLywWCAKGZkc/M=; b=WXCmi+FLwPi8MuagKGdkltyL+xiMR1yuwSKamuQuBcW87hG6vPCMAnQvYUUb6ztAn+ vVSVScE6lYftVWgS4iJ0iqqgoYu8gv3AW55vhX1v/L50VIsZH2HMVUUks4Ggq4lSBQO2 oMti8B6EmCRpvUiz3M1FzG88x1+2/tlzVQtXJQY9LLJaOuNfECruxDAmXD3FrYEn5ZAW MxQfB8cAiSfezuzudgK157cIz4PADDkSPtlGKJVxfl/ILs5dRNgjnkV0uefckFrF/NnZ VGxp0ShZxWToKD+yIJkVSdcqbYYFQ42GPHuoZ46nW6y/Ko0kkam8BpHPoP2o7e4YCB1/ wmiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-transfer-encoding; bh=amMU6fO8JB5jf0k/p/RrNeSoMKxOgxLywWCAKGZkc/M=; b=WYVd11I8f2OjKxtuqiFdASLW20GIbfvNPTye8f41NqM1kC2JXUkd3dPbEyOZpYPonW k9FUIilwRstnYJQjgNbFGAAdx0M8nOs4H7wIF9QbQh7e6B4mT6cXRDCbVOX/bEMXw+aD LOOrfr87kxg2B19ZtxK1pHqU0RQicty+4SogxBuqi3mrldJKRNEwAvyjhf8sMaEH/4x9 2bxO97ovG6fZIEP5u7TYkbVVhGtrBAViFOXQMsZRrnal5+3TeQBRM37zwwxnymQIyg1u FKTZYJGHELEHy4Z1eTt25LaBRNY2RvGNwkUBV+tYrS5RsplGtE4hXhIqJzM7ipQ93kEB MMEg== X-Gm-Message-State: AA+aEWbq5ExlHmMQaRLUR+prL7QOK4zk42EhJfayru/n77LliH3RkEPu CAd872Olvt5iB3gkNUriAW9n425r X-Google-Smtp-Source: AFSGD/XBbr9PxiGDYGTh0TY9goQ0wtnzH4fCcAy4DBRbyJUxGjGxUorwaLrihc4LcKWsB8TDwuSkhg== X-Received: by 2002:a05:660c:5d4:: with SMTP id x20mr4960988itk.143.1543452098850; Wed, 28 Nov 2018 16:41:38 -0800 (PST) Received: from localhost.localdomain (50-243-4-3-static.hfc.comcastbusiness.net. [50.243.4.3]) by smtp.googlemail.com with ESMTPSA id 21sm75043iou.79.2018.11.28.16.41.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 28 Nov 2018 16:41:37 -0800 (PST) Message-ID: <5BFF35DD.8050808@gmail.com> Date: Wed, 28 Nov 2018 17:42:05 -0700 From: JD User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Markus Hoenicka , freebsd-questions@freebsd.org Subject: Re: ROX-Filer: overwriting a file on an USB drive truncates it References: <4ee20fc51b13465edcec6d8456be7cf0@mhoenicka.de> In-Reply-To: <4ee20fc51b13465edcec6d8456be7cf0@mhoenicka.de> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: C95B78F057 X-Spamd-Result: default: False [-5.80 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-questions@freebsd.org]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; RCVD_IN_DNSWL_NONE(0.00)[2.3.1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; MID_RHS_MATCH_FROM(0.00)[]; IP_SCORE(-1.82)[ip: (-5.83), ipnet: 2607:f8b0::/32(-1.80), asn: 15169(-1.36), country: US(-0.09)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 00:41:40 -0000 On 11/28/2018 05:23 PM, Markus Hoenicka wrote: > Hi, > > I've recently upgraded my laptop to: > > FreeBSD wombat 11.2-RELEASE-p4 FreeBSD 11.2-RELEASE-p4 #0: Thu Sep 27 > 08:16:24 UTC 2018 > root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC amd64 > > I've also updated all installed packages. > > I keep running into a nasty file copying bug that does not seem to > have occurred previously. Result is that overwriting an existing file > on an USB drive causes this file to be truncated instead of being > overwritten, which means data loss. > > How to reproduce: > > After logging in, I start an Xfce session manually: > > startxfce4 --with-ck-launch > > mount stick in an xterm, as per handbook. Note that I've set up user > mounting of USB drives: > > mount -t msdosfs -o -m=644,-M=755 /dev/da0s1 /stick/markus > > open source directory (on hard drive) in a ROX-Filer window > open target directory (on usb drive) in another ROX-Filer window > > drag&drop a file from source over an existing copy on target > > dialog box asks if it is ok to overwrite which I acknowledge > > ROX-Filer window shows the correct file size immediately after > copying, and after rescanning the directory. ls -al > /stick/markus/targetdir also shows the correct file size at this point. > > umount /stick/markus fails because the device is busy. fstat shows > that the ROX-Filer process keeps it busy > > now I can either use umount -f /stick/markus to forcibly unmount the > stick, or I log out of the X session and then use umount /stick/markus > without problems > > then mount the stick again as above, or try on a different computer > > ls -al /stick/markus/targetdir shows a target file size of zero. > > It appears that the new data are never flushed to the disk. I've even > tried to run umount /stick/markus before umount -f /stick/markus, as > this should perform a flush according to the umount man page. This bug > appears to be specific to ROX-Filer. I could not reproduce this using > Thunar, or plain ol' cp. This bug also appears to be specific to USB > target drives, as I cannot reproduce this when overwriting files on > the hard drive. I do not think the problem is related to a faulty file > system on the target drive as I can reproduce this with just about any > thumbdrive and external disk lying around. > > I've been using ROX-Filer for ages, but I've noticed that neither > mailing lists nor bug tracker seem to be active. Is it about time to > move on? > > thanks > Markus > Hi Markus, the short of the long .... I have seen this problem man many times. I had found out that the usb stick was a 1X speed stick, and it took the FS and io drivers below it a long time to allocate the free blocks needed to write out the new data. The new blocks are allocated from the list of "oldest blocks on the free list". That is how a flash fs blocks are handled. The old blocks are released to the free list. Thus a 1X flash stick would take forever to do this and receive all the data that is in the dirty memory blocks. I am not saying that YOUR flash device is 1X device. Merely stating that perhaps you are being impatient????