Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4890

Beginners • Improved NTFS Samba speed on RPi4 with USB drive

$
0
0
TL;DR
I used "ntfs3" as the file system type in "/etc/fstab" rather than "ntfs-3g" and it increased the write speed from 32MB/s to 110MB/s on my NTFS formatted Samba shares. Read speeds remained the same at 110MB/s. I'm on a 1Gbps network infrastructure (125MB/s) so the little RPi4 NAS is now reading and writing at pretty much the maximum possible speed.

DETAILS
Hi all, I just wanted to share an optimization I found when trying to improve samba transfer speeds. I have a RPi4 with two USB SSD drives where drive 1 does 900MB/s reads and 200MB/s writes while drive 2 does 500MB/s reads and writes (both when using USB...not over the network). The OS is on drive 1 and its main large partition is NTFS, and drive 2 only has a single paritition and is also NTFS. I have both partitions setup as separate samba shares and can access them on my 1Gbps network infrastructure (about 125MB/s maximum theoretical transfer rates). Both drives are plugged into a powered USB3 hub that is connected to one of the RPi4's USB3 ports. I had to use a powered USB3 hub because the power coming from the RPi4 was not enough for the drives to work.

After initially getting everything configured and for the next few years, I had the file system type of the two drives in "/etc/fstab" set to "ntfs-3g" and this resulted in 110MB/s reads but only 32MB/s writes. This was fine but I started working with video files that were > 1GB, so I looked to see if the speeds could be improved. I saw some posts about using "ntfs3" as the file system type and it's a kernal mode driver rather than user mode, and for some reason it made the writes a lot faster for my particular setup.

This picture shows the "/etc/fstab" file and mount point "/mnt/sda3" is set to "ntfs3". This is the large partition on USB drive 1 where the OS is installed. This mount point is also a samba share that I mapped to a Windows computer as the S: drive, and you can see the speed writing a 1.2GB file to this share is around 110MB/s. Prior to making the file system type change, it was only 32MB/s.
ntfs3 test.png
This picture shows writing to the "/mnt/sdb1" mount point which is still set to "ntfs-3g". This is the single large partition on USB drive 2 and is also a samba share mapped to the T: drive on the Windows computer. You can see the speed writing the same 1.2GB file is only about 32MB/s, so it matched drive 1's old write speed.
ntfs-3g test.png
And finally, here is the speed after making drive 2 "ntfs3" as well. So now only the network is limiting the transfer rates!
ntfs3 test 2a.png

Statistics: Posted by dparson — Tue Jun 25, 2024 12:11 am — Replies 0 — Views 35



Viewing all articles
Browse latest Browse all 4890

Trending Articles