You are not logged in.
Hi everyon
If i upload some stuff to an usb-storage it's like its uploading very very fast, like 100mb in 1 second, but in background it's still uploading(i can't umount). The problem is every program is showing me that the stuff is uploaded in 1-2 second. I have to wait everytime, but i don't know how long, and that's really annoying.
How can i fix it ?
/etc/fstab
/dev/sdb /media/sdb vfat rw,users,umask=000,uid=fatih 0 0
dmesg
usb 1-1: USB disconnect, address 4
usb 1-1: new full speed USB device using uhci_hcd and address 5
usb 1-1: configuration #1 chosen from 1 choice
scsi5 : SCSI emulation for USB Mass Storage devices
usb-storage: device found at 5
usb-storage: waiting for device to settle before scanning
scsi 5:0:0:0: Direct-Access Nokia N95 1.0 PQ: 0 ANSI: 0
sd 5:0:0:0: [sdb] 1000215 512-byte hardware sectors (512 MB)
sd 5:0:0:0: [sdb] Write Protect is off
sd 5:0:0:0: [sdb] Mode Sense: 03 00 00 00
sd 5:0:0:0: [sdb] Assuming drive cache: write through
sd 5:0:0:0: [sdb] 1000215 512-byte hardware sectors (512 MB)
sd 5:0:0:0: [sdb] Write Protect is off
sd 5:0:0:0: [sdb] Mode Sense: 03 00 00 00
sd 5:0:0:0: [sdb] Assuming drive cache: write through
sdb: unknown partition table
sd 5:0:0:0: [sdb] Attached SCSI removable disk
sd 5:0:0:0: Attached scsi generic sg2 type 0
usb-storage: device scan complete
usb 1-1: USB disconnect, address 5
NOTE: I've tried it on Ubuntu, and there wasn't any problem.
Offline
Add "sync" to the options in /etc/fstab. ie:
/dev/sdb /media/sdb vfat sync,rw,users,umask=000,uid=fatih 0 0
Offline
Now its to slow as we have speak in IRC.
Offline
That is _one_ solution, but since most file systems cache and fill up hd space little by little (eg where it does fit), and this is also why you don't have to defrag an ext2/3 filesystem (there are more examples obviously). This is also what happens when you "unmount". It finishes all "write" tasks.
The "sync" trick is a little bit dirty, but it does work. But you have to make a stanza in fstab for it, and then you lose some of the comfort with gnome-volume-manager doing the dirty work for you (mounting a device without messing with fstab and device nodes that is...). I've seen people doing modifications to HAL policies to have usb devices mount with "sync" though...
The better solution is to install "notification-daemon" (or notification-daemon-xfce if you run xfce). This will let you know if a device you "remove" or "unmount" are done syncing, and are safe to remove with desktop popups, much like banshee or rhythmbox do when a new song is playing.
"Your beliefs can be like fences that surround you.
You must first see them or you will not even realize that you are not free, simply because you will not see beyond the fences.
They will represent the boundaries of your experience."
SETH / Jane Roberts
Offline
@pelle.k
I do have Xfce. The notification-daemon is installed too. Like you say i can see the popups. But i don't know how long i have to wait. For example i have a 2gb usb-stick. I want to upload a 700mb film, it says it uploaded in 2 seconds. But i know in background it still uploading.
Offline
When you want to synchronize disk (really write data to disk), run sync command from terminal. On slow devices such as usb storage it may take some time.
I personally don't see any reason for enforcing disk synchronization since umount does it automatically.
Offline
But i don't know how long i have to wait.
Well, thats kind of the thing... It could be forever. The kernel/filesystem might decide to halt copying until you decide to sync _or_ add more files, so it can make all the pieces in the puzzle (partition) fit without defragmentation. See?
If you decide to mount with sync, you get a steady stream transfer to your device, and you will theoretically see how long the task will take. (am i mistaken?)
If you decide to go with nosync (default behaviour), this is not possible. But the benefit would be less defragmentation.
I guess that i would be possible to have the system tell you how long the actual "sync" manouver will take when you unmount, but as far as i know this is not implemented yet. Maybe you could file a feature request somewhere? (i dont know if the HAL scripts or notification-daemon is reponsible for the actual "information" you recieve)
"Your beliefs can be like fences that surround you.
You must first see them or you will not even realize that you are not free, simply because you will not see beyond the fences.
They will represent the boundaries of your experience."
SETH / Jane Roberts
Offline
Since it's a vfat partition you should use "flush" option not "sync" (or "async"). It will work as fast as the async option with the sync command being run on the end. It's a new option for removable vfat devices (search the forums for more details). The effect in mc for example is that the copying dialog stays on until the last portion of the data is beeing phisically written on the disk. You should be able to umount then without problems (I'm actually using it for automatic mount/umount of my vfat usb devices with udev only - more examples on the forum and wiki).
Offline