LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-09-2010, 03:45 AM   #1
vishesh
Member
 
Registered: Feb 2008
Distribution: Fedora,RHEL,Ubuntu
Posts: 661

Rep: Reputation: 66
How to delete file which has no owner


Dear all
I am facing a basic problem in RHEL 5.2. Some of files in a mounted showing ? in place of owner and group owner.
root# find /data/abc -nouser
listing those files.
How to delete those files because
root# find /data/abc -nouser -exec rm -rf {} \;
showing error access is denied
 
Old 01-09-2010, 04:25 AM   #2
Disillusionist
Senior Member
 
Registered: Aug 2004
Location: England
Distribution: Ubuntu
Posts: 1,039

Rep: Reputation: 98
If root is unable to delete the files, they may be on a partition that is mounted read-only or be on read-only media.

Try to remount the partition as read-write.

Code:
mount -o remount,rw /dev/partition /mount/point
Some memory sticks have a slide switch to "lock" the contents (making the stick read-only).
 
Old 01-09-2010, 04:31 AM   #3
vishesh
Member
 
Registered: Feb 2008
Distribution: Fedora,RHEL,Ubuntu
Posts: 661

Original Poster
Rep: Reputation: 66
Thanks for reply
No, partition is mounted in read/write mode. But some files showing ? in place of inode, owner and group owner. Trying to delete those files gives access denied message.
 
Old 01-09-2010, 04:53 AM   #4
Disillusionist
Senior Member
 
Registered: Aug 2004
Location: England
Distribution: Ubuntu
Posts: 1,039

Rep: Reputation: 98
The inode number is showing as ?

Have you tried running fsck on the filesystem (this will need to be unmounted first)?
 
Old 01-09-2010, 07:22 AM   #5
jcliburn
Member
 
Registered: Dec 2003
Location: Mississippi, USA
Distribution: Fedora
Posts: 435

Rep: Reputation: 33
I suppose 'ls -n' doesn't show a number for the uid and gid, right?
 
Old 01-09-2010, 10:30 AM   #6
vishesh
Member
 
Registered: Feb 2008
Distribution: Fedora,RHEL,Ubuntu
Posts: 661

Original Poster
Rep: Reputation: 66
thanks for respone
ls -n also showing ? in place of uid and gid. fsck may solve problem but i can't unmount it at this time. Is there any alternate way without applying fsck?
I am also investigating reason for such problem in ext3 file system. It would be great help if someone point me in right direction.
 
Old 01-09-2010, 11:58 AM   #7
Erik_FL
Member
 
Registered: Sep 2005
Location: Boynton Beach, FL
Distribution: Slackware
Posts: 821

Rep: Reputation: 258Reputation: 258Reputation: 258
Quote:
Originally Posted by vishesh View Post
thanks for respone
ls -n also showing ? in place of uid and gid. fsck may solve problem but i can't unmount it at this time. Is there any alternate way without applying fsck?
I am also investigating reason for such problem in ext3 file system. It would be great help if someone point me in right direction.
Have you tried changing the owner to root? Can you change the permissions at all with "chmod"?

Since "ls" tries to find the owner and group in the files "/etc/passwd" and "/etc/group" it might show a ? when it can't find the ID number in the files. I thought that it just displayed the number instead. I'm assuming permission problems (lack of read access) for "/etc/passwd" and "/etc/group" would affect the listing of all files and not just some files.

I recommend doing "fsck" soon because a file system problem won't get better by itself, and might get worse. It's better to be sure as soon as possible and avoid losing other more important files.
 
Old 01-09-2010, 01:17 PM   #8
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora40
Posts: 6,153

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
Quote:
Some of files in a mounted showing ? in place of owner and group owner....
[Snip]
.... fsck may solve problem but i can't unmount it at this time
You have been advised to run fsck on that partition. This is good advice because your filesystem is almost certainly corrupted.

The longer you continue to use that filesystem, the worse the errors will become, until the filesystem is unreadable.

So, please follow the advice you have been given.
 
1 members found this post helpful.
Old 01-09-2010, 10:46 PM   #9
vishesh
Member
 
Registered: Feb 2008
Distribution: Fedora,RHEL,Ubuntu
Posts: 661

Original Poster
Rep: Reputation: 66
Thanks for advice, i will do fsck and report you accordingly. At the same time i removed the folder that hold those files (since all those files was in one folder only), Now there are no such files in my system. So does fsck require immediately ?

Thanks
 
Old 01-09-2010, 11:00 PM   #10
Quakeboy02
Senior Member
 
Registered: Nov 2006
Distribution: Debian Linux 11 (Bullseye)
Posts: 3,410

Rep: Reputation: 141Reputation: 141
Stop deleting files. Stop trying to fix it. You may be making things seriously worse. Unmount the filesystem and run fsck.

Last edited by Quakeboy02; 01-09-2010 at 11:19 PM.
 
Old 01-11-2010, 12:17 AM   #11
vishesh
Member
 
Registered: Feb 2008
Distribution: Fedora,RHEL,Ubuntu
Posts: 661

Original Poster
Rep: Reputation: 66
Thanks
I fixed problem using fsck. fsck showed error 'inodes that were part of corrupted orphaned linked list' found.

Thnks again fsck is right option in this situation.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Owner of a directory different than file owner problems Guardian-Mage Linux - Server 4 04-24-2009 11:26 AM
Display by File Name, File Size, and File Owner using ls akeenabawa Linux - Newbie 9 08-15-2008 03:21 PM
File owner and File group locked - root deiphage Linux - Hardware 5 02-05-2005 02:30 PM
Getting the owner name of a file in C akin81 Programming 5 04-02-2004 04:36 PM
file permissions and file owner won't change Nadim Slackware 5 11-29-2003 07:03 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:08 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration