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 |
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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
|
01-09-2010, 03:45 AM
|
#1
|
Member
Registered: Feb 2008
Distribution: Fedora,RHEL,Ubuntu
Posts: 661
Rep:
|
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
|
|
|
01-09-2010, 04:25 AM
|
#2
|
Senior Member
Registered: Aug 2004
Location: England
Distribution: Ubuntu
Posts: 1,039
Rep:
|
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).
|
|
|
01-09-2010, 04:31 AM
|
#3
|
Member
Registered: Feb 2008
Distribution: Fedora,RHEL,Ubuntu
Posts: 661
Original Poster
Rep:
|
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.
|
|
|
01-09-2010, 04:53 AM
|
#4
|
Senior Member
Registered: Aug 2004
Location: England
Distribution: Ubuntu
Posts: 1,039
Rep:
|
The inode number is showing as ?
Have you tried running fsck on the filesystem (this will need to be unmounted first)?
|
|
|
01-09-2010, 07:22 AM
|
#5
|
Member
Registered: Dec 2003
Location: Mississippi, USA
Distribution: Fedora
Posts: 435
Rep:
|
I suppose 'ls -n' doesn't show a number for the uid and gid, right?
|
|
|
01-09-2010, 10:30 AM
|
#6
|
Member
Registered: Feb 2008
Distribution: Fedora,RHEL,Ubuntu
Posts: 661
Original Poster
Rep:
|
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.
|
|
|
01-09-2010, 11:58 AM
|
#7
|
Member
Registered: Sep 2005
Location: Boynton Beach, FL
Distribution: Slackware
Posts: 821
|
Quote:
Originally Posted by vishesh
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.
|
|
|
01-09-2010, 01:17 PM
|
#8
|
LQ 5k Club
Registered: May 2003
Location: London, UK
Distribution: Fedora40
Posts: 6,153
|
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.
|
01-09-2010, 10:46 PM
|
#9
|
Member
Registered: Feb 2008
Distribution: Fedora,RHEL,Ubuntu
Posts: 661
Original Poster
Rep:
|
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
|
|
|
01-09-2010, 11:00 PM
|
#10
|
Senior Member
Registered: Nov 2006
Distribution: Debian Linux 11 (Bullseye)
Posts: 3,410
Rep:
|
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.
|
|
|
01-11-2010, 12:17 AM
|
#11
|
Member
Registered: Feb 2008
Distribution: Fedora,RHEL,Ubuntu
Posts: 661
Original Poster
Rep:
|
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.
|
|
|
All times are GMT -5. The time now is 03:08 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.
|
Latest Threads
LQ News
|
|