[solved somehow] SuperSLOW disk to disk file transfer

Post Reply
o_lampe
Posts: 175
Joined: Wed Jan 01, 2020 12:35 am
languages_spoken: english german
ODROIDs: MC1 solo
Has thanked: 11 times
Been thanked: 16 times
Contact:

[solved somehow] SuperSLOW disk to disk file transfer

Post by o_lampe » Sun Mar 15, 2020 5:22 pm

Hi folks,
here's my situation:
I have a dual SATA USB3.0 adapter in JBOD mode with two SSD drives. One is ext4, the other NTFS.
I want to copy/paste a huge folder ( 40GB+ ) from one drive to the other, but I only get 20MB/s!
Both SSDs have much better benchmarks, like 360MB/s writespeed, when tested individually.

I mounted a 600MB ramdisk and copied a single 500MB file from one SSD to it. Then copied the file to the other SSD. The whole transfer took only 5-6 seconds, which matches the benchmarks.

But how can I copy/paste the whole folder that fast?
Is there a magic pipeline command I can use?

Code: Select all

e.g.  sudo dd if=/dev/sda1/folder | ramdisk | of=/dev/sdb1/folder
Thanks for reading
Olaf
<edit> it seems the uasp-driver requires some extra attention to speed up file transfer. Without uas-driver the speed is 'acceptable' without any voodoo-(remount, big_writes)-stuff
Last edited by o_lampe on Fri Mar 27, 2020 6:49 pm, edited 1 time in total.

User avatar
rooted
Posts: 7741
Joined: Fri Dec 19, 2014 9:12 am
languages_spoken: english
Location: Gulf of Mexico, US
Has thanked: 718 times
Been thanked: 206 times
Contact:

Re: SuperSLOW disk to disk file transfer

Post by rooted » Sun Mar 15, 2020 5:29 pm

Are you writing to the NTFS drive or reading from it?

Also the USB bandwidth will be halved so you may see around 150 MB/s write.

Last edited by rooted on Sun Mar 15, 2020 5:29 pm, edited 2 times in total.

o_lampe
Posts: 175
Joined: Wed Jan 01, 2020 12:35 am
languages_spoken: english german
ODROIDs: MC1 solo
Has thanked: 11 times
Been thanked: 16 times
Contact:

Re: SuperSLOW disk to disk file transfer

Post by o_lampe » Sun Mar 15, 2020 5:33 pm

Writing to it.
I can try it the other way round, just for fun...

User avatar
rooted
Posts: 7741
Joined: Fri Dec 19, 2014 9:12 am
languages_spoken: english
Location: Gulf of Mexico, US
Has thanked: 718 times
Been thanked: 206 times
Contact:

Re: SuperSLOW disk to disk file transfer

Post by rooted » Sun Mar 15, 2020 5:34 pm

You need to enable big_writes to the NTFS mount options.

o_lampe
Posts: 175
Joined: Wed Jan 01, 2020 12:35 am
languages_spoken: english german
ODROIDs: MC1 solo
Has thanked: 11 times
Been thanked: 16 times
Contact:

Re: SuperSLOW disk to disk file transfer

Post by o_lampe » Sun Mar 15, 2020 6:05 pm

I tried it the other way round and got 35-40MB/s, But it crashed twice!

I've noticed that the ext4 drive is mounted in

Code: Select all

 /,/media/usb0
Is that normal?

Code: Select all

odroid@odroid:~$ lsusb -t
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 5000M
    |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 5000M
        |__ Port 1: Dev 3, If 0, Class=Mass Storage, Driver=uas, 5000M
        |__ Port 3: Dev 4, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
/
The dual SATA controller is the only device in the USB hub, but there are two devices shown: uas and usb-storage.
Shouldn't there be two uas devices?

User avatar
rooted
Posts: 7741
Joined: Fri Dec 19, 2014 9:12 am
languages_spoken: english
Location: Gulf of Mexico, US
Has thanked: 718 times
Been thanked: 206 times
Contact:

Re: SuperSLOW disk to disk file transfer

Post by rooted » Sun Mar 15, 2020 6:26 pm

I'm not actually sure since I have a dual disk docking station vs using a hub.

It seems one of your drives is operating in USB 2.0 based on the speeds, copying from NTFS to EXT4 should have been much faster.

Try disabling UAS as a test and see if you get an increase in speed.

Also try without the hub.

o_lampe
Posts: 175
Joined: Wed Jan 01, 2020 12:35 am
languages_spoken: english german
ODROIDs: MC1 solo
Has thanked: 11 times
Been thanked: 16 times
Contact:

Re: SuperSLOW disk to disk file transfer

Post by o_lampe » Sun Mar 15, 2020 7:24 pm

The hub (port1 / dev 2) is part of the SATA adapter.

How do I disable uas and how can I enable big_write to the ntfs partition?

User avatar
mad_ady
Posts: 8126
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, C4, N1, N2, H2, Go, Go Advance
Location: Bucharest, Romania
Has thanked: 564 times
Been thanked: 397 times
Contact:

Re: SuperSLOW disk to disk file transfer

Post by mad_ady » Sun Mar 15, 2020 8:03 pm

It looks like it's working in usb3 mode (5000M). UAS *should* be fine, unless the disk is Seagate. You can disable it via boot.ini by appending usb-storage.quirks=0x174c:0x1153:u to /media/boot/boot.ini in the bootargs section. Replace the hex numbers with the ones reported by lsusb for your controller.

To test ntfs try comething like sudo mount -o remount,big_writes /dev/sdX1
Replace X with the correct ntfs disk.
These users thanked the author mad_ady for the post:
o_lampe (Mon Mar 16, 2020 3:07 pm)

User avatar
rooted
Posts: 7741
Joined: Fri Dec 19, 2014 9:12 am
languages_spoken: english
Location: Gulf of Mexico, US
Has thanked: 718 times
Been thanked: 206 times
Contact:

Re: SuperSLOW disk to disk file transfer

Post by rooted » Sun Mar 15, 2020 8:12 pm

They are SSD, I don't think they need any quirks?

User avatar
mad_ady
Posts: 8126
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, C4, N1, N2, H2, Go, Go Advance
Location: Bucharest, Romania
Has thanked: 564 times
Been thanked: 397 times
Contact:

Re: SuperSLOW disk to disk file transfer

Post by mad_ady » Sun Mar 15, 2020 8:49 pm

I don't either, but the quirks apply to the usb-sata controller, not the disks.

User avatar
rooted
Posts: 7741
Joined: Fri Dec 19, 2014 9:12 am
languages_spoken: english
Location: Gulf of Mexico, US
Has thanked: 718 times
Been thanked: 206 times
Contact:

Re: SuperSLOW disk to disk file transfer

Post by rooted » Mon Mar 16, 2020 8:39 am

Ah, I thought it was to deal with certain HD controllers.

o_lampe
Posts: 175
Joined: Wed Jan 01, 2020 12:35 am
languages_spoken: english german
ODROIDs: MC1 solo
Has thanked: 11 times
Been thanked: 16 times
Contact:

Re: SuperSLOW disk to disk file transfer

Post by o_lampe » Mon Mar 16, 2020 3:16 pm

Is there a magic pipeline command I can use?

Code: Select all

e.g.  sudo dd if=/dev/sda1/folder | ramdisk | of=/dev/sdb1/folder
Thanks both for the suggestions,
I'd hoped to get a tip, how to enable a r/w-buffer between both SSDs. The ramdisk has it's own issues ( I'll start another thread )

o_lampe
Posts: 175
Joined: Wed Jan 01, 2020 12:35 am
languages_spoken: english german
ODROIDs: MC1 solo
Has thanked: 11 times
Been thanked: 16 times
Contact:

Re: SuperSLOW disk to disk file transfer

Post by o_lampe » Tue Mar 17, 2020 1:43 am

I've changed the NTFS mount to big_writes and it almost doubled write speed to 35-40MB/s. Still a big gap between ext4disk_to_NTFSdisk transfer and RAMdisk_to_NTFS.
Even VLC/mp4 decoding is 25-30% slower, when I write to NTFS directly.

User avatar
rooted
Posts: 7741
Joined: Fri Dec 19, 2014 9:12 am
languages_spoken: english
Location: Gulf of Mexico, US
Has thanked: 718 times
Been thanked: 206 times
Contact:

Re: SuperSLOW disk to disk file transfer

Post by rooted » Tue Mar 17, 2020 2:00 am

I'm not sure how much performance you can expect from NTFS as I don't use it but that seems about right, you could try exfat since it's compatible with both and would be faster.
These users thanked the author rooted for the post:
o_lampe (Tue Mar 17, 2020 3:53 pm)

User avatar
mad_ady
Posts: 8126
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, C4, N1, N2, H2, Go, Go Advance
Location: Bucharest, Romania
Has thanked: 564 times
Been thanked: 397 times
Contact:

Re: SuperSLOW disk to disk file transfer

Post by mad_ady » Tue Mar 17, 2020 2:08 am

The performance also depends on the size of the file you're transferring. One big file will transfer faster than 100 small files of the same size (less overhead)

o_lampe
Posts: 175
Joined: Wed Jan 01, 2020 12:35 am
languages_spoken: english german
ODROIDs: MC1 solo
Has thanked: 11 times
Been thanked: 16 times
Contact:

Re: SuperSLOW disk to disk file transfer

Post by o_lampe » Wed Mar 18, 2020 3:12 am

rooted wrote:
Tue Mar 17, 2020 2:00 am
I'm not sure how much performance you can expect from NTFS as I don't use it but that seems about right, you could try exfat since it's compatible with both and would be faster.
I couldn't select exfat from the gparted partition selection list. Tried fat32 instead, but didn't improve speed.
I tried to install smartmontools to check SSD health, but it was a terrible mess. I followed the ubuntu wiki but I couldn't update the device-lib. My jmicron adapter was listed,but wasn't detected.
I asked pollin for a replacement. Stay tuned...

o_lampe
Posts: 175
Joined: Wed Jan 01, 2020 12:35 am
languages_spoken: english german
ODROIDs: MC1 solo
Has thanked: 11 times
Been thanked: 16 times
Contact:

Re: SuperSLOW disk to disk file transfer

Post by o_lampe » Thu Mar 26, 2020 2:57 am

I've noticed, that the 'big_writes' option had a huge effect on etx4 partitions, so I changed mount options via 'disks'. The changes are fixed in /etc/fstab , but they seem to be at the wrong place? After a reboot the drives are slow again and I have to send 'sudo mount -o remount,big_drives /path/to/mountpoint' again...
Where is the right place to put the magic disk-accelerator?
Attachments
big_writes.png
big_writes.png (117.35 KiB) Viewed 1328 times

User avatar
rooted
Posts: 7741
Joined: Fri Dec 19, 2014 9:12 am
languages_spoken: english
Location: Gulf of Mexico, US
Has thanked: 718 times
Been thanked: 206 times
Contact:

Re: SuperSLOW disk to disk file transfer

Post by rooted » Thu Mar 26, 2020 6:23 am

Disregard, I misread.

o_lampe
Posts: 175
Joined: Wed Jan 01, 2020 12:35 am
languages_spoken: english german
ODROIDs: MC1 solo
Has thanked: 11 times
Been thanked: 16 times
Contact:

Re: SuperSLOW disk to disk file transfer

Post by o_lampe » Thu Mar 26, 2020 5:33 pm

No matter, what I try, I have to repeat the big_write remount action everytime. Is there a chance to put it in a .sh file and autostart it at boot time?

o_lampe
Posts: 175
Joined: Wed Jan 01, 2020 12:35 am
languages_spoken: english german
ODROIDs: MC1 solo
Has thanked: 11 times
Been thanked: 16 times
Contact:

Re: SuperSLOW disk to disk file transfer

Post by o_lampe » Thu Mar 26, 2020 9:47 pm

I've noticed another weird thing:
when I remount a NTFS partition it's OK to write

Code: Select all

sudo mount -o remount,big_writes /media/mountpoint
but for ext4 partitions I have to add a space between the options:

Code: Select all

sudo mount -o remount, big_writes /media/mountpoint
Otherwise I get an errormessage

Code: Select all

# without space
odroid@odroid:~$ sudo mount -o remount,big_writes /media/usb3
[sudo] password for odroid: 
mount: /media/usb3: mount point not mounted or bad option.
# with space
odroid@odroid:~$ sudo mount -o remount, big_writes /media/usb3
odroid@odroid:~$ 

User avatar
mad_ady
Posts: 8126
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, C4, N1, N2, H2, Go, Go Advance
Location: Bucharest, Romania
Has thanked: 564 times
Been thanked: 397 times
Contact:

Re: SuperSLOW disk to disk file transfer

Post by mad_ady » Fri Mar 27, 2020 12:21 am

-o options are comma separated without spaces. If you add spaces the command is interpreted differently and either generates an error or it could be silently ignored.

Regarding big_writes - this is a ntfs specific parameter and should either generate an error or be ignored for other filesystem types.

o_lampe
Posts: 175
Joined: Wed Jan 01, 2020 12:35 am
languages_spoken: english german
ODROIDs: MC1 solo
Has thanked: 11 times
Been thanked: 16 times
Contact:

Re: SuperSLOW disk to disk file transfer

Post by o_lampe » Fri Mar 27, 2020 4:26 pm

I have made several copy/paste tests to figure out, whether it is 'silently ignored' or not. Only when I use it with space after the comma, I see 3 times faster write speed on ext4 partition (uasp-raid0). 50-60MB/s vs. 160MB/s
The problem with big_writes seems to be known since 2016. I have no idea how its related to ext4, but maybe it has an impact on the uas-driver?

BTW: I tried to switch off uas driver with

Code: Select all

usb-storage.quirks=0x174c:0x1153:u
, but had no luck

o_lampe
Posts: 175
Joined: Wed Jan 01, 2020 12:35 am
languages_spoken: english german
ODROIDs: MC1 solo
Has thanked: 11 times
Been thanked: 16 times
Contact:

Re: SuperSLOW disk to disk file transfer

Post by o_lampe » Fri Mar 27, 2020 6:40 pm

I figured out how to disable uas-driver for both uas-SATA adapters I have. Just replace the devices number with the ones, I found with lsusb. (separated by a comma without space ;) )

Code: Select all

setenv bootargs ... usb-storage.quirks=0x152d:0x0561:u,0x152d:0x9561:u
Then I tested copy/paste speeds again and I can confirm, that the write-speed advantage I saw before were related to the uasp-driver.
Now I see 125MB/s writing to ext4 ( was 160MB/s before ) and 35-40MB/s writing to NTFS, no matter if I do the remount,big_writes or not. (big_writes is already in fstabs for NTFS partitions) Without big_writes I got 10-15MB/s writing to NTFS.

Post Reply

Return to “Ubuntu”

Who is online

Users browsing this forum: No registered users and 0 guests