From owner-freebsd-usb@FreeBSD.ORG Thu Sep 6 13:18:23 2012 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5DEAD106566C for ; Thu, 6 Sep 2012 13:18:23 +0000 (UTC) (envelope-from erikses@gmail.com) Received: from mail-ee0-f54.google.com (mail-ee0-f54.google.com [74.125.83.54]) by mx1.freebsd.org (Postfix) with ESMTP id E248F8FC15 for ; Thu, 6 Sep 2012 13:18:22 +0000 (UTC) Received: by eeke52 with SMTP id e52so809095eek.13 for ; Thu, 06 Sep 2012 06:18:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=Uw0cMuRgBaFnhq41QyeejjrlfPzJi6jMRRncDqOqaOU=; b=apGKCK7ltUBUTgJAloMO4ejl2V8GZEkxJIHUMT1L/2rtz+vKgQBG9oop9Rsx/1BbpV wxqf3hScraG4hZl4mZWMSVCl4AlO3bXr2O/wwvPJc4Dnb1fkoG4XcjGH7L6gjAZv9lIG FIqfTb968N59oSX7B+EpV4lsy6YQW5EV2163KVP4PwqBLgN61MrArROZy7A3HYGQBpQc EKESi51+Qw+jxSiR9pX8fLXogo9eaPhI/TvLPmoPElnxYj9aerJFz3hXS20yLszWWdNA thQg/hT/YYVpjh6gM9U9bLeaeQOztLIWiPiEW9WeF2+Ku6dDuUe4veag2hpid9e2BsjB 2pRg== Received: by 10.14.184.134 with SMTP id s6mr2827335eem.46.1346937501708; Thu, 06 Sep 2012 06:18:21 -0700 (PDT) Received: from [192.168.16.117] (r5.toya.net.pl. [85.89.187.38]) by mx.google.com with ESMTPS id i41sm5942683eem.7.2012.09.06.06.18.19 (version=SSLv3 cipher=OTHER); Thu, 06 Sep 2012 06:18:20 -0700 (PDT) Message-ID: <5048A29A.80305@gmail.com> Date: Thu, 06 Sep 2012 15:18:18 +0200 From: "Stanislaw W." User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120714 Thunderbird/14.0 MIME-Version: 1.0 To: freebsd-usb@freebsd.org References: <20120904235557.7ca40fc8@epc.localdomain> <20120906014753.2aaa126f@asd.localdomain> In-Reply-To: <20120906014753.2aaa126f@asd.localdomain> Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 8bit Cc: Subject: Re: how to force my 32G usb pendrive to flush write cache in RAM it has? X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Sep 2012 13:18:23 -0000 W dniu 05.09.2012 23:47, Anatoly pisze: > В Tue, 4 Sep 2012 23:55:57 +0400 > Anatoly <> пишет: > >> Hello, >> I have a problem with my new 32G pendrive: >> >> da1: Removable Direct Access SCSI-2 >> device da1: 40.000MB/s transfers >> da1: 30640MB (62750720 512 byte sectors: 255H 63S/T 3906C) >> >> I'm using fat32 partition on it. >> To make problem occur I can do following things: >> 1) write a file about 5MB in size on that partition >> 2) unmount >> 3) unplug pendrive (so it loses power) >> 4) plug it again >> 5) mount >> Now I can see that the end of file is corrupted. >> >> Poblem never occurs when I do: >> 1) write a file about 5MB in size on that partition >> 2) unmount >> 3) mount >> Also, problem doesn't occur if I'll wait for more than ~10 minutes >> before unplugging pendrive. >> >> So it seems to me that this pendrive has internal write cache in RAM >> that needs to be flushed before pendrive loses power. >> Problem never occurs with Windows. As I click "remove", windows >> somehow "correctly shutdowns" pendrive so it's LED goes off (Unlike >> if i just unmount, when the LED stays on) >> >> What can I do to get cache flushed before unpugging, turn that write >> cache off, or any other suggestions? >> I've tried camcontrol stop and camcontrol eject with no >> success >> I using FreeBSD 7.3 with generic kernel here > I've found solution: > http://lists.freebsd.org/pipermail/freebsd-usb/2008-March/004677.html > that 'upower' utility allows to suspend pendrive, and I get cache > flushed (And LED goes off): > upower /dev/usb0 2 suspend > _______________________________________________ > freebsd-usb@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-usb > To unsubscribe, send any mail to "freebsd-usb-unsubscribe@freebsd.org" > To flush cache You can also use sync(8) Stanislaw.