SOLVED FTP content not updating when files are added via SMB

Status
Not open for further replies.

hobesman

Dabbler
Joined
Oct 5, 2016
Messages
10
I have FreeNAS 11 configured and both FTP and SMB seem to be working correctly as far as I can tell, except that when I add files to the dataset via SMB, and then browse via FTP, those files do not appear in my FTP client, browser, etc. Similarly, some files and directories added via SMB sometimes do not appear in mounted folders within jails. Does anyone know why that is? And I'd be especially grateful to know what I can do about it.
Thanks!

PS I'm happy to read up on it if someone could point me to the right reading material, but I tried searching and didn't find anything on my own.
 

Artion

Patron
Joined
Feb 12, 2016
Messages
331
Permissions?
 

hobesman

Dabbler
Joined
Oct 5, 2016
Messages
10
Hi thanks for your help. Which permissions would you suggest I look at? I realize I need to clarify a few things:

Everything in the dataset was added via SMB with the permissions as they currently are. I was noticing that certain files weren't showing in jails, but most of them are there. Then I tried to add new files via SMB and those too were not visible via FTP, as well as the ones that I wasn't seeing in jails, so I'm guessing it's the more recent files that aren't showing.
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
They never show up or if you wait longer things update?

Can you describe your permissions? Who owns the dataset, who is authenticating to the smb share, who is authenticating to the ftp, do you have guess access turned in for the smb share?

Screenshots are also a great way to provide this info.
 

hobesman

Dabbler
Joined
Oct 5, 2016
Messages
10
It's coming up on 24 hours and they're still not visible. I'm not sure what I'm waiting for so I didn't know how long is reasonable.

Who owns the dataset: user: hobes, and group: hobes
Authenticating to the SMB share: hobes
Authenticating to the FTP: hobes
Guest access on SMB: not enabled
dataset permissions.PNG FTP settings.PNG SMB share settings.PNG
 

hobesman

Dabbler
Joined
Oct 5, 2016
Messages
10
Here's a screenshot of the FTP client next to the Windows SMB window with the most recent file I added. A folder I added >8hrs ago ("KioskSettings") and its contents are not showing up via FTP.

side-by-side.png
 

hobesman

Dabbler
Joined
Oct 5, 2016
Messages
10
Oh, and one more clarification: I'm in the process of getting everything set up. The machine has been running for about a week now and the jails and FTP for 3-4 days. I've been copying things over from a windows host, and that finished about 36 hours ago for the most part. I added the storage to the jails somewhere along the way, but perhaps before the main copy session had finished. I'm guessing that's why it doesn't see certain files, perhaps the ones copied since adding the storage to the jail? I tried stopping and starting the FTP service but that didn't change what I see there.
 

Artion

Patron
Joined
Feb 12, 2016
Messages
331
It's coming up on 24 hours and they're still not visible. I'm not sure what I'm waiting for so I didn't know how long is reasonable.

Who owns the dataset: user: hobes, and group: hobes
Authenticating to the SMB share: hobes
Authenticating to the FTP: hobes
Guest access on SMB: not enabled
View attachment 21172 View attachment 21173 View attachment 21174
If you tick the 'Always chroot', when you connect through ftp it will point you to the home share folder of the user and not at the ftp root share, so thats why you cant see the uploads on the smb share. Take a look at what folders opens on ftp. Create some file and search from the shell of FN for those to confirm this behaviour. The folder you set up un ftp service is for the anonymous user, when enabled.

Inviato dal mio YD201 utilizzando Tapatalk
 

Artion

Patron
Joined
Feb 12, 2016
Messages
331
If you tick the 'Always chroot', when you connect through ftp it will point you to the home share directory of the user and not at the ftp root share, so thats why you cant see the uploads on the smb share. Take a look at what folders opens on ftp. Create some file and search from the shell of FN for those to confirm this behaviour. The folder you set up un ftp service is for the anonymous user, when enabled.

Inviato dal mio YD201 utilizzando Tapatalk



There is a similar thread: https://forums.freenas.org/index.php?threads/58506/
 

hobesman

Dabbler
Joined
Oct 5, 2016
Messages
10
If you tick the 'Always chroot', when you connect through ftp it will point you to the home share folder of the user and not at the ftp root share, so thats why you cant see the uploads on the smb share. Take a look at what folders opens on ftp. Create some file and search from the shell of FN for those to confirm this behaviour. The folder you set up un ftp service is for the anonymous user, when enabled.

Inviato dal mio YD201 utilizzando Tapatalk

Thanks for your help! I'm not sure if I follow you all the way though. The home share folder for hobes is a parent folder above the SMB share, so it was still possible to navigate to the SMB filesystem from the FTP client and view files that had been saved there, albeit not new files. I unticked "Always chroot" and now FTP opens to the same place as the SMB share (because that's what I had put as the FTP path) but the new files added via SMB are still not visible.

I created a folder and copied a few files via FTP. Those are also not visible in the SMB share. I navigated to the folder in FN shell and sure enough, there's the folder I created via FTP, but NOT the most recent SMB files. So is it SMB that isn't syncing changes somehow?
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
Your ftp uses sharesz2 and your smb uses sharesz2 but they are different paths. Are you sure you are even looking in the correct directory? You have 2 sharesz2 directories in your system.
 

hobesman

Dabbler
Joined
Oct 5, 2016
Messages
10
Your ftp uses sharesz2 and your smb uses sharesz2 but they are different paths. Are you sure you are even looking in the correct directory? You have 2 sharesz2 directories in your system.

DING DING DING We have a winner! Thank you!!! Now to clean up this mess...
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
Screen shots makes things so much easier. Hope this fixed your jails also.
 

hobesman

Dabbler
Joined
Oct 5, 2016
Messages
10
So do I really have two copies of all of these files? Or is there a chance one is a branch of another or something, and deleting the wrong one would effect both?
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
If they truly are different directories then they are separate. best way to check is to use the command line at this point.

Code:
ls -la /mnt/Z2SixDisk/
ls -la /mnt/Z2SixDisk/SharesZ2
ls -la /mnt/Z2SixDisk/DSSixDisk
ls -la /mnt/Z2SixDisk/DSSixDisk/SharesZ2
 

hobesman

Dabbler
Joined
Oct 5, 2016
Messages
10
After confirming that I in fact had two copies, I used:
rsync -av /mnt/Z2SixDisk/SharesZ2 /mnt/Z2SixDisk/DSSixDisk/

If I understand correctly, that scanned the first folder and sent anything to the second folder that wasn't already there. Then I fixed the references in jail storage, ftp, etc. to refer to the correct SharesZ2 folder and deleted the first folder and called it a day. Thanks everyone!
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
If it works works but next time don't use rsync, cp is must faster and does the same thing.
 

hobesman

Dabbler
Joined
Oct 5, 2016
Messages
10
Thanks for the suggestion. I'll try that if there is a "next time." (Fingers crossed! Not sure how I managed to botch it this time.)

Initially I tried mv but it wouldn't work because the folders each already had content and mv wouldn't "merge" folders. I assumed cp would have the same objection, but when I googled merging folders the first few responses said use rsync, so that's what I went with this time.
 
Status
Not open for further replies.
Top