LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 03-05-2009, 07:32 PM   #1
sulekha
Member
 
Registered: Dec 2004
Location: India
Distribution: ubuntu 10.04 , centos 5.5 , Debian lenny, Freenas
Posts: 324

Rep: Reputation: 36
Question 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
 
Old 03-05-2009, 11:38 PM   #2
Tuttle
Senior Member
 
Registered: Jul 2003
Location: Wellington, NZ
Distribution: mainly slackware
Posts: 1,291

Rep: Reputation: 52
it was mounted read only!

man mount
 
Old 03-06-2009, 12:28 AM   #3
sulekha
Member
 
Registered: Dec 2004
Location: India
Distribution: ubuntu 10.04 , centos 5.5 , Debian lenny, Freenas
Posts: 324

Original Poster
Rep: Reputation: 36
Question

Quote:
Originally Posted by Tuttle View Post
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.
 
Old 03-06-2009, 12:54 AM   #4
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
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.
 
Old 03-06-2009, 01:20 AM   #5
sulekha
Member
 
Registered: Dec 2004
Location: India
Distribution: ubuntu 10.04 , centos 5.5 , Debian lenny, Freenas
Posts: 324

Original Poster
Rep: Reputation: 36
[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
 
Old 03-06-2009, 03:08 AM   #6
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
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 )
 
Old 03-10-2009, 11:55 AM   #7
Nukem
Member
 
Registered: May 2003
Location: Canada, TO.
Distribution: Slackware: in progress, Mandrake 9.2, Libranet, Vector
Posts: 373

Rep: Reputation: 30
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.
 
  


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
Script help - delete files older than 45 days but exclude the system files jojothedogboy Linux - Software 3 06-13-2008 03:43 PM
How to delete files that won't delete? di11rod Linux - Security 7 10-19-2005 09:14 PM
how do you delete files? otoomet Linux - General 6 11-12-2004 04:06 AM
How to delete the destination files while the source files deleted in cp -u ? myunicom Linux - General 4 09-26-2003 01:13 PM
Delete Files bsengland Linux - Newbie 1 11-04-2002 05:29 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 01:30 PM.

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