LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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 05-23-2022, 07:54 AM   #1
awaismalik
Member
 
Registered: Mar 2021
Posts: 50

Rep: Reputation: Disabled
can not delete file mounted using fstab


I can not delete the file have tried rm and rm -rf also

Code:
user:~/samba/folder1/folder2$ ls
'List Teams.ods'
user:~/samba/folder1/folder2$ rm List\ Teams.ods
rm: unable to remove 'List\ Teams': file or directory not found
user:~/samba/folder1/folder2$ ls
'List Teams.ods'
File permission
Code:
$ ls -al
-rwxrwxrwx 1 user users 24809 May 18 10:14 'List Teams.ods'
Mount
Code:
$ cat /etc/fstab

//serverIP/folder1                /home/user/samba/folder          cifs   vers=1.0,noauto,users,credentials=/home/user/.smbcredentials,nobrl,noserverino     0          0
 
Old 05-23-2022, 08:02 AM   #2
suramya
Member
 
Registered: Jan 2022
Location: Earth
Distribution: Debian
Posts: 249

Rep: Reputation: 102Reputation: 102
The error message states that it can't find the 'List\ Teams' file where as the file in the folder is 'List\ Teams.ods'. Try deleting with 'rm *.ods' (without the quotes) in the correct directory.
Another option is to run "rm *" (without the quotes)
 
Old 05-23-2022, 08:02 AM   #3
jmgibson1981
Senior Member
 
Registered: Jun 2015
Location: Tucson, AZ USA
Distribution: Debian
Posts: 1,151

Rep: Reputation: 393Reputation: 393Reputation: 393Reputation: 393
Try with quotes?? I've had the occasional time where escaping spaces didn't work. Never figured why but I'm sure it was me.

Code:
rm "List Teams.ods"
 
Old 05-23-2022, 08:17 AM   #4
awaismalik
Member
 
Registered: Mar 2021
Posts: 50

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by jmgibson1981 View Post
Try with quotes?? I've had the occasional time where escaping spaces didn't work. Never figured why but I'm sure it was me.

Code:
rm "List Teams.ods"
Forgot to mention but i tried this too no luck
 
Old 05-23-2022, 08:46 AM   #5
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,781

Rep: Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936
Try deleting using the files inode.

ls -li
xxxxxxx ....... List Teams.ods

find . -inum xxxxxxx -delete
 
Old 05-23-2022, 09:24 AM   #6
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,750

Rep: Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983
Quote:
Originally Posted by awaismalik View Post
I can not delete the file have tried rm and rm -rf also
Code:
user:~/samba/folder1/folder2$ ls
'List Teams.ods'
user:~/samba/folder1/folder2$ rm List\ Teams.ods
rm: unable to remove 'List\ Teams': file or directory not found
user:~/samba/folder1/folder2$ ls
'List Teams.ods'
File permission
Code:
$ ls -al
-rwxrwxrwx 1 user users 24809 May 18 10:14 'List Teams.ods'
Mount
Code:
$ cat /etc/fstab
//serverIP/folder1                /home/user/samba/folder          cifs   vers=1.0,noauto,users,credentials=/home/user/.smbcredentials,nobrl,noserverino     0          0
This is a CIFS drive mount; have you checked the ACL on that folder/file?? Read the man page on the getfacl command, and post those results.

And you've not followed up/responded in your other threads..doesn't give folks much incentive to try to continue to help you.

Last edited by TB0ne; 05-23-2022 at 09:25 AM.
 
Old 05-23-2022, 01:09 PM   #7
awaismalik
Member
 
Registered: Mar 2021
Posts: 50

Original Poster
Rep: Reputation: Disabled
Following are the result of getfacl command:

Code:
user:~/samba/folder1/folder2$ getfacl -aed List\ Teams.ods
# file: List Teams.ods
# owner: user
# group: users
user::rwx
group::rwx
other::rwx

Code:
user:~/samba/folder1/folder2$ getfacl -t List\ Teams.ods
# file: List Teams.ods
USER   user      rwx     
GROUP  users     rwx     
other            rwx

Also tried deleting file using inode but was not sucessful.
 
Old 05-23-2022, 01:14 PM   #8
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,750

Rep: Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983
Quote:
Originally Posted by awaismalik View Post
Following are the result of getfacl command:
Code:
user:~/samba/folder1/folder2$ getfacl -aed List\ Teams.ods
# file: List Teams.ods
# owner: user
# group: users
user::rwx
group::rwx
other::rwx
Code:
user:~/samba/folder1/folder2$ getfacl -t List\ Teams.ods
# file: List Teams.ods
USER   user      rwx     
GROUP  users     rwx     
other            rwx
Also tried deleting file using inode but was not sucessful.
Where is this drive located? How is it connected? Would seem to be a network drive, on a Windows system; what are the permissions there?? Does the user you're using to mount that drive have permissions to delete/modify??
 
Old 05-23-2022, 01:19 PM   #9
MadeInGermany
Senior Member
 
Registered: Dec 2011
Location: Simplicity
Posts: 2,832

Rep: Reputation: 1218Reputation: 1218Reputation: 1218Reputation: 1218Reputation: 1218Reputation: 1218Reputation: 1218Reputation: 1218Reputation: 1218
Try
Code:
\rm -i *.ods*
and say Y only for the one to be deleted.
 
Old 05-23-2022, 01:20 PM   #10
awaismalik
Member
 
Registered: Mar 2021
Posts: 50

Original Poster
Rep: Reputation: Disabled
Yes it is a network drive (NAS) https://kb.synology.com/en-nz/search and user has the permission to modify and delete the file. Moreover can also use chmod and chown for changing file permission and ownership respectively.
 
Old 05-23-2022, 01:47 PM   #11
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,750

Rep: Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983
Quote:
Originally Posted by awaismalik View Post
Yes it is a network drive (NAS) https://kb.synology.com/en-nz/search and user has the permission to modify and delete the file. Moreover can also use chmod and chown for changing file permission and ownership respectively.
Please provide all details when asking a question; best to tell us it's a synology nas connected over a network, versus us having to guess.

synoacltool is for use in checking ACL's on a Synology NAS, so you'll have to check things out on the NAS itself. Also, you can mount it via NFS or Samba, versus a CIFS mount, and you can even mount it using SSHFS. Have you tried mounting it in other ways??
 
Old 05-23-2022, 08:51 PM   #12
computersavvy
Senior Member
 
Registered: Aug 2016
Posts: 3,345

Rep: Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484
With those file permissions at first glance the file appears accessible to write and delete.

However, I have to ask what are the permissions of that directory where the file is located?
With linux, even if the user has 'rwx' permissions on the file, if they do not also have write permissions in the directory they cannot write a new file nor delete a file there because deleting a file involves altering the directory contents. Check that next.

Last edited by computersavvy; 05-23-2022 at 08:53 PM.
 
1 members found this post helpful.
Old 06-03-2022, 02:43 AM   #13
awaismalik
Member
 
Registered: Mar 2021
Posts: 50

Original Poster
Rep: Reputation: Disabled
After an update cifs-utils (2:6.9-1ubuntu0.2) and tried mount per filemanager i can delete
 
Old 06-04-2022, 12:38 AM   #14
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by awaismalik View Post
After an update cifs-utils (2:6.9-1ubuntu0.2) and tried mount per filemanager i can delete
Please mark your thread SOLVED (see my signature). Others will benefit.
 
  


Reply

Tags
delete, fstab, mount



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
[SOLVED] Cannot delete directory after mounted via FSTAB tyw7 Linux - Software 14 11-20-2017 06:51 AM
Not able to delete file on cross mounted nas qwdow Linux - General 8 09-30-2015 03:10 AM
Can I delete files in /mnt/tmp? and Files in the trash can will not delete? M$ISBS Slackware 15 10-02-2009 11:56 PM

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

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