I ran a backup using Grsync but cancelled because I was using the wrong external hard drive. Some folders were created that appear to be empty, nothing is found when hidden files are shown. When I try to delete these folders I get the error “cannot delete file:directory is not empty”.
I tried to use the terminal command rm -rf but I can’t get the path to the external drive correct. I get the error “too many arguments”. The drive is called Seagate Expansion Drive if that helps.
Any help would be appreciated.
(Solved) Unable to delete folders
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
(Solved) Unable to delete folders
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Re: Unable to delete folders
What else is on the Drive? if it was only used for your back up then the simplest way may be to just format it.
Other than that you will have to find the exact address of the drive and file to delete them. They are most likely seen a directories so you'll need to
use the command this will remove the directory even if it has files in it. so be careful.
Other than that you will have to find the exact address of the drive and file to delete them. They are most likely seen a directories so you'll need to
use the command
Code: Select all
sudo rm -r <name of directory>
Easy tips : https://easylinuxtipsproject.blogspot.com/ Pjotr's Great Linux projects page.
Linux Mint Installation Guide: http://linuxmint-installation-guide.rea ... en/latest/
Registered Linux User #462608
Linux Mint Installation Guide: http://linuxmint-installation-guide.rea ... en/latest/
Registered Linux User #462608
Re: Unable to delete folders
Thanks kc1di,
The drive has other data on so I can’t format. I tried your method but I can’t seem to get the right path. I right click on the folder and select properties which shows it’s location but when I copy that into the terminal it says “too many arguments”
The drive has other data on so I can’t format. I tried your method but I can’t seem to get the right path. I right click on the folder and select properties which shows it’s location but when I copy that into the terminal it says “too many arguments”
Re: Unable to delete folders
Please post the file name/address you get from Properties.
What are the permission of that directory also.
What are the permission of that directory also.
Easy tips : https://easylinuxtipsproject.blogspot.com/ Pjotr's Great Linux projects page.
Linux Mint Installation Guide: http://linuxmint-installation-guide.rea ... en/latest/
Registered Linux User #462608
Linux Mint Installation Guide: http://linuxmint-installation-guide.rea ... en/latest/
Registered Linux User #462608
Re: Unable to delete folders
I'd try ejecting the external drive, then remounting it.
Re: Unable to delete folders
The path to the folder is /media/andrew/Seagate Expansion Drive
The folder is called andrew and it contains several empty sub-folders. I have permission to create and delete this folder although it was created by Grsync.
I tried mounting the drive on another machine with the same results.
I typed the command rm -rf /media/andrew/Seagate Expansion Drive/andrew into the terminal but nothing happened.
The folder is called andrew and it contains several empty sub-folders. I have permission to create and delete this folder although it was created by Grsync.
I tried mounting the drive on another machine with the same results.
I typed the command rm -rf /media/andrew/Seagate Expansion Drive/andrew into the terminal but nothing happened.
Re: (Solved) Unable to delete folders
I just found a simple solution. If I right-click on the folder and select delete I get the error message but if I highlight the folder and press delete on the keyboard it deletes as normal! Why that should be I don't know.
Thanks
Thanks
Re: Unable to delete folders
The problem here is the spaces in the pathway /media/andrew/Seagate Expansion Drive/andrew which must be "escaped" for the command to work; the easiest way to do this is to put the whole pathway in quotes, ie, "/media/andrew/Seagate Expansion Drive/andrew"Mazda81 wrote: ⤴Mon Sep 02, 2019 11:52 am The path to the folder is /media/andrew/Seagate Expansion Drive
The folder is called andrew and it contains several empty sub-folders. I have permission to create and delete this folder although it was created by Grsync.
I tried mounting the drive on another machine with the same results.
I typed the command rm -rf /media/andrew/Seagate Expansion Drive/andrew into the terminal but nothing happened.
Simply using the Del key as mentioned in your last post may simply put the folders into the USB disk's own trash; you can see if that's the case by using Ctrl+H to show all hidden files and folders and looking for the Trash folder. Some systems remove USB disk's trash when it is unmounted but I'm not sure if Mint does that.
Re: (Solved) Unable to delete folders
Thanks ajgreeny that's useful information. You're right the folders are in the trash file on the external drive in a folder named "expunged". Is it OK to delete the trash folder and if so how?
Re: (Solved) Unable to delete folders
Yes, it's fine to delete the trash from an external drive, though I'm not sure whether you need to do that as root as I've never needed to do so.
If you have read/write permissions to the external drive it should be possible as user, ie, root not needed.
If you have read/write permissions to the external drive it should be possible as user, ie, root not needed.