.mta files - I can't delete them!

The WDMC itself, or possibly my Samsung TV, or possibly aliens or something, have filled most/all my WDMC with files with the .mta extension

After googling I find out they’re probably thumbnails/index files of some kind. Anyway, I don’t need them nor want them, but they are seemingly impossible to delete ? 

Using xplorer2, I do a search for “*.mta” on the WDMC + one attached hard disk, which turns up a huge number of .mta files, wasting space, attempting to delete them however just gives an error message along the lines of “this command cannot be performed on these files” … 

So I suppose I must go elevated command prompt or something to delete them ? But how will I then find them and delete them all in one go ? xplorer2 searches across all drives/directories/subdirectories and gives me the list, as far as I remember from back in the old MS-DOS command prompt days there is no search function like that, nor any way to delete these files from so many different locations without having to do it one by one … :frowning:

Any tips ? Thanks!

Saw in the other post you already met root? :wink:

find /DataVolume/shares/ -type f -iname *.mta -exec rm -f {} \;
1 Like

Yeah I’ve met root and it was kind of a scary encounter … :slight_smile:

But I’ve learnt my lesson and so will now ask my way around before doing anything else stupid…

So all I do is log in to SSH and type EXACTLY that ?

There’s no substition/code here, e.g. I have to type (something) instead of (datavolume) ?

Thank you again, for gradually bringing me out of despair :slight_smile:

I found most of the files now, they were just weirdly nested in subfolders here and there…

No problem, just help to resolve those other threads once you’ve fixed them. You don’t want to get notified in the next few months with someone offering a solution.

Yes, no subs, just copy & paste exactly from the code box…

one minor change. *.mta should be \*.mta

the backslash escapes the * so find will apply it to each file as it runs, without it the shell will replace the * with the name of any .mta files in the current directory.

I would also suggest replacing rm with ls -ad and run it just to be sure you only have the files you intend to remove, then edit the command line to change ls -ad to the real command

Thanks Larry!

Yeah, I noticed while doing a *.mta search after running that command that there were still a number of these files remaining.

So, for a complete nooooob, then, the command would be:

find /DataVolume/shares/ -type f -iname \*.mta -exec ls -ad -f {} ;

Followed by:

find /DataVolume/shares/ -type f -iname \*.mta -exec rm -f {} ;

Correct ?

Is there no way to cut & paste these commands into putty ? I’ve tried the usual Windows highlighting/right-clicking, as well as ctrl+c then ctrl+v, but putty does not respond.

(And, dumb question, again, but there is not a space between the first “{” and the second “}” ?)

Thanks again computer geniuses :slight_smile:

Sophie

close, the -f is part of the rm (remove) command so should not be with the ls command

find /DataVolume/shares/ -type f -iname \*.mta -exec ls -ad {} ;

in putty just right click to past, click and drag to select or double click to select a word

no space between the {} brackets, there is a space between } and ;

for safety I would use the cursor keys, backspace & delete to change the ls -ad to rm -f, this helps eliminate typos in the command such as a space after the * which would delete all files under /DataVolume/shares.

any time I do a destructive find I make it a habbit to show the files 1st, then edit the command just to minimize the risk. if the ls does not return exacly what you expect, fix it before the rm as there is no real recovery from that.

also if you are not positive these .mta files are not needed you could do somthing like this which would rename the files by adding a .bak extension

find /DataVolume/shares/ -type f -iname \*.mta -exec ls -ad {} ;

find /DataVolume/shares/ -type f -iname \*.mta -exec mv {} {}.bak ;

and later on do:

find /DataVolume/shares/ -type f -iname \*.mta.bak -exec ls -ad {} ;

find /DataVolume/shares/ -type f -iname \*.mta.bak -exec rm -f {} ;

1 Like

Brilliant, thank you all very much, you should be getting paid!

The hours I’ve wasted on the phone with WD Support for the simplest of tasks, with zero progress of any kind …

Soph

Yes larryg0 is right about the escape, very good info, I was assuming there’s no *.mta files on your cwd, root path right after login? The escape is needed mostly for * or *.* or excluding matching wildcard mask in the current cwd else it will translate matching files currently in cwd. Glad it worked out for you…

1 Like

Should the WDMC default SSH login name + password be immediately changed to something else, just like everyone should be changing their router’s default “admin / admin” login when they first use it ?

… and if so, how ? 

It should be safe as the NAS sits behind your router, unless you expose the ports to the net or put the router in DMZ mode…

To change root’s password, just enter “passwd”, no quotes, in the terminal then follow the prompts. Yes passwd without the “or”…