Samstag, 12. Juni 2021

[Solved] Samsung Fit Plus 256 GB USB Flash Drive too slow in linux



If you have a Samsung Fit Plus 256GB USB Flash Drive (or any other size) and it is very slow in linux then here comes the explanation.

For the Samsung Fit Plus USB Flash Drive exists a Kernel Quirk that reduces the speed of file transfers by a factor of approx 6.

Normal read speed is around 240 MB/s (linux running in Parallels on a Mac Mini). The kernel reduces the speed to around 40MB/s. 

We can remove the kernel restriction by the following methods:


a) "on the fly" by executing following commands (do not change the numbers)

 # rmmod uas usb_storage

# modprobe usb_storage quirks=090c:1000:

b) permanently by adding/editing the file /etc/modprobe.d/usb_storage.conf and adding this line:

options usb_storage quirks=090c:1000:

It is important that the Flash Drive is connected directly to a USB 3.0 port without any adapter in between. Otherwise I saw the kernel complaining and disconnecting the device.

Useful commands:


# hdparm -t /dev/sdj
/dev/sdj: Timing buffered disk reads: 922 MB in  3.00 seconds = 307.19 MB/sec

# dd if=/dev/sdj of=/dev/null bs=1M count=1000
1048576000 bytes (1.0 GB, 1000 MiB) copied, 3.51042 s, 299 MB/s

# cat /proc/scsi/usb-storage/*
   Host scsi9: usb-storage
       Vendor: Samsung
      Product: Flash Drive FIT
Serial Number: 0302320100001796
     Protocol: Transparent SCSI
    Transport: Bulk
       Quirks: SANE_SENSE

If you do not get close to this numbers than the old kernel quirks is still active (try to reboot your system).

Sonntag, 30. April 2017

Speed up time machine backup on MAC

The time machine backup runs in the background and is programmed to not take much CPU power in order to not influence the normal work. But sometimes it is necessary to have the backup done in the fastest way possible (i.e. after backing up to a new hard drive). The following command:

sudo sysctl debug.lowpri_throttle_enabled=0

gives back the normal priority to the time machine backup which speeds up heavily the copy process.

This parameter is being reset to the original value 1 after a reboot.

Samstag, 6. Februar 2016

Solution: dd too slow on Mac OS X

Does your dd command seem to be far too slow on your MAC?
It is not the dd command that makes it slow, it's the device that you selected.
On a MAC there exist for an external attached USB device two names in the /dev/ tree (example):

/dev/disk3

and

/dev/rdisk3

If you copy from /dev/disk3 with dd command (does not depend much on the blocksize that you
selected) then you will get around 30Mbytes/s. Now if you choose /dev/rdisk3 then you can
get up to 300Mbytes/s (using a USB3.0 SATA adapter and a fast disk of course).

Thanks to Daoyluan Li (http://daoyuan.li/solution-dd-too-slow-on-mac-os-x/#comment-13896)
who found that solution!!!

Samstag, 7. November 2015

scp files from A to C or from C to A via intermediate host B



I have access to three different machines A, B and C like:A to BB to AB to CC to Bbut not from A to C and not from C to A because A and C are on a different network.
In order to transfer files from A to C or from C to A do the following:
ssh -fN -L 4567:C:22 username_of_B@B
and then to transfer a directory from C to A:
scp -r -P 4567 localhost:directory_on_C path_on_A_where_to_put_the_directory
to transfer a directory from A to C:scp -r -P 4567 directory_on_A_which_is_to_transfer localhost:path_on_C_where_to_put
and for transfering files:to transfer a file from C to A:
scp -P 4567 localhost:file_to_transfer_on_C path_on_A_where_to_put_the_file
to transfer a file from A to C:
scp -P 4567 file_on_A_which_to_transfer localhost:path_on_C_where_to_put_the_file


Even better is this command to rsync files from computer A to computer C (or vice versa)via intermediate computer B:
rsync -av -e 'ssh -o "ProxyCommand ssh username_at_computer_B@IP_of_computer_B exec nc %h %p 2greater/dev/null"' username_at_computer_C@IP_of_computer_C:directory_on_C_to_sync/* directory_on_A_to_sync/



the word "greater" in the line above has to be replaced with the greater symbol of the keyboard. I can not do it here because while saving it is being replaced with >

Sonntag, 1. Juni 2014

How to create a WiFi Hotspot on a linux machine in order to share the ethernet connection?

How to create a WiFi Hotspot on a linux machine in order to share the ethernet connection? I tried several days "all" solutions posted in the internet on my Macbook Pro running on SuSe 12.3 under gnome but nothing worked. My mobile devices (iphone, ipad) could see the created Hotspot but after connecting to it there was no internet connection. The simple solution was to set the "wireless security" to "none". For me no problem at all for that purpose I am using it. So here come the instructions: I use Networkmanager and the nm-applet. a) In nm-applet click on "Create New Wireless Network" Specify any name for "Network name" in the window that will open. Select "none" under "Wireless security" Select "Create" b) connect any wireless device to this newly created hotspot and press "Join Anyway" in case that the iOS will inform you that this hotspot is not connected to the internet. For me that and only that worked out.

Dienstag, 9. Juli 2013

How to save a partition via network to a different computer and later restore that partition after formatting the local disc

How to save a partition via network to a different computer and later restore that partition after formatting the local disc? 1) try to unmount the partition if possible 2) dd if=/dev/hda1 bs=1k conv=sync,noerror | gzip -c | ssh -c blowfish user@hostname "dd of=filename.gz bs=1k" 3) format or do whatever you want to do with /dev/hda1 4) go to the remote computer "hostname" and execute following command there: dd if=filename.gz | ssh -c blowfish root@deadhost "gunzip -c | dd of=/dev/hda1 bs=1k" Thanks a lot to http://www.inference.phy.cam.ac.uk/saw27/notes/backup-hard-disk-partitions.html for this and many more useful tips!

Samstag, 6. April 2013

howto enable apple wireless keyboard to send message by pressing cmd-enter

How many key combinations have you tried in order to get the Apple wireless keyboard to send a message instead of inserting a carriage return? 100 as I did? More? Stop trying it because it is not possible without a Cydia tweak. Today I found the answer. Install the free Bluetooth Keyboard Helper from Matthias Ringwald and be happy. It translates the cmd-enter key into a |press 'Send' button" action in the messages.app.