0

I have my 4GB Pi4 set up with automount and have an NTFS formatted USB3 hard drive, connected via the USB 3 port.

Looking at the driver via the mount command:

/dev/sda1 on /media/Seagate_sda1 type fuseblk (rw,nosuid,nodev,noexec,noatime,sync,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096,user)

The issue I am running into is that when I try uploading via SMB or SFTP, from a machine on the same network via wifi, the transfer is very slow. At the same time trying the same operation but to the SD card is much faster. While I can't quote exact transfer speeds, I did do a simple test to get an idea of the time it took for a copy (see below).

When it comes to reading it is faster enough to play back real time using VLC on an iPhone, with SMB as the file transfer protocol.

A stopwatch timing of a local copy of a 700MB file resulted in:

  • NTFS -> SD: 39 seconds
  • SD -> NTFS: After 18 minutes only 27MB had been transferred

When using the same drive on Windows it was nowhere this slow.

BTW encryption is disabled for SMB, since it will be used on locally on a home network only. It is a risk, but figuring it is for home use only decided to accept it:

[global]

smb encrypt = disabled

Though it is clear that the network is not the cause of the slow down here, based on the speed tests I did of the local file copy.

Can anyone suggest what I should be doing to increase the write speeds to the NTFS drive?

5
  • does this USB3 drive use UAS mode? Commented Jan 26, 2021 at 23:01
  • I don't know if it does and I am not sure how to check? Also what difference does it make?
    – Andre M
    Commented Jan 26, 2021 at 23:27
  • UAS is an order of magnitude faster ... lsusb -t will show you Commented Jan 27, 2021 at 0:07
  • Do you have any good instructions on configuration?
    – Andre M
    Commented Jan 28, 2021 at 14:00
  • no, there is no configuration regarding UAS, it just is or isn't available Commented Jan 28, 2021 at 21:53

1 Answer 1

0

On my install the command being used for automount was at /usr/local/bin/automount, with the following contents:

#!/bin/bash
 
PART=$1
FS_LABEL=`lsblk -o name,label | grep ${PART} | awk '{print $2}'`
 
if [ -z ${FS_LABEL} ]
then
    /usr/bin/pmount --umask 000 --noatime -w --sync /dev/${PART} /media/${PART}
else
    /usr/bin/pmount --umask 000 --noatime -w --sync /dev/${PART} /media/${FS_LABEL}_${PART}
fi

Based on reading other threads about 'sync' causing slow downs for mounted partitions, I removed that option and the restarted the Pi. That same SD to NTFS copy now takes about 28 seconds!!!

Checking the pmount man page on the --sync option:

Mount the device with the sync option, i. e. without write caching. Default is async (write-back). With this option, write operations are much slower and due to the massive increase of up‐dates of inode/FAT structures, flash devices may suffer heavily if you write large files. This option is intended to make it safe to just rip out USB drives without proper unmounting.

Excluding this option means you get a massive speed increase, but you'll need to remember to use umount before unplugging the drive, to avoid potential data loss.

2
  • Or just turn off the annoying auto-mount option.
    – Milliways
    Commented Jan 26, 2021 at 23:20
  • What's annoying about it? It saves me from having to mess around with fstab, for disks that won't necessarily be permanently mounted.
    – Andre M
    Commented Jan 26, 2021 at 23:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.