LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Cannot delete directory after mounted via FSTAB (https://www.linuxquestions.org/questions/linux-software-2/cannot-delete-directory-after-mounted-via-fstab-4175617964/)

tyw7 11-19-2017 08:44 PM

Cannot delete directory after mounted via FSTAB
 
I have mounted a NAS file via FSTAB and I changed the password to my NAS drive. However, I cannot delete the folder that FSTAB created.

Deleting through the user interface said "no such directory or file." I cannot do rmdir via terminal too.

I have Linux Mint.

ondoho 11-20-2017 12:37 AM

to my knowledge, fstab entries do not create folders.
please show us some output.

giis 11-20-2017 05:30 AM

Quote:

Originally Posted by tyw7 (Post 5782721)
However, I cannot delete the folder that FSTAB created.

Deleting through the user interface said "no such directory or file." I cannot do rmdir via terminal too.

Please share more details like output `cat /etc/fstab` and rm -rf command along with error message. That will help to understand your issue better.

tyw7 11-20-2017 06:14 AM

I think I used gvfs too but I forgot what I did.

For fstab I did something like
192.168.0.1:/NASShare /mnt/NAS nfs username=administrator,password=pass 0 0

Teufel 11-20-2017 06:17 AM

Quote:

Originally Posted by giis (Post 5782843)
Please share more details like output `cat /etc/fstab` and rm -rf command

Be cautious with rm -rf command!
Run it only if you really knows what are you doing

tyw7 11-20-2017 06:26 AM

I used rmdir as it's a folder. According to permissions, it is owned by root but I cannot delete it even if I elevate the Nautilus to root status. RMDIR said resource is busy.

Where can I check GVFS entries? I think I might have created one.

giis 11-20-2017 06:31 AM

Quote:

Originally Posted by tyw7 (Post 5782872)
I used rmdir as it's a folder. According to permissions, it is owned by root but I cannot delete it even if I elevate the Nautilus to root status. RMDIR said resource is busy.

Is this nfs export itself has correct permission? Try this example:

Quote:

touch /mnt/NAS/dummyfile
rm /mnt/NAS/dummyfile
Did these two commands worked ?

giis 11-20-2017 06:32 AM

Quote:

RMDIR said resource is busy.
Also, can you try with commands like fuser or lsof to find out which process is using those directory?

tyw7 11-20-2017 06:33 AM

Keeps saying permission is denied. It's a folder on the Desktop.

tyw7 11-20-2017 06:34 AM

Quote:

Originally Posted by giis (Post 5782878)
Also, can you try with commands like fuser or lsof to find out which process is using those directory?

tyw7@HPp6792uk ~/Desktop $ sudo lsof NAS
lsof: WARNING: can't stat() fuse.gvfsd-fuse file system /run/user/1000/gvfs
Output information may be incomplete.
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
automount 1783 root 10r DIR 0,49 0 22424 NAS

giis 11-20-2017 06:35 AM

Please post the command along with its error message from your terminal. It can give us more hints.
Edit: I thought NAS was mounted on /mnt/NAS but you are accessing it from ~/Desktop/NAS ?

michaelk 11-20-2017 06:42 AM

What directory are you trying to delete?

nfs does not use username/password and /etc/fstab is separate from mounting using nautilus/gvfs.


I assume the folder is the shortcut to the nfs share. Have you tried right clicking on the icon and selecting unmount?

tyw7 11-20-2017 06:43 AM

I found an entry under auto.sambashares and auto.masters. Commenting it out and rebooting.

Edit: I also uninstalled cifs-utils and automount and the folder disappeared.

michaelk 11-20-2017 06:50 AM

auto.master and auto.sambashares is used by autofs and auto.sambashares would imply your mounting CIFS shares which is different then nfs.

Without knowing more information those could be sample configuration files which you are not using.

tyw7 11-20-2017 06:51 AM

I deleted the entries in the folder pertaining to my NFA and uninstalled the program. Then the offending entry is gone.


All times are GMT -5. The time now is 03:11 AM.