Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

smartin80

macrumors member
Original poster
Jun 5, 2020
40
23
Hi,
I'm running Big Sur on a 5,1 box. My NAS drive is an OMV v5 box...
When I try to delete a particular folder on my NAS drive in the conventional way I get various errors re permissions or that it contains items that are in use. See attachments.

I have tried to fix permissions using the OMV GUI to no avail.

I'm down to using Terminal to do the job but I can't find the right command. So far I have tried:
Code:
Mac-Pro:~ simon$ login adminaccount
Password:
Last login: Tue Jul 26 21:54:59 on ttys000
You have new mail.
adminaccount@Mac-Pro ~ % cd <path to folder>
cd: permission denied: <path to folder>
adminaccount@Mac-Pro ~ % su cd <path to folder>
Password:
su: Sorry
adminaccount@Mac-Pro ~ % sudo cd <path to folder>
Password:
adminaccount@Mac-Pro ~ % ls
Applications        Library            Public
Desktop            Movies            Sites
Documents        Music            node_modules
Downloads        Pictures        package-lock.json
adminaccount@Mac-Pro ~ % logout
Mac-Pro:~ simon$ cd <path to folder>
Mac-Pro:DLink backup simon$ rmdir -r <path to folder>/Brushes
rmdir: illegal option -- r
usage: rmdir [-p] directory ...
Mac-Pro:DLink backup simon$ rmdir -p <path to folder>/Brushes
rmdir: <path to folder>/Brushes: Directory not empty
Mac-Pro:DLink backup simon$ rmdir -p -r <path to folder>/Brushes
rmdir: illegal option -- r
usage: rmdir [-p] directory ...
Mac-Pro:DLink backup simon$ rm -r <path to folder>/Brushes
rm: <path to folder>/Brushes/Brushes: Directory not empty
rm: <path to folder>/Brushes: Directory not empty
Mac-Pro:DLink backup simon$ rm -rf delete_dir <path to folder>/Brushes
rm: <path to folder>/Brushes/Brushes: Directory not empty
rm: <path to folder>/Brushes: Directory not empty
Mac-Pro:DLink backup simon$ rmdir -rf delete_dir <path to folder>/Brushes
rmdir: illegal option -- r
usage: rmdir [-p] directory ...
Mac-Pro:DLink backup simon$

I can't believe this is so difficult :)

Can anyone tell me the correct method, please?

S
 

Attachments

  • Screenshot 2022-07-16 at 21.23.56.jpg
    Screenshot 2022-07-16 at 21.23.56.jpg
    54.7 KB · Views: 213
  • Screenshot 2022-07-16 at 21.23.31.jpg
    Screenshot 2022-07-16 at 21.23.31.jpg
    55.8 KB · Views: 60

Slartibart

macrumors 68030
Aug 19, 2020
2,874
2,571
does the path include folder names with spaces or starts with “-“?
sudo rm -rf /where/ever/the/folder/to/remove/is/located/ does not work?
 
Last edited:

Slartibart

macrumors 68030
Aug 19, 2020
2,874
2,571
or you expand the path via tab resulting each space in the path name will preceded with a "\":

sudo rm -rf my/path\ to/the/folder\ which\ I/want/to/remove/
 

smartin80

macrumors member
Original poster
Jun 5, 2020
40
23
Feels like we're getting somewhere! :)

However... if I use my regular account I get an error saying I'm not in the sudoers file.

If I use my admin account I get "Directory not empty"

If I use my admin account and rmdir -rf
I get
rmdir: illegal option -- r
usage: rmdir [-p] directory ...
 

Slartibart

macrumors 68030
Aug 19, 2020
2,874
2,571
Feels like we're getting somewhere! :)

However... if I use my regular account I get an error saying I'm not in the sudoers file.

If I use my admin account I get "Directory not empty"

If I use my admin account and rmdir -rf
I get
rmdir: illegal option -- r
usage: rmdir [-p] directory ...
because "-r" isn’t an option of rmdir - just use rmdir. Furthermore it is quite likely that the target folder has to be empty - depends on the rmdir-wrapper.

Try adding an "*" at the end of the rm-command sequence:

sudo rm -rf "my/path to/the/folder which I/want/to/remove/*"

It is still possible that there is a myriad of subfolders (?) and you have to go subfolder by subfolder.

OpenMediaVault doesn’t offer some Admin GUI which allows for a much serene experience (out of curiosity: is there a reason why you run v5 and not a newer version)?
And - because I just look over the OMV documentation - by any chance you try to delete a shared folder?
 

smartin80

macrumors member
Original poster
Jun 5, 2020
40
23
Sorry I'm taking so long to respond, I'm not getting notifications that you have posted...

This is what I'm getting:
simonrmartin@Mac-Pro ~ % sudo rmdir "/Volumes/simon/AToremove/DLinkbackup/Brushes"
Password:
rmdir: /Volumes/simon/AToremove/DLinkbackup/Brushes: Directory not empty
simonrmartin@Mac-Pro ~ % sudo rmdir "/Volumes/simon/AToremove/DLinkbackup/Brushes/*"
rmdir: /Volumes/simon/AToremove/DLinkbackup/Brushes/*: No such file or directory
simonrmartin@Mac-Pro ~ %

That's using my admin account...
 
Last edited:

smartin80

macrumors member
Original poster
Jun 5, 2020
40
23
Sorry... I'm not using V6 because my nerves won't stand the upgrade process... ;-)

I'm not trying to delete the root folder of a share, no. It's a folder well within a share.
 

Slartibart

macrumors 68030
Aug 19, 2020
2,874
2,571
Please check the OVM manual - basically you will not be able to delete a shared folder when a service is using it. You just need to make sure no service is using the share then you will be able to delete it.

Login via the OVM web interface and check the services like SMB/CIFFS, FTP and so on on the left side of the GUI.
First you need to delete all references. Then you can remove the shared folder. When you remove the shared folder you can select if you only want to remove the share or the share and data. If you select the latter also the folder on the data drive will be deleted.
 

smartin80

macrumors member
Original poster
Jun 5, 2020
40
23
I found the solution, thanks. I was logging in using my Mac credentials, not the NAS credentials. The reason for that was that when I had logged in as root using the NAS credentials, all I could see was a .deb file.

Turns out that if I cd /srv I could see the various shares and navigate down from there.

Hope that helps another newb :)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.