Ubuntu This forum is for the discussion of Ubuntu Linux. |
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.
|
 |
03-05-2009, 07:32 PM
|
#1
|
Member
Registered: Dec 2004
Location: India
Distribution: ubuntu 10.04 , centos 5.5 , Debian lenny, Freenas
Posts: 324
Rep:
|
not able to delete files
Hi all,
Recently a colleague of mine told me that he was not able to delete a
particular folder in his flash drive, using a ubuntu machine.
I tried to help him, by using the 2 methods
1 GUI method
i just typed sudo nautilus to get the root browser and navigated to
flash drive folder in /media and tried to delete the file, but i got the
message permission denied,attempting to delete read only file system
2 using chmod
i tried to change the permission of the folder via chmod -R 777, command
then i got the message message permission denied,attempting to change
permission of read only file system
then i checked the folder contents via ls -l , to see if there is any
suid or sgid bit set but i didn't find any ?
then i entered rescue mode,but the flash drive was not detected,but i didn't try mounting
finally we had to take the flash drive to a windows machine to delete
the folder
NB: the only thing i could remember about the folder was it was copied
from the /usr/share/tomcat5.5 folder
|
|
|
03-05-2009, 11:38 PM
|
#2
|
Senior Member
Registered: Jul 2003
Location: Wellington, NZ
Distribution: mainly slackware
Posts: 1,291
Rep:
|
it was mounted read only!
man mount
|
|
|
03-06-2009, 12:28 AM
|
#3
|
Member
Registered: Dec 2004
Location: India
Distribution: ubuntu 10.04 , centos 5.5 , Debian lenny, Freenas
Posts: 324
Original Poster
Rep:
|
Quote:
Originally Posted by Tuttle
it was mounted read only!
man mount
|
i don't think it was not mounted read only, as i was able to delete some other folders, only some folders were showing this problem.
|
|
|
03-06-2009, 12:54 AM
|
#4
|
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733
|
What was the filesystem on the drive? If it is VFAT, then you don't use chmod. The permissions are determined when the drive is mounted.
Look at the file in the terminal. Try not to run graphical programs as root. If it is a Linux filesystem, check the properties and attributes.
ls -ld <directory_name>
lsattr <directory_name>
Another thing that can happen is that the filesystem has been damaged, and the error was discovered after deleted some directories. This can cause the filesystem to be marked as read-only. If there was a problem reading a file or directory, this could result in you having the same error given after subsequent write attempts.
|
|
|
03-06-2009, 01:20 AM
|
#5
|
Member
Registered: Dec 2004
Location: India
Distribution: ubuntu 10.04 , centos 5.5 , Debian lenny, Freenas
Posts: 324
Original Poster
Rep:
|
[QUOTE=jschiwal;3466565]What was the filesystem on the drive? If it is VFAT, then you don't use chmod. The permissions are determined when the drive is mounted.
The file system was vfat
|
|
|
03-06-2009, 03:08 AM
|
#6
|
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733
|
If it is a pendrive, I would suspect that there is a filesystem problem. The permissions and ownership are determined by the mount command and all files have the same ownership and permissions. All directories have the same ownership and permissions as well. So if you can remove one directory but not the other, I'd think that an error was found, and the kernel later refused to remove files to protect the filesystem from further damage. ( It could also be a problem with the device itself )
|
|
|
03-10-2009, 11:55 AM
|
#7
|
Member
Registered: May 2003
Location: Canada, TO.
Distribution: Slackware: in progress, Mandrake 9.2, Libranet, Vector
Posts: 373
Rep:
|
Actually I had this happened on some folders. I can remove all the files in the folders but the folder itself stays and there was no way to get rid of it. Just an empty folder 0 bytes. Not just linux, even windos on different mechines couldnt delete them. The cause was corrupted data. So I just had to back up all the files and reformat the stick.
|
|
|
All times are GMT -5. The time now is 12:41 PM.
|
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
|
|