[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: usb2 port gets very slow on 2-gig Flash Drive.



"elijah r." writes:
> Say your flash disk is /dev/sdc and has 1 FAT partition where the
> music is stored:
> 
> cd ~
> dd if=/dev/sdc1 of=zenstone2g.img bs=64M
> mkdir /mnt/zenstoneimg
>mount -o loop -t msdos zenstone2g.img /mnt/zenstoneimg
> ---delete anything in /mnt/zenstoneimg/music you don't want -----
> cp -R /path/to/my/music/* /mnt/zenstoneimg/music/
> umount /mnt/zenstoneimg
> dd if=zenstone2g.img of=/dev/sdc1 bs=64M
> 
> You'd only need to run the commands before "mount" once, then keep the
> image around for the future.
> I don't actually know if this will speed things up, but the idea is
> that you are bypassing the filesystem layer over the USB bottleneck
> for disk writes.
> You make all the filesystem changes to a disk image on your hard disk,
> then you stream the bits in that image to the flash disk.
> The "bs=64M" is the block size and can be increased or decreased
> depending on your situation.  AFAIK, it basically acts like a buffer
> in situations like this.
> 
> Be very careful with the syntax of dd; one misplaced character and you
> could wipe your hard disk or flash drive.

	It works like a charm.

	There was a complication in that something is wrong with
the usb port on the system I was originally using which cause
the data transfer rate to appear to be only about 32 Kbits per
second. Even worse, when I had used that system to mount the
file system, it ended up corrupted so what I ended up with was
a colossal mess. It actually played on both the MP3 player and
on the computer, but whole directories of songs were scrambled
so you heard something that sounded like what one might get if
you shook a CD player furiously or were holding down the
fast-forward function and skipping through each selection.

	Using the image file, I rm -r'd all the directories that
were trashed and restored them from known-good files or
re-ripped them from the CD's themselves.

	It all turned out perfectly and the time it takes to
write or read the image is less than an hour for 2 gigs. It's
about 2,901 seconds to write it with the large block-size value.

	Again, many thanks. This has been an educational as well as
useful exercise.

	The advice about watching the syntax is well taken.
Folks, this is big-league dangerous stuff so be careful if you
try it at home. Ben there. Done that.

Martin McCormick WB5AGZ  Stillwater, OK 
Systems Engineer
OSU Information Technology Department Network Operations Group


Reply to: