Permissions

Desertsquid081

New Member
Joined
Jun 6, 2017
Messages
15
Reaction score
1
Credits
105
I'm having troubles tdeleting directories. When I try to delete a directory from either the CL or with the GUI, I get this error msg: rm: cannot remove 'Ancestry info': Is a directory. In all the tutorials I've seen, the rmdir cmd should delete the directory. Thanks, DAve
 


rmdir whether with sudo or not will give you a fail; if the directory is not empty

yo ucan use rm -r
 
So I tried deleting the files in the directory. I'm getting this error msg:
Error when getting information for file “/media/calamar1737/USB20FD/From 6061-DAD6copy/most recently used 20210805//╩3₧;Üká.æwæ”: Input/output error.
They are mostly text files. I use Libre Office.
 
It's possible that file is still open. Are there any applications open that might have one of the files open?

If not, you may try and reboot then delete it just in case the kernel never released the file descriptor.

Finally, it's showing binary in the error which suggests more than just a text file. Hopefully nothing nefarious.

What filesystem is it? It looks like USB, so I suspect some form of FAT or NTFS? Or is it formatted in a common Linux fs?

I would also try to validate that it is a single file preventing the deletion and not all files or folder suffering from the issue.
 
I'm having troubles tdeleting directories. When I try to delete a directory from either the CL or with the GUI, I get this error msg: rm: cannot remove 'Ancestry info': Is a directory. In all the tutorials I've seen, the rmdir cmd should delete the directory. Thanks, DAve
Try it with sudo
Code:
sudo rm-rf directoryname
 
It's possible that file is still open. Are there any applications open that might have one of the files open?

If not, you may try and reboot then delete it just in case the kernel never released the file descriptor.

Finally, it's showing binary in the error which suggests more than just a text file. Hopefully nothing nefarious.

What filesystem is it? It looks like USB, so I suspect some form of FAT or NTFS? Or is it formatted in a common Linux fs?

I would also try to validate that it is a single file preventing the deletion and not all files or folder suffering from the issue.

14, member: 122561"]
It's possible that file is still open. Are there any applications open that might have one of the files open?

If not, you may try and reboot then delete it just in case the kernel never released the file descriptor.

Finally, it's showing binary in the error which suggests more than just a text file. Hopefully nothing nefarious.

What filesystem is it? It looks like USB, so I suspect some form of FAT or NTFS? Or is it formatted in a common Linux fs?

I would also try to validate that it is a single file preventing the deletion and not all files or folder suffering from the issue.
[/QUOTE]
It's possible that file is still open. Are there any applications open that might have one of the files open?

If not, you may try and reboot then delete it just in case the kernel never released the file descriptor.

Finally, it's showing binary in the error which suggests more than just a text file. Hopefully nothing nefarious.

What filesystem is it? It looks like USB, so I suspect some form of FAT or NTFS? Or is it formatted in a common Linux fs?

I would also try to validate that it is a single file preventing the deletion and not all files or folder suffering from the issue.

I must admit that I don't really know how to find the info on the file system.
I am using several USB ports along with the computer Documents file to save libre office calc spread sheets that I update on a daily basis. Last week was the first signs of trouble. I started having problems copying directories. I problem I haven't experienced before. At first I thought it might be the USB memory stick so I employed an external hardrive and a new USB memory stick.
I use the memory stick because I am using multiple computers.
 
I must admit that I don't really know how to find the info on the file system.
I am using several USB ports along with the computer Documents file to save libre office calc spread sheets that I update on a daily basis. Last week was the first signs of trouble. I started having problems copying directories. I problem I haven't experienced before. At first I thought it might be the USB memory stick so I employed an external hardrive and a new USB memory stick.
I use the memory stick because I am using multiple computers.
 
So I tried deleting the files in the directory. I'm getting this error msg:
Error when getting information for file “/media/calamar1737/USB20FD/From 6061-DAD6copy/most recently used 20210805//╩3₧;Üká.æwæ”: Input/output error.
They are mostly text files. I use Libre Office.
There maybe subdirs in that dir. Also, as @KGIII pointed out, that's a weird filename string. Notice the //? Usually *nix ignores // in paths, but if that is the file name's first char... Anyway, atomic bomb it:
- sudo -i
- cd to the directory.
- paste and run: for iiFile in *; do rm -r "$iiFile"; done
- ls -al to make sure it's empty. If so, you can remove the directory
 
If you are using nemo file manager open it in root by right click and select Open in Root now navigate to file can you delete the file then?
 
So there is something going on with the way the file structure. I don't know what it is. If I try and change permissions from the properties page, it rejects it. Everything is labeled as read only. I'm not sure how to proceed. Could this be a Libreoffice problem?
 
Did you run:
for iiFile in *; do rm -r "$iiFile"; done
as root in that directory? If so, what was the output?

Change permissions:
chmod -R a+rw <path/to/dir/>
as root.

If that doesn't work, cd into the directory and run:
for iiFile in *; do chmod a+rw "$iiFile"; done
and post that output.

It's not a Libre Office thing. It's a filesystem problem. FS error, device error, resource lock error, permissions, and so on. Technically, LO just requested the file be created (if LO created it). The FS code actually creates the file and handles the lower level stuff. There are plenty middle men involved, but that's the gist.
 
Firstly, check what command you are using. If that is rm command or rmdir command. Since the error is "rm: cannot remove 'Ancestry info': Is a directory", you might be probably using the rm command. But to delete a directory, we must use rmdir command.
Code:
$ rmdir Ancestry info
The above can be used instead of:
Code:
$ rm Ancestry info

Also, the directory has to be empty in order to delete it in Linux.
By this, your problem should be solved. If no, then there is some issue with the file/directory permissions. To remove a file, user needs write "w" and access "x" permission on the directory.

It does not matter how the file's permissions (or ownership) are set. Any user with "w" and "x" on the directory can delete any file in the directory. Without "w x" on the directory, a user will not be able to delete any file in the directory or the directory itself.

To check the user permissions, use the command:
Code:
$ ls -l Ancestry info
To change the permission, use chmod command. Here let us consider that only you want the permission of the file or directory. So, "- r w x r - - r - -" permission will be enough.

Where "r w x" is user permission to read, write and execute the file. Next "r - -", "r - -" is permission for group and other respectively. For them, only read permission is enough.

To change the user permission, we use
Code:
$ chmod 744 Ancestry info
or
Code:
$ chmod u=rwx Ancestry info

Hopefully, this will solve your problem.
 
Last edited:
It's been my experience that a directory has to be empty in order to delete it in Linux.
 
A directory does not have to be empty, as mentioned use -r
sudo rmdir -r Ancestry info

First change to the directory containing the Ancestry info directory,
then run the above command, let us know if you succeed.

If you have no permission to delete the directory Ancestry info and
its contents run this command first, chmod -R 755 Ancestry info
 
Last edited by a moderator:
What format are the USB and connected drives in.
If you no longer want any of the information on the drives,
just reformat them.

This command might show who what own and group are
in charge of the directory you want to delete.
stat -c "%U:%G" Ancestry info

You need to be in the directory that contains the Ancestry info directory
to run the above command, if not then use the full path to the Ancestry info directory such as,
stat -c "%U:%G" /home/this-user/Ancestry info/ , add the slash at the end to run this command, leave it out to try the delete commands in the post above.
 

Staff online

Members online


Top