SMB illegal characters?

Status
Not open for further replies.

amps2volts

Cadet
Joined
Jan 27, 2015
Messages
4
I recently converted a server running AFP shares on a Open Indiana ZFS box. To FreeNAS 9.3 with SMB2_10 shares. I kept getting errors changing ACL permissions on the SMB shares. I found it was illegal characters the folders and files had from using AFP previously.

For SMB2_10 are these the only illegal characters?
:*/\?<>"|

The server shares has over 400 illegal characters. Is there a script, technique or program I can use to do batch name changing? Via SFTP,FTP,NFS? My thought is to setup a NFS share and use a desktop search engine.
 

emk2203

Guru
Joined
Nov 11, 2012
Messages
573

amps2volts

Cadet
Joined
Jan 27, 2015
Messages
4
Not sure that will work for me emk. Looks like that script is made to change characters in a .csv file. Thanks for trying to help.
I found two nifty utilities pyRenamer and Bulk Rename Utility. Going to give them a try on SFTP/FTP and NFS shares.
 

emk2203

Guru
Joined
Nov 11, 2012
Messages
573
The script was made for renaming the filenames of the *.csv files, you can substitute what you want for csv, * should also work.

I would be careful with Windows utilities like Bulk Rename Utility via FTP on your share. You rely on a lot of layers getting everything right for something like filename conversion with tricky characters. Risky. I would do it via SSH on the host system.
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
The script was made for renaming the filenames of the *.csv files, you can substitute what you want for csv, * should also work.

I would be careful with Windows utilities like Bulk Rename Utility via FTP on your share. You rely on a lot of layers getting everything right for something like filename conversion with tricky characters. Risky. I would do it via SSH on the host system.
I would even go one step further if you have enough free space on the nas. Modify the script to cp (instead of MV) to different directory and verify output was correct and +1 on avoiding BRU.
 

amps2volts

Cadet
Joined
Jan 27, 2015
Messages
4
Would that script recursively do all sub folders and files? I suck with scripts scared to change it and try it. Its pretty big server has 22TB of data 4HBA RAIDS, 18disks and guessing half million files and folders at least. Copying and moving things around takes long time and not much space.

I tested Bulk Rename Utility via SFTP on a volume worked pretty well but missed a lot kept getting errors. More then I thought changed 25,000 files and folders on one volume. I tired changing one of them manually that didn't work. Used SFTP on filezilla with root login. Was a folder with a bunch of ??? in it. Log said "Error: input_pushback not null!" What hell that mean? lol

So you guys right SSH only way. Would a find command like this work?

find . -depth -execdir rename 'y/[\:\;>\<\@\$#\&()\?\\%\ ]/_/' {} \;

I found that here
http://serverfault.com/questions/98...ers-from-all-files-in-a-directory-recursively
 

emk2203

Guru
Joined
Nov 11, 2012
Messages
573
Do yourself the favor and take something tested. I remembered something which you could use - http://detox.sourceforge.net/ .

detox is part of FreeBSD, if it is not installed, you can get it to install by first installing a jail, followed by adding your storage to it. After that, you enter the jail and add the detox package just by 'pkg install detox'.

For all further steps, use the manpage of detox. The 'safe' filter of detox would be ideal for your use case.

If you want to do it by script or by find command, I would search for general substitutions in filenames, not tied to FreeNAS. This is pretty universal with find and its brethren.
 
Last edited:

amps2volts

Cadet
Joined
Jan 27, 2015
Messages
4
Ok thanks for help will try detox out. Looks like awesome little utility. Its not installed in FreeNAS will try with a jail. I never used a jail yet.
 
Status
Not open for further replies.
Top