1

I have installed on my computer both Ubuntu 13.10 and Windows 8 and lately noticed that while a large file is copied with 5-6 MB per second on Windows 8 its transferred with up to 80 MB per second on the Ubuntu 13.10.

What I am doing is downloading movies, copping them on a USB stick and watch them on my TV. So, because the speed on Ubuntu is better, a prefer to do the downloading and copying part using it.

The issue is so far, I have not successfully copy anything. I am using three different USB sticks formatted as NTFS and all copy operations are falling.

Firstly, the files are transferred but when I eject/inject the USB again, I get the following error:

Error mounting /dev/sdb1 at /media/gotqn/Joro: Command-line `mount -t "ntfs" -o "uhelper=udisks2,nodev,nosuid,uid=1000,gid=1000,dmask=0077,fmask=0177" "/dev/sdb1" "/media/gotqn/Joro"' exited with non-zero exit status 13: $MFTMirr does not match $MFT (record 0). Failed to mount '/dev/sdb1': Input/output error NTFS is either inconsistent, or there is a hardware fault, or it's a SoftRAID/FakeRAID hardware. In the first case run chkdsk /f on Windows then reboot into Windows twice. The usage of the /f parameter is very important! If the device is a SoftRAID/FakeRAID then first activate it and mount a different device under the /dev/mapper/ directory, (e.g. /dev/mapper/nvidia_eahaabcc1). Please see the 'dmraid' documentation for more details.

I have firstly thought that there might be something with the USB sticks themselves, so I have formatted them using gparted to NTFS again but nothing changes.

When I formatted the sticks on Windows 8 and copied the files, everything is OK.

How to fix this?

gotqn
  • 2,047
  • @arhimed I think you can write that as an answer. 80Mb/sec is impossible on USB2.0 and also very-very unlikely on USB3 for a pendrive. The only question is if gotqn is ejecting his drive correctly (then this is a bug) or he just pulls it out (then this is a user error). – falconer Jan 19 '14 at 16:23
  • @falconer this seems to be a user error, because I have ejected the USB since the system tells me the files are copied (but they are not). – gotqn Jan 19 '14 at 19:01
  • I think this problem is related to the NTFS fileystem. Because for me my fat formatted drives are automounted with the flush option, but your NTFS is not. Just tried an NTFS external HDD and it is indeed not automounted with flush. So I think you just have to format your drives to FAT32. Anyway FAT32 is the normal option for pendrives, not even Microsoft recommends NTFS for pendrives/memory-cards. (Maybe you are limited by the FAT32 filesystem capabilities (e.g. max file size) and that is why you need NTFS? ) Or maybe you can tweak udisks to automount your drives with flush. – falconer Jan 19 '14 at 19:43

1 Answers1

2

As @falconer pointed out, 80MB/sec is impossible on USB2.0 and also very-very unlikely on USB3 for a pendrive.

The reason of such fast speed is probably writing cache. While the Copy Dialog shows you 80MB/s, the actually write speed is 5-6MB/s and OS caching everything rest and write it later. So even Copy Dialog report about files are copied, they're actually not.

OS still writing on the disk and if you press Unmount option on drive it will tell you that there are operations with the drive and you need to wait. After a several minutes(or more if files are big ones) it actually finish write data on drive and make pendrive inactive. Than you can eject drive and open files on other PC or TV.

There are two posts questions that may help you with disabling writing cache: How to switch off caching for usb device when writing to it? and https://superuser.com/questions/526248/turn-off-write-cache-on-all-usb-external-drives-debian-ubuntu-linux

I used the second one for my problem and it helped me. I have only one hard disk drive in my laptop(/dev/sda), so any other drive is removable. Also I have 2 usb ports so I can connect 2 external drives maximum(/dev/sdb and /dev/sdc) so i've added to /etc/hdparm.conf

/dev/sdb {
        write_cache = off
}
/dev/sdc {
        write_cache = off
}
Viktor K
  • 1,139
  • I try to disable it, but the speed remains the same. When I put into the USB the gparted show it as /dev/sdb, but when I run sudo fdisk -l it is shown as /dev/sdb1. I have entered the both cases in the /etc/hdparam.conf but nothing change. Should I restart the Ubuntu or do something else? – gotqn Jan 19 '14 at 19:00