problems deleting files/directory

Please post anything pertaining to Mac and OS X compatibility issues here.

problems deleting files/directory

Postby stefsegers » Wed Sep 03, 2008 11:07 am

Hey all,

I have some trouble deleting files from the NAS.
When I try to remove some files or a directory I get the message the the directory or file is in use.

I tried everything. Permissions, DS_Store clean, permission of the share nothing worked at all.....

The only thing that seems to work is to dlete the whole share and then create it again.

The thing is that this happens not with very file.


Also I get errors sometimes when i copy files from NAS to mac...... dds_store problem but that's solved....
But because I can't delete some files/directories (mostly directories) I can't move my files....

Also a big problem of OSX is that even when you are at 99% from 100Gb with 100.000 files...... and you have a error.. you can just start over again because OSX will not continue afterwards....


I hope somebody has a solution for me?
stefsegers
ReadyNAS Newbie
 
Posts: 20
Joined: Sat Jul 22, 2006 12:06 am

Re: problems deleting files/directory

Postby Vatoe » Fri Sep 19, 2008 3:21 pm

I had a problem very recently where I couldn't delete a file (a 14 gig sparseimage file) from the NAS. I tried everything I could find via the internet, but I kept getting the file in use error. My solution: restart the NAS then it was able to be deleted...might be worth a try if you haven't already.
Vatoe
Advanced ReadyNAS User
 
Posts: 104
Joined: Wed Jun 25, 2008 1:42 am
Location: NSW, Australia
ReadyNAS: NVX

Re: problems deleting files/directory

Postby stefsegers » Fri Sep 19, 2008 10:39 pm

Tried it.... but after restarting the NAS stilll same problem :(

The strange thing is that you can replace the dirctories to another dir within the share.... but deleting that afterwards won't work....
stefsegers
ReadyNAS Newbie
 
Posts: 20
Joined: Sat Jul 22, 2006 12:06 am

Re: problems deleting files/directory

Postby Vatoe » Sat Sep 20, 2008 2:53 am

My strange behaviour was that I could rename the file, but coudn't delete it? The restart worked wonders for me. If you can rename the file try, renaming it something.txt and then opening text edit and over writing the file (by saving a file) with the same name. It didn't work for me, but it might for you?
Vatoe
Advanced ReadyNAS User
 
Posts: 104
Joined: Wed Jun 25, 2008 1:42 am
Location: NSW, Australia
ReadyNAS: NVX

Re: problems deleting files/directory

Postby stefsegers » Sat Sep 20, 2008 6:11 am

I can rename it.. but.... they are Directories and not files......

Renamed every dir ->moved them -> restarted NAS..... still nothing :(

It's not the first time this happens.... best option I can remember was to copy all the files from the share to a local drive..... then remove the share and rebuild it again and copy the files back to the NAS....

It's the only option that works over here but not the way it has to be right?

For this share it surely isn't an option (250gb share!!!)
stefsegers
ReadyNAS Newbie
 
Posts: 20
Joined: Sat Jul 22, 2006 12:06 am

Re: problems deleting files/directory

Postby luddy3 » Thu Sep 25, 2008 9:06 pm

I have been having a ton of problems deleting stuff from my NAS, on shares that provide AFP and RSYNC access. I mount these shares via AFP in the Mac finder, but I use rsync to actually populate them. Rsync works great, but if I want to delete a file or directory via the finder, I often get failures because of 'bad argument' or file in use.

Deleting the files via rsync is inconvenient but it seems to always work. I have to create a temporary directory on the host machine with empty versions of the directories I want to delete, and use the --delete option. It's a hassle, but as I say, it works.

-Luddy Harrison
luddy3
ReadyNAS Newbie
 
Posts: 2
Joined: Sun Sep 07, 2008 7:36 pm

Re: problems deleting files/directory

Postby teehemkay » Sun Sep 28, 2008 7:08 am

I have been struggling with this very same problem for months. Today I decided that I'd had enough of it and that I needed to find a solution. Luckily, I seemed to remember that I once had a similar problem and that it was related to some special invisible dot file missing.

So I started to look into the problematic folders.

I've noticed that I only have the problem with empty directories. And all those empty directories had the following in common: they missed the .DS_Store file.

So the solution for me was to create an empty .DS_Store file (e.g. by typing touch foo/.DS_Store where foo was the name of the problematic directory) in the problematic directory. After that, I was able to delete it.

I sometimes had to retry several time but so far, I've always been able to delete all the problematic directories.

HTH

= tmk =
teehemkay
ReadyNAS Newbie
 
Posts: 7
Joined: Wed Jul 25, 2007 6:16 am

Re: problems deleting files/directory

Postby teehemkay » Mon Sep 29, 2008 12:36 pm

OK, turned out the problem was actually worse than what I described above.

From what I can understand, in *my* case (YMMV), the problem seems to be that some files appear in directory listing but don't actually exist in the filesystem.

Now the question is how is this possible? Well I'm wondering if this is not the result of some bug.

In my case, the missing files are mostly .DS_Store files and ._foo files. I remember erasing these files because there where causing problems when transfered to a MS-DOS FAT32 formatted harddrive.

I deleted those files using a command similar to the following: find -name <somedirectory> "._*.txt" -delete

I suppose that what happened is something like this: although those files (which are mac specific resource forks) were deleted from the filesystem, some "reference" to those files were still kept in some index table used to quickly list directory content.

So the Finder and other tools gets confused when trying to delete this ghosts file.

My solution was to write a small python script that walks a folder hierarchy checking for those ghost files and when finding one making sure it exists in the filesystem (by touch'ing them).

After running my script I was always able to delete any folder.

HTH

= tmk =
teehemkay
ReadyNAS Newbie
 
Posts: 7
Joined: Wed Jul 25, 2007 6:16 am

Re: problems deleting files/directory

Postby Vatoe » Mon Sep 29, 2008 2:59 pm

Nice one. I am glad you got it sorted, as I'm sure one days others will be affected by the same problem. Pythons scripts are beyond me though :?
Vatoe
Advanced ReadyNAS User
 
Posts: 104
Joined: Wed Jun 25, 2008 1:42 am
Location: NSW, Australia
ReadyNAS: NVX

Re: problems deleting files/directory

Postby igor » Mon Sep 29, 2008 4:43 pm

Hello
I did have, and have a similar problem folders and docs not deleting,
it reminded me of a similar problem, when I moved / copied a locked file from one mac to an other it would not deleted.

but I am the admin and so root user, so I did solve it the linux way, in terminal.

and it seems so far to work here.

open the terminal and type [sudo rm -rf ]
then drop the folder or file in the terminal window
and type the enter key, it will ask for you password (the admin password of your mac)
and delete the directory or file.

why
sudo It makes the command a superuser or root command.
rm remove
-f force don't ask
-r recursive empty directories and then delete
the drop puts the path to the file or dir. in the line

with doc rm you get more info on rm try it

igor
igor
ReadyNAS Newbie
 
Posts: 33
Joined: Tue May 15, 2007 11:18 am
Location: the nederlands

Re: problems deleting files/directory

Postby teehemkay » Tue Sep 30, 2008 6:20 am

Hi Igor

Thanks for chiming in.

I Should have mentioned that I *did* try to delete the problematic folders by issuing commands in the Terminal %-)

When trying to delete from the Finder failed, I dropped in the Terminal and tried to delete folders by doing a rm -rdf <some_folder> from my admin account, which failed and then by first sudoing, which also failed.

So the issue was rather serious and the only way I could resolve was by doing what I mentioned above.

HTH

= tmk =
teehemkay
ReadyNAS Newbie
 
Posts: 7
Joined: Wed Jul 25, 2007 6:16 am

Re: problems deleting files/directory

Postby stefsegers » Tue Sep 30, 2008 7:54 am

I tried the terminal option but I get the following error

rm: /Volumes/media/Pictures/_UITZOEK/Stef's foto's: Directory not empty
rm: /Volumes/media/Pictures/_UITZOEK/stefan fotos: Directory not empty
rm: /Volumes/media/Pictures/_UITZOEK/diversen: Directory not empty
rm: /Volumes/media/Pictures/_UITZOEK/02-09-2005 (jasper): Directory not empty
rm: /Volumes/media/Pictures/_UITZOEK: Directory not empty

I looks like the dirs are empty but seems they aren't

What to do next?
stefsegers
ReadyNAS Newbie
 
Posts: 20
Joined: Sat Jul 22, 2006 12:06 am

Re: problems deleting files/directory

Postby thomasx » Wed Oct 01, 2008 12:23 am

Just loud thinking here (because that reminds me of my problem):

When you connect to that folders, that are told to be not empty, via ftp. what do you see there? Can you post a list of the files, folders and files in that folder?

I am expecting to see at least on File named ":2deDS-Store" - but may be wrong here. Just curious.
thomasx
ReadyNAS User
 
Posts: 64
Joined: Fri Jan 25, 2008 3:43 am
Location: Germany
ReadyNAS: Ultra

Re: problems deleting files/directory

Postby teehemkay » Wed Oct 01, 2008 3:06 am

@stefsegers

Are-you sure the folders are empty? They may have invisible files e.g. the one starting with a dot (ex: .DS_Store).
rm by itself will not remove a directory (only files).
You need to type either rm -d or rm -R or use rmdir to remove a directory.

You can list all files in a directory by typing ls -la

If you still have problems deleting you directories, you may want to check read my two previous posts in this threads, maybe they can help.

HTH

= tmk =
teehemkay
ReadyNAS Newbie
 
Posts: 7
Joined: Wed Jul 25, 2007 6:16 am

Re: problems deleting files/directory

Postby igor » Wed Oct 01, 2008 3:16 pm

hmm.
isn't the media share used by media-server plugins of the nas?
maybe some file is in use.
perhaps if you turn of the plugins temporary.
is worth the try.

igor
igor
ReadyNAS Newbie
 
Posts: 33
Joined: Tue May 15, 2007 11:18 am
Location: the nederlands

Next

Return to Mac / OS X



Who is online

Users browsing this forum: No registered users and 3 guests