The officially official Devuan Forum!

You are not logged in.

#1 2023-09-18 07:33:00

Charon795
Member
Registered: 2023-08-25
Posts: 55  

Deleting and renaming folders on an external hard drive.

1. Failed to delete the folder to the trash /media/charon/seagate backup plus drive/dr web
The directory is not empty. Delete forever?
- Yes, for everyone.
- Error when deleting a file. The directory is not empty
2. Failed to rename "new folder"
An error occurred while renaming the file /media/charon/seagate backup plus drive/new folder: the directory is not empty

I wanted to delete and rename some folders from my external hard drive and ended up getting these errors. What to do?

Offline

#2 2023-09-18 16:16:58

chris2be8
Member
Registered: 2018-08-11
Posts: 307  

Re: Deleting and renaming folders on an external hard drive.

Does the path to the directory have spaces in it? That could confuse things.

Try:
ls -A  /media/charon/seagate backup plus drive/dr web
If that gets similar errors try:
ls -A '/media/charon/seagate backup plus drive/dr web'
Putting quotes round the path should stop spaces in the name causing problems.

Assuming the directory really is empty (ls -A should return nothing if it is empty) try:
rmdir '/media/charon/seagate backup plus drive/dr web'

And similar for renaming directories.

Offline

#3 2023-09-19 11:49:45

soren
Member
Registered: 2023-04-30
Posts: 142  

Re: Deleting and renaming folders on an external hard drive.

How did you try to delete the folder, what command did you use.

Offline

#4 2023-09-19 14:40:17

Camtaf
Member
Registered: 2019-11-19
Posts: 436  

Re: Deleting and renaming folders on an external hard drive.

If your user doesn't own the directory, you need to use sudo or the root account.

But, you could change ownership of that mount point to your user, then you can do what you like with files & directories on it.

sudo chown -R charon:charon /media/charon/seagate backup plus drive/ 

Last edited by Camtaf (2023-09-19 14:41:25)

Offline

Board footer