From owner-freebsd-questions@FreeBSD.ORG Thu Dec 8 15:57:17 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 0377B1065746 for ; Thu, 8 Dec 2011 15:57:17 +0000 (UTC) (envelope-from dan@dan.emsphone.com) Received: from email2.allantgroup.com (email2.emsphone.com [199.67.51.116]) by mx1.freebsd.org (Postfix) with ESMTP id 990F88FC14 for ; Thu, 8 Dec 2011 15:57:16 +0000 (UTC) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by email2.allantgroup.com (8.14.4/8.14.4) with ESMTP id pB8FvEUL058970 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 8 Dec 2011 09:57:15 -0600 (CST) (envelope-from dan@dan.emsphone.com) Received: from dan.emsphone.com (smmsp@localhost [127.0.0.1]) by dan.emsphone.com (8.14.5/8.14.5) with ESMTP id pB8FvEbT048342 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 8 Dec 2011 09:57:14 -0600 (CST) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.14.5/8.14.5/Submit) id pB8FvEDa048341; Thu, 8 Dec 2011 09:57:14 -0600 (CST) (envelope-from dan) Date: Thu, 8 Dec 2011 09:57:13 -0600 From: Dan Nelson To: Matthias Apitz Message-ID: <20111208155713.GC53453@dan.emsphone.com> References: <20111208063711.GA6482@tinyCurrent> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20111208063711.GA6482@tinyCurrent> X-OS: FreeBSD 8.2-STABLE User-Agent: Mutt/1.5.21 (2010-09-15) X-Virus-Scanned: clamav-milter 0.97.2 at email2.allantgroup.com X-Virus-Status: Clean X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.6 (email2.allantgroup.com [199.67.51.78]); Thu, 08 Dec 2011 09:57:15 -0600 (CST) X-Scanned-By: MIMEDefang 2.68 on 199.67.51.78 Cc: freebsd-questions@freebsd.org, freebsd-usb@freebsd.org Subject: Re: restore(8) to UFS on USB key: terrible slow 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: Thu, 08 Dec 2011 15:57:17 -0000 In the last episode (Dec 08), Matthias Apitz said: > I encounter the following problem with UFS file systems on USB keys, i.e. > the problem is not only with one key, but with all I have; the key in > question here is: > > Dec 7 22:17:47 tinyCurrent kernel: umass0: on usbus4 > Dec 7 22:17:47 tinyCurrent kernel: umass0: SCSI over Bulk-Only; quirks = 0x4101 > Dec 7 22:17:47 tinyCurrent root: Unknown USB device: vendor 0x058f product 0x6387 bus uhub4 > Dec 7 22:17:48 tinyCurrent kernel: umass0:0:0:-1: Attached to scbus0 > Dec 7 22:17:48 tinyCurrent kernel: da0 at umass-sim0 bus 0 scbus0 target 0 lun 0 > Dec 7 22:17:48 tinyCurrent kernel: da0: Removable Direct Access SCSI-2 device > Dec 7 22:17:48 tinyCurrent kernel: da0: 40.000MB/s transfers > Dec 7 22:17:48 tinyCurrent kernel: da0: 7650MB (15667200 512 byte sectors: 255H 63S/T 975C) [...] > after a while it get stuck and only does create the dirs with > a frequence of one per second; also the used space is growing very > slow: > > # df -kh /mnt > Filesystem Size Used Avail Capacity Mounted on > /dev/da0s1a 7.2G 42M 6.6G 1% /mnt > > this is after an hour or so: only 42 MBytes are written now; > > Any idea, what is broken with this? Cheap USB thumb drives aren't really optimized for small random-I/O writes. Can you try mounting the filesystem async? that might help a little. A workaround would be to use mdconfig to create a block device (backed by either swap or a file on your hard drive) the same size as your flash drive, newfs and restore to that, then umount the filesystem and dd the raw image directly to your flash drive. -- Dan Nelson dnelson@allantgroup.com