Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Very slow write to USB drive on kernel 2.6.19-r4 [Opened]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
trumee
Guru
Guru


Joined: 02 Mar 2003
Posts: 551
Location: London,UK

PostPosted: Fri Jan 26, 2007 10:52 pm    Post subject: Very slow write to USB drive on kernel 2.6.19-r4 [Opened] Reply with quote

Guys,
I have a horribly slow write to my USB pen drive. I have mounted the drive using 'sync' option, since i want to know when the writing is finished. The write is very slow about 30kb/s, however the read on the drive is very fast.
My system is ASUS P5B deluxe. When I insert the drive I get:
Code:

usb 2-3: new high speed USB device using ehci_hcd and address 6
usb 2-3: configuration #1 chosen from 1 choice
scsi7 : SCSI emulation for USB Mass Storage devices
usb-storage: device found at 6
usb-storage: waiting for device to settle before scanning
scsi 7:0:0:0: Direct-Access     JetFlash TS2GJFV10        0.00 PQ: 0 ANSI: 2
SCSI device sdb: 4030463 512-byte hdwr sectors (2064 MB)
sdb: Write Protect is off
sdb: Mode Sense: 00 00 00 00
sdb: assuming drive cache: write through
SCSI device sdb: 4030463 512-byte hdwr sectors (2064 MB)
sdb: Write Protect is off
sdb: Mode Sense: 00 00 00 00
sdb: assuming drive cache: write through
 sdb: sdb1
sd 7:0:0:0: Attached scsi removable disk sdb
sd 7:0:0:0: Attached scsi generic sg1 type 0
usb-storage: device scan complete


Does anybody know what is going on? Here is my USB section in kernel configuration:
Code:

# USB support
#
CONFIG_USB_ARCH_HAS_HCD=y
CONFIG_USB_ARCH_HAS_OHCI=y
CONFIG_USB_ARCH_HAS_EHCI=y
CONFIG_USB=y
# CONFIG_USB_DEBUG is not set

#
# Miscellaneous USB options
#
CONFIG_USB_DEVICEFS=y
# CONFIG_USB_BANDWIDTH is not set
# CONFIG_USB_DYNAMIC_MINORS is not set
# CONFIG_USB_SUSPEND is not set
# CONFIG_USB_OTG is not set

#
# USB Host Controller Drivers
#
CONFIG_USB_EHCI_HCD=m
# CONFIG_USB_EHCI_SPLIT_ISO is not set
# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
# CONFIG_USB_EHCI_TT_NEWSCHED is not set
# CONFIG_USB_ISP116X_HCD is not set
CONFIG_USB_OHCI_HCD=m
# CONFIG_USB_OHCI_BIG_ENDIAN is not set
CONFIG_USB_OHCI_LITTLE_ENDIAN=y
CONFIG_USB_UHCI_HCD=m
# CONFIG_USB_SL811_HCD is not set

#
# USB Device Class drivers
#
CONFIG_USB_ACM=m
CONFIG_USB_PRINTER=y

#
# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
#

#
# may also be needed; see USB_STORAGE Help for more information
#
CONFIG_USB_STORAGE=m
# USB Input Devices
#
CONFIG_USB_HID=y
CONFIG_USB_HIDINPUT=y


Last edited by trumee on Sun Jan 28, 2007 9:23 am; edited 2 times in total
Back to top
View user's profile Send private message
bjlockie
Veteran
Veteran


Joined: 18 Oct 2002
Posts: 1186
Location: Canada

PostPosted: Sat Jan 27, 2007 5:03 pm    Post subject: Reply with quote

It is not caching write operations so each write is done immediately.
Search for "write caching Linux USB".
Back to top
View user's profile Send private message
dsd
Developer
Developer


Joined: 30 Mar 2003
Posts: 2162
Location: nr London

PostPosted: Sat Jan 27, 2007 5:55 pm    Post subject: Reply with quote

use flush instead of sync
_________________
http://dev.gentoo.org/~dsd
Back to top
View user's profile Send private message
trumee
Guru
Guru


Joined: 02 Mar 2003
Posts: 551
Location: London,UK

PostPosted: Sat Jan 27, 2007 8:32 pm    Post subject: Reply with quote

Thanks flush did it. I am getting much better speed now. The next step was to get 'flush' in the mount options while using Kde. The mediamanager in kde 3.5.5/3.5.6 does not recognise the flush keyword so an ugly hack to get this flush keyword is to do this:

Add this to /usr/share/hal/scripts/hal-system-storage-mount , before the hal-set-property at the bottom of the file

Code:

# special options handling for certain filesystems
 case "$MOUNTTYPE" in
     vfat)
    MOUNTOPTIONS="$MOUNTOPTIONS,flush"
    ;;
 esac


In addition add the following line
Code:

<append key="volume.mount.valid_options" type="strlist">flush</append>


whereever you see vfat or removable device in /usr/share/hal/fdi/policy/10osvendor/20-storage-methods.fdi




Now the device will be mounted using 'flush'. There is more detail on this problem on bugs.kde.org
Back to top
View user's profile Send private message
trumee
Guru
Guru


Joined: 02 Mar 2003
Posts: 551
Location: London,UK

PostPosted: Sun Jan 28, 2007 9:25 am    Post subject: Reply with quote

dsd wrote:
use flush instead of sync


The flush parameter seems to only work on kernel 2.6.19. On kernel 2.6.18-suspend2-r4 mount gives the following error
Code:

#mount /dev/sdb1 /mnt/usb/ -o uid=1000 -o flush
mount: wrong fs type, bad option, bad superblock on /dev/sdb1,
       missing codepage or other error
       In some cases useful info is found in syslog - try
       dmesg | tail  or so
#dmesg|tail
FAT: Unrecognized mount option "flush" or missing value


Is there some solution for 2.6.18 kernel?
Back to top
View user's profile Send private message
Vadim
n00b
n00b


Joined: 02 Dec 2002
Posts: 26
Location: Russia, Tuapse

PostPosted: Thu Feb 15, 2007 7:01 pm    Post subject: Reply with quote

Code:
Is there some solution for 2.6.18 kernel?


Just try to mount without sync... To know when the writing is finished - look at the pen drive led. It works for me. :)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum