Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 18 Jun 2008 22:26:21 +0200
From:      "Julian Stacey" <jhs@berklix.org>
To:        freebsd-usb@freebsd.org
Subject:   Re: best block size for file systems on USB media ? 
Message-ID:  <200806182026.m5IKQLw5016490@fire.js.berklix.net>
In-Reply-To: Your message "Wed, 18 Jun 2008 01:48:46 %2B0200." <200806180148.46908.hselasky@c2i.net> 

next in thread | previous in thread | raw e-mail | index | archive | help
Hans Petter Selasky wrote:
> On Tuesday 17 June 2008, Julian Stacey wrote:
> > Hi usb@freebsd.org
> > Do USB flash memory sticks have cache ram ?  What are best file
> > system block sizes to write USB media (to maximise access speed) ?
> > Any URLS to RTFM welcome ;-)
> >
> > I'm using mine to back up my personal tree of private data, (mail
> > & tech notes & sources etc, lots of smallish files), I'm using
> > /usr/ports/net/rdist6 to backup.
> >
> > My biggest stick, a 2G Sandisk Cruzer micro (vendor 0x0781 product
> > 0x5151) is awfully slow (much slower per Meg than other manufacturers
> > smaller sticks) (& other 2G Sandisk sticks bought in same purchase
> > from same vendor are also awfully slow on Win-XP, so maybe these
> > have less or no cache ram (if such things have cache at all ?) or
> > maybe they were a fraudulent batch without cache when they should
> > have had cache or ... ? ) Maybe some other sticks work on different
> > block size ? Maybe for many of my small files, the stick needs to
> > read a big block, before modifying a small chunk & writing back to
> > block ?
> >
> > Block sizes was a question I'd meant to ask earlier, just for normal
> > sticks with a normal FreeBSD FS on there, now it's become even more
> > of an interest, using a BSD FS within an encrypted gbde partition
> > ref.  Read
> > http://www.freebsd.org/doc/en/books/handbook/disks-encrypting.html which
> > is slower still from encyption overhead (noticeable doing a reload
> > into new empty FS).
> >
> > Some FS issues might be better discussed later on fs@freebsd.org,
> > but first, what's known about USB hardware block sizes please ?
> 
> Hi,
> 
> The blocksize for USB Flash is typically 512 bytes due to wMaxPacketSize being 
> 512 bytes at High Speed USB.
> 
> The SCSI command set allows you to read up to 32MByte in one go, but FreeBSD 
> typically does not read/write more than 64K.

OK, thanks so that's FreeBSD side covered,
	newfs & FFS etc use several K 
	& I'm recently using gbde with 2K
so no problem with that from the FreeBSD side of the interface.

But what if the internal stick hardware works on say 10K chunks ?
is there anyone on this list who knows how USB sticks work internaly ?
( I remember at least one chap some time back, on some freebsd list,
being quite authoritative on max read write patterns before failure,
maybe he knows about blocking & if there's cache too ? )

Julian
-- 
Julian Stacey: BSDUnixLinux C Prog Admin SysEng Consult Munich www.berklix.com
	Mail just Ascii plain text.  HTML & Base64 text are spam.



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