Replying to an old thread,

On Feb 11 10:14:51, Aaron Stellman wrote:
> On Sat, Jan 16, 2010 at 01:44:49AM +0100, T. Tofus von Blisstein wrote:
> > Hello,
> > 
> > I have noticed that writing to a usb drive is "slow".
> > 
> > What does "slow" mean?
> > 
> > It means that compared to other OS's.
> > 
> > Which OS's?
> > 
> > Yes, it hurts: the penguin.
> Hello there,
> I came across a cheap USB flash drive, particularly a SanDisk Cruzer U3:
> 
> umass0 at uhub1 port 1 configuration 1 interface 0 "SanDisk SanDisk Cruzer" 
> rev 2.00/2.00 addr 2
> umass0: using SCSI over Bulk-Only
> scsibus3 at umass0: 2 targets, initiator 0
> sd1 at scsibus3 targ 1 lun 0: <SanDisk, SanDisk Cruzer, 8.02> SCSI0 0/direct 
> removable
> sd1: 3863MB, 512 bytes/sec, 7913471 sec total
> 
> Reading and writing from/to a raw disk "/dev/rsd1c" gives same exact
> rates as on other OSes:
> 
> $ sudo dd if=/dev/rsd1c of=/dev/null bs=128k count=1600
> 1600+0 records in
> 1600+0 records out
> 209715200 bytes transferred in 8.822 secs (23771541 bytes/sec)
> 
> $ sudo dd if=/dev/zero of=/dev/rsd1c bs=128k count=1600
> 1600+0 records in
> 1600+0 records out
> 209715200 bytes transferred in 19.253 secs (10892315 bytes/sec)
> 
> Which are reasonable numbers.
> Now let's put a filesystem on it:
> 
> $ sudo fdisk -i sd1                                            
> Do you wish to write new MBR and partition table? [n] y
> Writing MBR at offset 0.
> $ sudo disklabel -E sd1
> Label editor (enter '?' for help at any prompt)
> > a
> partition: [a] 
> offset: [63] 
> size: [7903917] 
> FS type: [4.2BSD] 
> > w
> > q
> No label changes.
> $ sudo newfs sd1a
> /dev/rsd1a: 3859.3MB in 7903916 sectors of 512 bytes
> 20 cylinder groups of 202.47MB, 12958 blocks, 25984 inodes each
> super-block backups (for fsck -b #) at:
>  32, 414688, 829344, 1244000, 1658656, 2073312, 2487968, 2902624, 3317280, 
> 3731936, 4146592,
>  4561248, 4975904, 5390560, 5805216, 6219872, 6634528, 7049184, 7463840, 
> 7878496,
> $ sudo mount /dev/sd1a /mnt/test; cd /mnt/test
> $ sudo dd if=/dev/zero of=./x bs=128k count=1600
> 1600+0 records in
> 1600+0 records out
> 209715200 bytes transferred in 254.224 secs (824923 bytes/sec)
> (confirmed that pengingwrites is 0 right after dd exits with systat
> iostat)
> 
> As you can see here, 800KB/s is quite low, compared to raw read rate.
> What can be the cause? I don't know, but let's try formatting sd1a with
> frag-size of 8192 and block-size of 65536
> ...
> (same exact sequence of steps as above, just adjust frag-size and
> block-size)
> ...
> 
> $ time (sudo dd if=/dev/zero of=./x bs=128k count=3200; sync)
> 3200+0 records in
> 3200+0 records out
> 419430400 bytes transferred in 21.194 secs (19789417 bytes/sec)
>     0m42.44s real     0m0.00s user     0m0.33s syste
> 
> 419430400/42.44=9,882,902.92 That's almost 10MB/s
> Perhaps people who are having problems with their "slow" USB flash
> drives can try the same experiment, see if it helps.

indeed, this speeds up writes on my USB flash drives.

However, during an _install_, there is no option to specify
additional parameters to newfs - or is there? Besides escaping
to a shell and running newfs myself? Would the installer run
its own newfs over the newly disklabel'd partitions anyway?

Write speed during an install to a USB flash matters
- usually it takes ages just to untar the sets ...

        Jan

Reply via email to