Testing usb flash drive speeds in linux
I’m pondering a project which will need a reasonably fast write usb flash drive so I decided to root around in drawers behind cupbaords and under sofas to find some to test.
All are formatted as FAT32 and tested on my Debian linux box.
read test conducted using dd if=/dev/sde of=/dev/null bs=10000 count=10000
write test conducted using dd if=/dev/zero of=/dev/sde bs=1M count=100
Sandisk cruzer slice 8GB
http://www.sandisk.co.uk/products/usb-flash-drives/sandisk-cruzer-slice
r 100 MB copied, 6.01249 s, 16.6 MB/s
w 105 MB copied, 28.5709 s, 3.7 MB/s
integral Courier 4GB
http://www.integralmemory.com/product/courier-usb-flash-drive
r 100 MB copied, 6.60859 s, 15.1 MB/s
w 105 MB copied, 23.9367 s, 4.4 MB/s
Sony Microvault 4GB
http://www.sony.co.uk/support/en/product/USM4GL/specifications
r 100 MB copied, 5.85735 s, 17.1 MB/s
w 105 MB copied, 11.8885 s, 8.8 MB/s
Integral AG47 4GB
http://www.integralmemory.com/product/ag47-usb-flash-drive
r 100 MB copied, 5.53511 s, 18.1 MB/s
w 105 MB copied, 13.9816 s, 7.5 MB/s
Installing Debian Lenny Via USB Flash
On existing Debian machine insert formatted usb flash
dmesg should show something similar to
usb 4-4.4: new high speed USB device using ehci_hcd and address 8
usb 4-4.4: configuration #1 chosen from 1 choice
scsi4 : SCSI emulation for USB Mass Storage devices
usb 4-4.4: New USB device found, idVendor=0781, idProduct=5406
usb 4-4.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 4-4.4: Product: U3 Cruzer Micro
usb 4-4.4: Manufacturer: SanDisk
usb 4-4.4: SerialNumber: 45271013A181B72F
scsi 4:0:0:0: Direct-Access    SanDisk Cruzer          8.01 PQ: 0 ANSI: 0 CCS
sd 4:0:0:0: [sde] 3907711 512-byte hardware sectors (2001 MB)
sd 4:0:0:0: [sde] Write Protect is off
sd 4:0:0:0: [sde] 3907711 512-byte hardware sectors (2001 MB)
sd 4:0:0:0: [sde] Write Protect is off
sde: sde1
sd 4:0:0:0: [sde] Attached SCSI removable disk
wget http://www.theoutpost.org/downloads/boot.img
zcat boot.img.gz > /dev/sde (where sde is your USB device name which was obtained from the dmesg output)
Now it is a good idea to remove un-plug and plug back in your USB devices so that the new partition table/structure is recognized by the Linux system. I had to do this. This refreshes the drives partition table stored by udev.
mount /dev/sde /mnt/ (replace sde with whatever your dmesg shows)
wget http://www.theoutpost.org/downloads/debian-508-i386-netinst.iso
cp debian-508-i386-netinst.iso /mnt
umount /mnt/sde
That’s it. You have successfully created USB flash installation media. Just plugin the USB stick to the computer on which you would like to install Debian Lenny and set the BIOS to boot from USB stick.
out of vmalloc space
My Debian box started throwing upÂ
allocation failed: out of vmalloc space – use vmalloc=<size> to increase size
errors.
cat /proc/meminfo showed
VmallocTotal: 114680 kB
VmallocUsed: 113940 kB
VmallocChunk: 316 kB
In order to fix it I edited
/boot/grub/menu.lst
and added the vmalloc variable, before
kernel         /boot/vmlinuz-2.6.26-2-686 root=/dev/md0 ro quiet
after
kernel         /boot/vmlinuz-2.6.26-2-686 root=/dev/md0 ro quiet vmalloc=256m
(the default is 128m) reboot
cat /proc/cpuinfo
VmallocTotal:Â Â 245752 kB
VmallocUsed:Â Â Â Â 10884 kB
VmallocChunk:Â Â 234440 kB
Redirection & Logging
This is more for personal reference than anything else. I wanted to log the output of different scripts i’d done but every time I wanted to I had to search the net bcause I kept forgetting (must be old age) so thought i’d put all the info in one place.
Adding USB Flash Drive
This more of a personal reference than a HOWTO but someone else might still find it useful.
I'm using a 4GB Kingston DataTraveler 101
Resolve windows hostname inside a local network
nmblookup -A <ip-address_of_windows_pc>
then add the windows boxes to /etc/hosts
Changing the default MOTD with Debian 5 Lenny
To change or remove the message, simply edit the /etc/motd file in
your favourite text editor either as the root user or using sudo and
then save the file. Clear all the text for no MOTD or replace it with
whatever you would prefer. The next time you log in it will show the
new (or no) text message.
This will work for now, but on reboot the file is reconstructed by
the /etc/init.d/bootmisc.sh script. It writes out "uname -snrvm" to
/var/run/motd (/etc/motd is a symbolic link to /var/run/motd) and then
adds the text from /etc/motd.tail
Therefore to change what goes into the motd file on reboot, edit the
/etc/motd.tail file, making it blank for no message of the day.
If you don’t want the uname information to be included in the motd
file then you would also need to modify the /etc/init.d/bootmisc.sh
file.