Delete unneeded folders in a share


garycase

Recommended Posts

I was cleaning out some old folders on my UnRAID server, and several of them refuse to delete ... noting they need permission from a specific user -- which happens to be the one I'm logged in as.   I get a "You require permission from <username> to make changes to this file" message; but I'm logged in as the specified user.   It also doesn't work if I log in as root, which I thought might give me more "superpower" privileges.

 

Note I am NOT a "Linux guy" -- I just use UnRAID  as a large protected file server for backups and archives.

 

It's been a couple years, but I seem to recall there's a way to do this from the console using a Linux command (I think the last time somebody helped me with this they called it a "machine gun" approach 😀).

 

I'd appreciate it if a Linux person could guide me through doing this.   Note the folder names include spaces, so if I need to put things in quotes please include that detail.   e.g. one of the folders is:

 

\\media\Backups\OSImages to keep for friends\Johnson - Doug

 

So my question is how do I navigate to this on the console, and what exact command do I type to remove it.   Note there are a lot of folders under the "OSimages to keep for friends", and I only want to delete a few specific ones.

 

Thanks in advance for the help.

 

 

 

Link to comment

I always use Midnight Commander (mc from the command line) to work with folders and files directly on the server.

 

You could also try setting the share to Public access just to make sure it doesn't matter what user is "logged in". Windows won't actually let you have access as a different user even if it prompts you to login again. You have to delete the credentials to get it to let you login to a network resource as a different user.

 

And, note that "root" doesn't actually have root (or indeed any special) access when accessing files over the network. You can't choose a user named "root" for private or secure access to a share for example. The root user is only for webUI or command line, not for network shares.

Link to comment

If I type Tools - New Permissions, I get a note that outlines the mandatory need to run this when upgrading from a pre-v5 release, which indicates I should run it on all disks.    I don't think I need to do this, as this system hasn't been upgraded in a long time (and it's already on a v6 release).

 

I'm running v6.5.3  (This is an OLD server and it runs rock-solid on that release, so I never upgraded beyond it -- actually I did upgrade to the next version after it, but that caused a couple issues, so I reverted to 6.5.3 and have never changed it since).   The hardware is one of Tom's original recommendations for UnRAID -- a SuperMicro C2SEA with 4GB.

 

If I do the Tools - New Permissions should I just select the share that's having the issue [e.g. "Backups"], or so I also need to select the disks that that share is using?    Is this likely to mess up anything in that share?? ... i.e. should I copy all of the contents to another system before doing it??

 

 

 

Link to comment
3 minutes ago, trurl said:

I always use Midnight Commander (mc from the command line) to work with folders and files directly on the server.

 

You could also try setting the share to Public access just to make sure it doesn't matter what user is "logged in". WIndows won't actually let you have access as a different user even if it prompts you to login again. You have to delete the credentials to get it to let you login to a network resource as a different user.

 

And, note that "root" doesn't actually have root (or indeed any special) access when accessing files over the network. You can't choose a user named "root" for private or secure access to a share for example. The root user is only for webUI or command line, not for network shares.

 

Is mc already built in to the system; or do I have to download/install it?  [If so, do you have a link?]

 

And can you tutor me through the specific commands that I'd need to delete one of the folders?   Perhaps for the one I listed above as an example.

 

Link to comment
4 minutes ago, garycase said:

using mc is a "safer" approach than running New Permissions

They really are about different things. mc is running as root but you can concentrate on just the things you need to.

 

New Permissions is going to try to "fix" permissions on a whole share, which may or may not help you delete things over the network depending on what is actually causing the access problem. 

 

Windows isn't always very helpful with some of its error messages.

 

It may be more likely that you aren't actually succeeding in getting

34 minutes ago, garycase said:

logged in as the specified user

because

21 minutes ago, trurl said:

Windows won't actually let you have access as a different user even if it prompts you to login again. You have to delete the credentials to get it to let you login to a network resource as a different user.

 

Link to comment

MC worked very nicely.    It apparently didn't "see" the shares; but if I went to each of the disks that were part of the share and deleted the part of the folder that was on that disk, it did everything I wanted -- the folders are now gone.

 

i.e. the share I was working with ["OSImages to keep for friends"] is on disks 9, 10, 11, and 12.   So I went to each of these disks in MC and for those that had components of the folder I wanted to delete I simply deleted them using F8 in mc.    Not every folder was shown on every disk; but when I finished processing all of the disks, I went back to my PC and accessed the share and Voila!, the troublesome folders are all gone.

 

Link to comment
19 minutes ago, garycase said:

It apparently didn't "see" the shares

The user shares are in /mnt/user assuming you have user shares enabled. I have never had any problem accessing them with mc, but I typically use mc when I want to work directly with the disks since I only allow user shares to be accessed on the network. And there can be a couple of "surprises" when working with user shares directly on the server:

 

Link to comment
6 hours ago, trurl said:

The user shares are in /mnt/user 

 

 

Thanks.   Although I think I'll just stay with doing each disk independently, as that seems safest -- and the shares involved are all limited to only 4 disks, so it's not that hard to do.    In any event, everything I wanted to "clean up" is now done -- and the stuff I couldn't do from Windows worked perfectly with MC.   Thanks big time for the tip.

 

 

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.