Really weird delete problem


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Really weird delete problem
# 1  
Old 11-21-2008
Really weird delete problem

Hi,
I've Ubuntu 8.04, and it has some files that I just cannot delete. I've tried everything, inode, fsck etc.
Here is what the ls -li outputs

Code:
root@ubuntu:/home/luser/.local/share/Trash/files/junk# ls -l
ls: cannot access TRUNK_: No such file or directory
ls: cannot access 2006_output.mv: No such file or directory
total 0
?????????? ? ? ? ?                ? 2006_output.m?v
?????????? ? ? ? ?                ? TRUNK_

I've tried to delete by inode, ran fsck, tried to get lsattr, nothing works. Any ideas. Smilie

TIA,
Nitin
# 2  
Old 11-21-2008
Can you remove the directory it is in?

Code:
rm <dir> -r -f

# 3  
Old 11-21-2008
What does
Code:
ls 2006* | od -c

show?

if ls * does show the files try
Code:
cd /directory/with/wierdfiles
rm *

and answer "n" to everything except the wierdo files.
# 4  
Old 11-21-2008
Quote:
Originally Posted by jim mcnamara
if ls * does show the files try
Code:
cd /directory/with/wierdfiles
rm *

and answer "n" to everything except the wierdo files.
Careful, plain rm may not actually ask depending on the number of files. rm -I should force it to ask.

If those ?'s in your listing are really ?'s, that's very worrisome, suggestive of filesystem problems.
# 5  
Old 11-22-2008
This reminds me when I was chasing after disk space not correct on a pc, and using a knoppix, found the culprit... some IE cache but impossible to remove... I had to hack the MS administrator passwd and change the users passwd in order to connect "as" and clear the "Internet Explorer temporary files (or cache?? dont remember what its called) to recuperate 800MB...
As you until then I thought I could do everything with unix or liveCD such as knoppix...
What a shock...
# 6  
Old 11-22-2008
Remember that a directory is basicly a table with each entry being a name and an inode. In the usual case of a mysteriously undeletable file the name is some very difficult-to-type string of characters. So we suggest some counter-measure that avoids needing to type the name, such as
cd /directory
rm -i *
There is nothing actually wrong in these cases, we just have a very odd filename.

But notice this:
Code:
root@ubuntu:/home/luser/.local/share/Trash/files/junk# ls -l
ls: cannot access TRUNK_: No such file or directory
ls: cannot access 2006_output.mv: No such file or directory
total 0
?????????? ? ? ? ?                ? 2006_output.m?v
?????????? ? ? ? ?                ? TRUNK_

No odd filename can yield this result. Because the OP succeeded in cd'ing to this directory, he should also have permission to stat(2) the files. A simple "ls -l" should bypass the name problem just a a simple "rm -i *" would. But stat(2) appears to be failing. My guess is that the inode numbers are pointing to unallocated inodes.

In theory, "fsck -f" should fix this, and that is what I would recommend as a start. However, I have not yet encountered this problem in Linux, so I have never tried this myself.
# 7  
Old 11-24-2008
Thanks for all the replies
Quote:
What does
Code:
ls 2006* | od -c

show?
root@ubuntu:/some/dir/# ls 2006* | od -c
ls: cannot access 2006_output.mv: No such file or directory
0000000

I tried removing with rm *, rm <files> -r -f. Here is the funny part, just doing ls gives me this
Code:
root@ubuntu:/some/dir/# ls
ls: cannot access TRUNK_: No such file or directory
ls: cannot access 2006_output.mv: No such file or directory
2006_output.m?v  TRUNK_

I'm guessing this has something to do with NFS. The users data was migrated from SUSE to Ubuntu, and in old SUSE there were some NFS mounts.
Will look around.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Weird awk problem

Hi, I have a simple awk script: BEGIN{} { $a=$2-$1; print $a } END{if(NR==0){ print "0" } } to which I provide the following input 2.9 14 22.2 27 (4 Replies)
Discussion started by: jamie_123
4 Replies

2. UNIX for Dummies Questions & Answers

[Solved] Weird files to delete

Hi, I created some files with a script and I don't know yet where I did a mistake but the script created some "weird" files... prd01,/tmp # ls -al total 706184 -rw-r----- 1 root system 34 Aug 27 16:10 hdisk3BB hdisk3 hdisk3BB.tmp drwxrwxrwt 51 bin bin ... (9 Replies)
Discussion started by: Castelior
9 Replies

3. Programming

A weird problem with POSIX function

Hi all, Sorry for the title because I didn't find a proper name for it. My question is about POSIX functions, such as timer_create(), mq_open() and pthread_create(). void test_queue() { struct mq_attr attr; attr.mq_maxmsg = 10; attr.mq_msgsize = 64; mq_unlink("/my_test_queue");... (6 Replies)
Discussion started by: bus147
6 Replies

4. Shell Programming and Scripting

awk weird problem.

awk 'BEGIN{print 1.2.3.4}' 1.20.30.4 Can anyone explain why has extra "0" in the IP address? (3 Replies)
Discussion started by: newoz
3 Replies

5. Infrastructure Monitoring

Weird dependency problem!

Hi, I want to install net-snmp-devel package but i have following dependecy problem. It's very odd, i don't get it. One of packages is depended on the other one, the other one is depended on the previous one as well. :S :S Could you help me please? Here are the steps: # ls -l total... (4 Replies)
Discussion started by: oduth
4 Replies

6. Linux

Help! How to delete weird files ??

Guys, I have two files in a directory with weird permissions, size, owner, date etc... the problem is I canīt delete them! I tried to chmod the files and everything, but nothing seems to work. Anyone got any ideas ??? Look: # ls -l total 1327968579 ?--------- 48 1645863428 2150720025... (1 Reply)
Discussion started by: dfs
1 Replies

7. Solaris

Weird crontab problem

Greetings To All! I am running Solaris 10 in a sparc environment. Here is the deal: In /var/spool/cron/crontabs, there is a cron user named "sys". If I do a crontab -l sys, it returns: # 0 * * * 0-6 /usr/lib/sa/sa1 # 20,40 8-17 * * 1-5 /usr/lib/sa/sa1 # 5 18 * * 1-5 /usr/lib/sa/sa2... (8 Replies)
Discussion started by: RobSand
8 Replies

8. UNIX for Dummies Questions & Answers

How to delete a weird file name

Hi, How do I delete a file name that starts with a hypen? e.g. -unix_file_2006_10_3 I always get an erroe when I use rm command. I am using Solaris. Thanks, Hi, One of the Unix books I read to remove this weird file suggest to use: "rm ./-unix_file_2006_10_3" which I did today and file... (3 Replies)
Discussion started by: XZOR
3 Replies

9. UNIX for Advanced & Expert Users

weird problem with removing files

I have a few files on my system named: -rw------- -rw-r----- -rw-rw--w- -rwxrw-r-x (Yes, it's really the name of the file, not the access permissions, they're 0 bytes large and all created at the same date/time). I've no idea how they got there but I don't seem to be able to delete them... (2 Replies)
Discussion started by: rein
2 Replies

10. UNIX for Dummies Questions & Answers

Weird Problem???

I have a problem I don't understand... I am trying to declare a variable, and then output the results of that variable, couldn't be simpler #!/bin/ksh VAR='Oranges' if then echo "Found Lemons" elif then echo "Found Oranges" fi The output shouold clearly be "Found Oranges", but... (2 Replies)
Discussion started by: danhodges99
2 Replies
Login or Register to Ask a Question