(Solved, partially) Issues accessing USB Storage in Windows

Hello LEDE Community,

First time poster so be gentle! I've had a TP-link Archer C7 v2 for a couple of years, it’s being used as a simple access point for a Windows 7 desktop and laptop and an Android smart-phone and tablet; I've also taken advantage of being able to have a 32GB, NTFS formatted, USB flash drive plugged into it to be able to quickly save files for transfer to one of my other devices if needed… my personal mini cloud storage!

Soon after purchasing the Archer C7 it started dropping the 5GHz so I flashed DD-WRT into it and except for a few minor issues it’s been quite dependable ever since… even for accessing the USB flash drive! However, some of the newer DD-WRT releases have had issues with not recognizing the USB storage so I decided to try something new… I noticed LEDE was being highly recommended by many so I reverted back to TP-Link and flashed in the latest version of LEDE… it all went smooth, as expected, until I tried to save the first setting in LuCI… seemed like it was taking forever to save so I… well, to make this first story shorter, it bricked the router into a boot-loop… and that’s another story!

The reason I’m here… after realizing I have a USB to Serial adapter and having soldering skills and taking a crash course in Putty and Tftping I began again and I now have LEDE up and running on my Archer C7 and except for 2 issues with USB storage I’m impressed with its performance and stability (the Wi-Fi lights work! LoL!) and would like to keep using it! Here are the issues I’m having…

No matter what build I try, LEDE Project, or someone else’s project, or how many software packages I install or update or how many changes I make from suggestions on the Net…

A) I cannot access my NTFS formatted flash drive, at all… the flash drive shows up in “Mounted file systems” and in “Mount Points”, the folder I created in Network Shares appears in Windows Explorer\Network under the proper Hostname as it should but I can’t transfer files to it! Either I get “Windows cannot access \\xxxxxxx\xxxxxx” or I don’t have permission to perform that action or there isn't enough space on the drive

B) BUT, if I remove the flash drive and reformat it to exFat using Windows and reinsert it, but no other changes, I can now access the folder and copy files or folders to and from that folder… unless I try to copy a single file larger than about 750MB’s, when I try doing that the copying files dialog box opens saying “calculating” and then after about 30 seconds I get an error dialog box stating…

There is a problem accessing \\xxxxxxx\xxxxxx
Make sure you are connected to the network and try again.

This happens the same on wired (desktop) or wireless (laptop)… I haven’t spent any time trying Android yet.

I really like the performance and stability of LEDE so any thoughts, ideas, suggestions on how to get my USB storage working “properly”, with either NTFS or exFat would be greatly appreciated… or it’s back to DD-WRT!

Thanks to all for any info provided!

Uncle Jed

Hello sorry i can't help but how did you get the NTFS drive to show up as i tried everything to mount a drive in LEDE and could never get it to show up

Eyerex, (Edit, Sept 6, 2017) I have an UPDATE!

Still just learnig but his worked for me… I re-flashed latest stock LEDE (uncheck keep settings) to start fresh. (Backup or take note of your relevant information first)

Format USB stick - NTFS with default settings, install stick in router.

In LuCI I installed these software packages:

block-mount
dosfstools
fdisk
kmod-fs-exfat
kmod-fs-msdos
kmod-fs-ntfs
kmod-fuse
kmod-nls-cp437
kmod-nls-iso8859-1
kmod-nls-utf8
kmod-scsi-core
kmod-usb-core
kmod-usb-ehci
kmod-usb-ledtrig-usbport
kmod-usb-ohci
kmod-usb-storage
kmod-usb-storage-extras
kmod-usb-uhci
kmod-usb2
kmod-usb3
libblkid
libfdisk
libusb-1.0
luci-app-samba
luci-i18n-samba-en
ntfs-3g
ntfs-3g-utils
ntfsprogs_ntfs-3g
samba36-server
usbutils

Reboot router, with these packages installed my router recognize my USB flash drive in Mount Points, my 32GB flash drive showed up under File System as… /dev/sda1/ (29599 MB) and under Mount Point as /mnt/sda1. Yours may be different. But you don’t want it to auto-mount; it will mount at the end of boot via local startup script!

In LuCI…
In System > Mount Points > Global Settings
Anonymous Swap - uncheck (not sure if this is needed to be unchecked)
Anonymous Mount - uncheck

In Mount Points > Mount Points
Enabled - uncheck
I added the Mount Point Device = /dev/sda1 Mount Point = /mnt/sda1 but Enabled is unchecked!
Mount Points > Edit - Enable this mount: uncheck
Save & Apply

In Services > Network Shares > General Settings:

Hostname should be the name of the host you will see in Windows\Explorer\Network (LEDE if you haven’t changed it) I named mine… Archer-C7_LEDE (Is also the same name I gave in LuCI > System > System > System Properties > Hostname)

Description is the same name (Archer-C7_LEDE)

Workgroup I set to the name of my Windows 7 Workgroup, in Windows see Start > Control Panel > System. Mine is named… OUTBACK

Share home-directories: 1

In Shared Directories

Name is the name of the FOLDER you want in Windows\Explorer\Network to copy your files to. I named mine… Mini Cloud

Path is the same as “Mount Point” in Mount Point, mine was /mnt/sda1. Yours may be different.

Allow guests: checked
Save & apply

In System > Startup > Local Startup text box (at bottom) (I used WinSCP to edit /etc/rc.local to have only the following 3 lines but after saving that file and rebooting the router the identical 3 lines appeared in the text box in LuCI) so It should work just editing the text in LuCI and Submit. (remember to edit your /dev/sda1 and /mnt/sda1 in that line to match yours) Hope that makes sense!

sleep 3

mount -t ntfs-3g -o noatime,big_writes /dev/sda1 /mnt/sda1

exit 0

Reboot router, wait, in Windows Explorer refresh the page (F5). In Windows Explorer\Network\Archer-C7_LEDE I now have a folder named “Mini Cloud” that auto mounts when booting the router and I’m now able to transfer large files like an 8GB movie from my desktop PC into that folder (the NTFS USB flash drive) and then access the same folder on my wireless laptop or my Android device or visa-versa! Transfer rates reaching 10MB/s. (Note the Workgroup name needs to be the same across all of your Windows devices!)

Thanks Per! Packages need for ntfs external drives

That's enough for today, hope that helps!

Uncle Jed

Have you considered the option of using a filesystem native to Linux like ext4 instead of NTFS?

You may also wish to see these OpenWrt wiki pages
https://wiki.openwrt.org/start?do=search&id=usb
https://wiki.openwrt.org/doc/howto/usb.essentials
https://wiki.openwrt.org/doc/howto/usb.storage
https://wiki.openwrt.org/doc/recipes/usb-storage-samba-webinterface

In general including your relevant config files is helpful

RangerZ,

Thanks for those links; they are the pages I have been learning from! Unfortunately I’m just a beginner at Linux and LEDE so knowing which files are my “relevant” config files is still something I’m realizing! Need a few more weeks! LoL!

eduperez,

Yes, I've briefly looked at that option but In Windows I believe I would then need another program to read the drive and another to format it in the first place. Also, when unplugging the drive and sharing files on another PC I would need the reader program on that PC as well. I think I’ll leave ext4 as a last resort! NTFS works fine in OEM TP-Link and in DD-WRT firmware, albeit a little slow, so it should work in LEDE.

Actually I now have it working, partially, by adding the following in PuTTY I’m able to transfer large files like an 8GB movie from my desktop PC onto the NTFS drive and then watch it on my Android and my laptop.

umount /dev/sda1
mount -t ntfs-3g -o noatime,big_writes /dev/sda1 /mnt/sda1

I just need to learn a little bit more Linux and LEDE to figure out which part of the “mount” script unlocked access to NTFS and then how to undo this… “Mount is denied because the NTFS volume is already exclusively opened.” so I don't need to run the "unmount" script and then how to have the “mount” script run automatically at boot… easy!

Once I have that figured out I will try using exFat and get that working. It should be faster than NTFS and it's native to Windows.

Thanks for the suggestions people,

Uncle Jed

start with fstab and samba

Update (and I updated my reply to Eyerex on Sept 6, 2017)

Still no luck transferring large files with exFat and smaller files only transfer at about 3MB/s over wireless anyway so for now I’ll put exFat to rest! NTFS seems to be working OK with transfer rates reaching 10MB/s wireless and 12MB/s wired. After spending some time here… http://www.tuxera.com/community/ntfs-3g-manual/ I’ve edited my startup script in /etc/rc.local to read…

sleep 3

mount -t ntfs-3g -o windows_names,big_writes,streams_interface=windows,permissions,inherit /dev/sda1 /mnt/sda1

exit 0

Adding user name with password.

I used this way to set up a general access user name with password to access my USB storage it has been working without problems. On each device now (Windows 7 and Android) you need to login to have access to the drive. Android appears to retain the login name and password after shutting off the device and restarting it, Windows 7 needs the login name and password reentered each time! I haven’t tried setting up multiple users and passwords!

Need WinSCP and Putty.

In WinSCP> etc/passwd add the following user name line... (For this example I'll use user name... admin and password… coffee)

admin:*:1001:65534:admin:/var:/bin/false and save the file.

in LuCI > Services > Network Shares > General Settings: Share home-directories: 0
in LuCI > Services > Network Shares > Shared Directories > Allowed users: type your user name (admin)
in LuCI > Services > Network Shares > Allow guests: uncheck

Login to router with PuTTY. Type… smbpasswd -a admin (enter) (this sets the password for user name... admin)
PuTTY responds with New SMB password: (type your chosen password… coffee enter, it will not appear!)
Then Retype SMB password: (type chosen password again... coffee enter)

You’re done! (may need to restart PC and router) In Windows a small credential window should now open when attempting to access the drive.

Hope this helps!

Uncle Jed

1 Like

Paul,

You welcome, glad it helped! Took me forever to figure it out! Learning Linux and Lede is like trying to understand assembly manuals translated from Chinese! Lol!

I replied to your login/password question in that thread. I received lots of authentication errors as well getting it to work. Rebooting the PC and the router after making the changes is a must!

Hope that helps!

Steve

Hi Steve.

I ended up figuring it out. I had the share folder mapped to a drive letter. After removing it from Windows Explorer, I tried again and was able to successfully connect with my login credentials.

Paul

1 Like

I have no access to the usb 3 disk in NTFS, there is no access rights to Windows 10, via winSCP-ok.
And also in ext4 -all ok. I can't to open the disk under NTFS (you do not have access rights, contact the administrator)
Could you help me please?

[global]
netbios name = |NAME|
interfaces = |INTERFACES|
server string = |DESCRIPTION|
unix charset = |CHARSET|
workgroup = |WORKGROUP|

## This global parameter allows the Samba admin to limit what interfaces on a machine will serve SMB requests.
bind interfaces only = yes

## time for inactive connections to-be closed in minutes
deadtime = 15

## disable core dumps
enable core files = no

## set security (auto, user, domain, ads)
security = user

## This parameter controls whether a remote client is allowed or required to use SMB encryption.
## It has different effects depending on whether the connection uses SMB1 or SMB2 and newer:
## If the connection uses SMB1, then this option controls the use of a Samba-specific extension to the SMB protocol introduced in Samba 3.2 that makes use of the Unix extensions.
## If the connection uses SMB2 or newer, then this option controls the use of the SMB-level encryption that is supported in SMB version 3.0 and above and available in Windows 8 and newer. 
## (default/auto,desired,required,off)
#smb encrypt = default

## set invalid users
invalid users = root

## map unknow users to guest
map to guest = Bad User

## allow client access to accounts that have null passwords. 
null passwords = yes

## The old plaintext passdb backend. Some Samba features will not work if this passdb backend is used. (NOTE: enabled for size reasons)
## (tdbsam,smbpasswd,ldapsam)
passdb backend = smbpasswd

## Set location of smbpasswd ('smbd -b' will show default compiled location)
#smb passwd file = /etc/samba/smbpasswd 

## LAN (IPTOS_LOWDELAY TCP_NODELAY) WAN (IPTOS_THROUGHPUT) WiFi (SO_KEEPALIVE) try&error for buffer sizes (SO_RCVBUF=65536 SO_SNDBUF=65536)
socket options = IPTOS_LOWDELAY TCP_NODELAY

## If this integer parameter is set to a non-zero value, Samba will read from files asynchronously when the request size is bigger than this value.
## Note that it happens only for non-chained and non-chaining reads and when not using write cache.
## The only reasonable values for this parameter are 0 (no async I/O) and 1 (always do async I/O).
## (1/0)
#aio read size = 0
#aio write size = 0

## If Samba has been built with asynchronous I/O support, Samba will not wait until write requests are finished before returning the result to the client for files listed in this parameter.
## Instead, Samba will immediately return that the write request has been finished successfully, no matter if the operation will succeed or not.
## This might speed up clients without aio support, but is really dangerous, because data could be lost and files could be damaged. 
#aio write behind = /*.tmp/

## lower CPU useage if supported and aio is disabled (aio read size = 0 ; aio write size = 0)
## is this still broken? issue is from 2019 (NOTE: see https://bugzilla.samba.org/show_bug.cgi?id=14095 )
## (no, yes)
#use sendfile = yes

## samba will behave as previous versions of Samba would and will fail the lock request immediately if the lock range cannot be obtained.
#blocking locks = No

## disable loading of all printcap printers by default (iprint, cups, lpstat)
load printers = No
printcap name = /dev/null

## Enabling this parameter will disable Samba's support for the SPOOLSS set of MS-RPC's.
disable spoolss = yes

## This parameters controls how printer status information is interpreted on your system.
## (BSD, AIX, LPRNG, PLP, SYSV, HPUX, QNX, SOFTQ)
printing = bsd

## Disable that nmbd is acting as a WINS server for unknow netbios names
#dns proxy = No

## win/unix user mapping backend
#idmap config * : backend = tdb

## Allows the server name that is advertised through MDNS to be set to the hostname rather than the Samba NETBIOS name.
## This allows an administrator to make Samba registered MDNS records match the case of the hostname rather than being in all capitals.
## (netbios, mdns)
mdns name = mdns

## Clients that only support netbios won't be able to see your samba server when netbios support is disabled.
#disable netbios = Yes

## Setting this value to no will cause nmbd never to become a local master browser.
#local master = no

## (auto, yes) If this is set to yes, on startup, nmbd will force an election, and it will have a slight advantage in winning the election. It is recommended that this parameter is used in conjunction with domain master = yes, so that nmbd can guarantee becoming a domain master. 
#preferred master = yes

## (445 139) Specifies which ports the server should listen on for SMB traffic.
## 139 is netbios/nmbd
#smb ports = 445 139

## This is a list of files and directories that are neither visible nor accessible.
## Each entry in the list must be separated by a '/', which allows spaces to be included in the entry. '*' and '?' can be used to specify multiple files or directories as in DOS wildcards.
veto files = /Thumbs.db/.DS_Store/._.DS_Store/.apdisk/

## If a directory that is to be deleted contains nothing but veto files this deletion will fail unless you also set the delete veto files parameter to yes.
delete veto files = yes

################ Filesystem and creation rules ################
## reported filesystem type (NTFS,Samba,FAT)
#fstype = FAT

## Allows a user who has write access to the file (by whatever means, including an ACL permission) to modify the permissions (including ACL) on it.
#dos filemode = Yes

## file/dir creating rules
#create mask = 0666
#directory mask = 0777
#force group = root
#force user = root
#inherit owner = windows and unix