LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 06-30-2016, 09:07 AM   #1
quintze
LQ Newbie
 
Registered: May 2016
Posts: 14

Rep: Reputation: Disabled
Unable to delete a file


Hello,

I am running Ubuntu 14.04 and I have a mounted drive to a network storage device (buffalo drive). I have been able to delete files within the folder that I am working in, logged in as USER1. The file permissions of a folder that I am trying to delete is below:

drwxr-xr-x 2 root root 0 Oct 10 2012 Long Short Fund

When I run rsync, I am getting an error saying that it can't be copied. There is a permission denied error below:

rsync: readdir("/media/winacctbuffalo/New_Acct/Saved_K_GP2000/Maher/Long Short Fund"): Permission denied (13) rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1183) [sender=3.1.0]rsync: readdir("/media/winacctbuffalo/New_Acct/Saved_K_GP2000/Maher/Long Short Fund"): Permission denied (13) rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1183) [sender=3.1.0]

When I try to delete it, I am getting the same error. I tried sudo chmod -R 777 foldername

but, I am still unable to delete it. I also tried to
sudo chown user1:user1

but that didn't work.

I posted this in security thread but feel free to move if this is incorrectly place. Any ideas of what it might be or how I can delete it. The buffalo drive is viewable in a windows environment and I tried to delete it from the gui in windows but it wouldn't delete either. Not an urgent matter but it would be good to learn a new trick of how to delete the file.

Thanks
 
Old 06-30-2016, 01:16 PM   #2
lazydog
Senior Member
 
Registered: Dec 2003
Location: The Key Stone State
Distribution: CentOS Sabayon and now Gentoo
Posts: 1,249
Blog Entries: 3

Rep: Reputation: 194Reputation: 194
How are you running rsync? As a USER or as ROOT? That directory is 755 so only Root can write anything into it while a user can read or execute anything in that directory. If you are running rsync as a USER try running it as ROOT and it should work.

Same goes with Deleting it are you trying to delete is as a USER or ROOT? Root owns it so Root is the only one who can delete it.

another thing crossed my mind how is it mounted as rw or ro? You can see this with;

Code:
mount
 
Old 06-30-2016, 03:40 PM   #3
quintze
LQ Newbie
 
Registered: May 2016
Posts: 14

Original Poster
Rep: Reputation: Disabled
I run a bash script and execute it by SUDO CRONTAB -E so I believe I am running it as root. The bash script (.sh) file that I am executing is owned by root as well:

-rw-r--r-- 1 root root 345 Jun 30 14:24 myscript.sh


Here is also the mount output for the drive in question:

//10.140.6.100/share on /media/winacctbuffalo type cifs (rw,username=specialist,password=password,iocharset=utf8,sec=ntlm)


I think I have tried to run:
SUDO RMDIR /media/"Long Short Fund"

but, this didn't work. Not sure if it is some weird thing going on with the file, but I can't even delete it in Windows.


thanks for looking at this lazydog!
 
Old 07-01-2016, 12:21 AM   #4
JJJCR
Senior Member
 
Registered: Apr 2010
Posts: 2,141

Rep: Reputation: 447Reputation: 447Reputation: 447Reputation: 447Reputation: 447
Please try below, enclosed the whole path with quotes.

Quote:
sudo rmdir -rf "/media/Long Short Fund"
-rf is force recursive deletion. It will delete sub folders as well, make sure you're doing the right thing.

And please watch out for case sensitivity in Linux commands.
 
Old 07-01-2016, 09:18 AM   #5
lazydog
Senior Member
 
Registered: Dec 2003
Location: The Key Stone State
Distribution: CentOS Sabayon and now Gentoo
Posts: 1,249
Blog Entries: 3

Rep: Reputation: 194Reputation: 194
Quote:
Originally Posted by quintze View Post
//10.140.6.100/share on /media/winacctbuffalo type cifs (rw,username=specialist,password=password,iocharset=utf8,sec=ntlm)
Is this a windows machine? If it is, does the user have the rights to remove directories from the system?
Just because you mounted it as 'rw' doesn't mean you will have those right is the hosting server does not allow you to do this.
 
Old 07-01-2016, 12:19 PM   #6
quintze
LQ Newbie
 
Registered: May 2016
Posts: 14

Original Poster
Rep: Reputation: Disabled
It is a Buffalo NAS drive. I am going to try the suggestions and get back to you. I seem to have rights to all other files other than this folder. I am suspecting a corrupt folder....
 
Old 07-05-2016, 09:01 AM   #7
quintze
LQ Newbie
 
Registered: May 2016
Posts: 14

Original Poster
Rep: Reputation: Disabled
I haven't been able to delete the file, but I am assuming it may be a corrupt folder. I also tried deleting it with fileassasin and that didn't work either because it is a folder. However, I think this is probably a corrupt folder. Let me know if anyone else thinks of anything. I will close thread for now. Cheers!
 
Old 07-05-2016, 12:14 PM   #8
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,770

Rep: Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210
For a local filesystem, the last resort is to run debugfs on the partition holding the filesystem, use the clri command to clear the bad inode, then run fsck to clean up the resulting filesystem inconsistencies. Whether you can log into your NAS device and have the necessary access to do that is another question.
 
  


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
Unable to Delete File osama.mansoor Linux - Newbie 1 12-22-2015 11:28 PM
[SOLVED] Unable to delete file - Text file busy Westmoreland Linux - General 3 10-16-2013 08:49 AM
Strange file type - Unable to delete the file kk2202 Linux - General 6 08-10-2009 12:00 PM
Strange file type - Unable to delete the file kk2202 Red Hat 1 08-10-2009 08:22 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 12:26 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