Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have a large (hundreds, not thousands) number of files which I cannot delete, for example
49504 -rwxr-xr-x 0 root root 50691712 Sep 26 2009 5 - Arensky: Variations on a theme of Tchaikovsky, Op 35A.flac
rm -rf does nothing at all, and gives no error message.
I have tried mv to get it somewhere else and this just produces
mv: cannot stat `....': No such file or directory
Using Nautilus produces similar error messages.
My *guess* is that the problem is the 0 links, but I cannot find how to
change this.
What I've been doing: I have needed to delete about 330GB of flac files to free up space before replacing with a better version. I used rm -r successfully on most directories (most have about 6 levels of sub-dirs) but am stuck with a few dirs containing scattered files like the above.
Using debian wheezy. The files are actually mounted from a NAS, so am working as root.
If you can confirm/correct my guess and point me to information that would be great. Looking at info chmod and info ls hasn't helped.
The file shown is owned by root, have you been logged in as root and trying to delete it? How about using:
Code:
sudo rm -f <filename>
And BE CAREFUL about using root or sudo and then issuing commands such as -rf and using wildcards *, because the very old and very BAD joke was to tell someone to issue a command designed to remove their entire file system. I shall not repeat that command for your pleasure.
If you login to your XWindows as a normal user, then you really can't use Nautilus to do this. An alternate way I'd say would be to so something better like this from a top level directory where these files start from:
What that does is changes all the files, and directories which contain them to be owned by your username and placed into the same group that your username is. And then you can access these files properly from things like Nautilus and perform the file removal.
I've tried to delete dirs :
<code>
ls -lsa
0 drwxr-xr-x 0 root root 0 Jul 9 09:41 ARENSKY
root@TQD:/mnt/M-Multimedia# rm -rf ARENSKY/
rm: cannot remove `ARENSKY/ULSTER_O/Variations on a theme of Tchaikovsky, Op.35a': Directory not empty
root@TQD:/mnt/M-Multimedia#
</code>
The only file in this dir (two levels down) is
<code>
49504 -rwxr-xr-x 0 root root 50691712 Sep 26 2009 5 - Arensky: Variations on a theme of Tchaikovsky, Op 35A.flac
</code>
and doing rm -f on this leaves the file intact and issues no error message.
I don't know anything about this subject but I just read this thread and it may be relevant to your situation: https://www.linuxquestions.org/quest...nd-4175547602/
EDIT: LOLOLOL SORRY! Didn't know that was your post as well!
ls -lsa
0 drwxr-xr-x 0 root root 0 Jul 9 09:41 ARENSKY
root@TQD:/mnt/M-Multimedia# rm -rf ARENSKY/
rm: cannot remove `ARENSKY/ULSTER_O/Variations on a theme of Tchaikovsky, Op.35a': Directory not empty
root@TQD:/mnt/M-Multimedia#
The only file in this dir (two levels down) is
Code:
49504 -rwxr-xr-x 0 root root 50691712 Sep 26 2009 5 - Arensky: Variations on a theme of Tchaikovsky, Op 35A.flac
and doing rm -f on this leaves the file intact and issues no error message.
Maybe the zero links is not the problem?
A file with a name can't have zero links. In other words, a name is a link. In other words, something's fishy.
Go to the ARENSKY directory and, using ls -a, check if the dot and dotdot files are there (they are named "." and "..", respectively). If not, something's even more fishy.
Can you unmount this filesystem and fsck it?
If not, can you boot a live CD and fsck this filesystem?
Last edited by berndbausch; 07-12-2015 at 01:21 AM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.