Configuring SMB share with NTFS drive

I did that, the problem is OpenWrt keeps defaulting back to "auto(ntfs) ro" on reboot. It's not mounting with "ntfs-3g rw" like it should. I just updated the OpenWrt doc page to be more clear about the config, but it's still a bug in OpenWrt somewhere. Need to add a script to do it manually, I'm just not clear on how fstab and block mount works so still looking for a way. The command would be something like "ntfs-3g /dev/sda1 /mnt/sda1 -o rw,big_writes".

The command I always used was -

ntfs-3g /dev/sda1 /mnt/storage -o rw,async

And it worked through 19.07.3, you might try making your own mount point instead of using the default one.

Well that's basically the command I used if you see my last post. 'Async' isn't needed it does that by default. 'Big_writes' is a performance option that is recommended. I just edited the OpenWrt docs and removed 'sync' because that's not recommended and slows down performance dramatically. Getting this information from here: https://www.tuxera.com/community/ntfs-3g-faq/

My issue is that that works, it's just that it doesn't save the config and OpenWrt resets upon reboot and goes back to "auto(ntfs) ro" no matter what I've tried and I'm back to being write protected and have to SSH in and renter all this. LuCI doesn't help either it resets as well. There has a got to be a file to put this in somewhere just can't find it.

I hate to ask an obvious question, but are you putting it in /etc/rc.local?

(I’ll set up an ntfs drive in a few hours to make sure it’s still working on mine)

Just now remembered that there was a bug that caused the contents of /etc/rc.local to get deleted on reboot, can’t remember when it was fixed, but I do know its been fixed in 19.07.3, so if you’re on an earlier build try upgrading.

1 Like

I'm on the latest 19.07.3, yea it might be a bug, but I put it in /etc/rc.local. Also put on kernel 5.4.42 but it worked this way on 4.14 too. I also configured it that way on LuCI. I'll look into the bug status, thanks for your help.

Tried an ntfs drive and it does work, but only in the usb2 port, it's not read at all in the usb3 port, I'm not sure if that problem was there before or not because I only use one drive and may have just been using the usb2 port all along, but it does read/write in the usb2 port. It's also not listed at all in fstab for some reason -

cat /etc/config/fstab

config global
	option anon_swap '0'
	option anon_mount '0'
	option auto_swap '1'
	option auto_mount '1'
	option delay_root '5'
	option check_fs '0'

config mount
	option uuid 'B8A4-11C5'
	option fstype 'exfat'
	option target '/mnt/storage'
	option enabled '0'

So I don't know what's going with your drive at this point unfortunately, fwiw here's my samba config -

config sambashare
	option browseable 'yes'
	option name 'ntfs'
	option path '/mnt/ntfs'
	option users ‘me’
	option read_only 'no'
	option guest_ok 'no'
	option create_mask '0777'
	option dir_mask '0777'

blkid -

# blkid

/dev/ubi1_0: UUID="141129ee-67fc-4361-9d10-a01a2f588402" TYPE="ubifs"

/dev/ubi0_1: UUID="15733a46-de11-4c77-b231-bc1e1ac6ac85" TYPE="ubifs"

/dev/ubi0_0: TYPE="squashfs"

/dev/mtdblock5: UUID="1586357954" TYPE="ubi"

/dev/mtdblock7: UUID="1352216545" TYPE="ubi"

/dev/mtdblock8: UUID="618476837" TYPE="ubi"

/dev/ubiblock0_0: TYPE="squashfs"

/dev/sda1: LABEL="test" UUID="51CF18F719908C0E" TYPE="ntfs" PTTYPE="dos" PARTUUID="337c4e2c-01"

And /etc/rc.local -

~# cat /etc/rc.local

# Put your custom commands here that should be executed once

# the system init finished. By default this file does nothing.

ntfs-3g /dev/sda1 /mnt/ntfs -o rw,async

exit 0

I tried with big_writes and that read/wrote fine too.

Literally all those files are empty on my router. I guess LuCI is buggy because I configured them on there and it keeps mounting it auto(ntfs) ro.

EDITS:
The following two things fixed it based on your config:

  1. Deleted the drive from mount points and saved.
  2. Added the line similar to yours to rc.local "ntfs-3g /dev/sda1 /mnt/sda1 -o rw,big_writes,noatime

Those are the performance options listed on the Tuxera doc. I'm gonna update the OpenWrt doc pages for ntfs to clarify this. Rebooted and it worked perfectly on the first try. Getting 100-110 MB/s reads and 80-90 MB/s writes. Finally! A little faster even than the stock Linksys firmware which runs kernel 4.4.14.

@mike thank you!!!

2 Likes