Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 8 Dec 2011 09:57:13 -0600
From:      Dan Nelson <dnelson@allantgroup.com>
To:        Matthias Apitz <guru@unixarea.de>
Cc:        freebsd-questions@freebsd.org, freebsd-usb@freebsd.org
Subject:   Re: restore(8) to UFS on USB key: terrible slow
Message-ID:  <20111208155713.GC53453@dan.emsphone.com>
In-Reply-To: <20111208063711.GA6482@tinyCurrent>
References:  <20111208063711.GA6482@tinyCurrent>

next in thread | previous in thread | raw e-mail | index | archive | help
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: <Generic Mass Storage, class 0/0, rev 2.00/1.02, addr 3> 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: <Generic Flash Disk 8.07> 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20111208155713.GC53453>