LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Cannot get rid of unwanted locked folder/directory (https://www.linuxquestions.org/questions/linux-software-2/cannot-get-rid-of-unwanted-locked-folder-directory-4175613451/)

massageguy 09-08-2017 11:43 AM

Cannot get rid of unwanted locked folder/directory
 
My first post, and I'm definitely new to Linux.
My arrangement is this: I have a Toshiba Satellite L500 laptop (old as the hills, I know) running Mint 17.3, a Packard Bell dot s Netbook running Mint 18.2 both of which are connected to my NAS drive for centralised storage of all files. The three items are networked so that I can work on which is most convenient at the time (Toshiba at home and PB on the move).
Initially, I backed up only my documents folder from the NAS to the Toshiba (laptop) using the Backup Tool loaded with Mint 17.3. It worked fine, but (there's always a but), I later decided that I needed something less basic so that I could synch updated files automatically. Rsync (using Grsync) gave me what I needed as this allows individual backups to be accessed (Backup Tool locked folders, as far as I could tell) if necessary.
Anyway I backed up all files from the NAS to the laptop, but, ran out of space before it finished because of the previously executed backup. It took me an age to work out how to delete the files and folders from the old backup to give me the space to let the new backup complete. Eventually, I was able to clear the old backup folder, having checked that everything was okay with the new one first.
But (remember them?), one folder stuck and I cannot get rid of it! Whatever I try (don't know that much anyway) it will not go. I consistently get "There was an error deleting .mintbackup. blah, blah, : Permission denied".
Although the folder is doing no harm just sitting there in my Home folder, it would be nice to, a) find out why, and, b) get rid as it's annoying me.
As I said before, I'm new to both Linux and this forum, so please be gentle with me.
PS, I have a few hundred (thousand?) more questions to ask, yet!

!!! 09-08-2017 03:06 PM

Hello, and a big WELCOME to LQ!!!
Please, never feel bad about asking anything on LQ!!!
Even IF some answer needs 'thick skin' to read, like:
lmgtfy rtfm (f=fine) faq rules guidance etc etc;)

In this case, check the owner and permissions='mode' on that 'stuck' directory, for which I'll use the name 'it', below.
I'll assume you can somehow get to a shell prompt, in a terminal. (My CLI 'Heaven':D)
(IF not, feel free to ask!!! Always!!!)
Code:

ls -ld it; df it; sudo rmdir it
You can use CODE tags around posted info (see BB code link at bottom of page.
Or you could try this &post termbin link: (cmd1;cmd2;...) | nc termbin.com 9999
(huge 'extra credit' IF you figure out: parenthesis semicolon pipe shell syntax;))

IF you like .pdf onlne eBook reading, I can send you some links.

Best wishes!!! Looking forward to hearing back from you!!!

p.s. How do you 'mount'/access that NAS, while you "move"?

Keith Hedger 09-08-2017 05:09 PM

if you can't remove it with root permisions boot from a live medium ( CD ) and you should be able to delete it easily, good luck an welcome to the forums

massageguy 09-10-2017 04:28 AM

Quote:

Originally Posted by !!! (Post 5756882)
Hello, and a big WELCOME to LQ!!!
Please, never feel bad about asking anything on LQ!!!
Even IF some answer needs 'thick skin' to read, like:
lmgtfy rtfm (f=fine) faq rules guidance etc etc;)

Thanks for greetings and I won't hesitate to ask, however, I will try to understand before I ask...hence the delay replying.

Quote:

In this case, check the owner and permissions='mode' on that 'stuck' directory, for which I'll use the name 'it', below.
I'll assume you can somehow get to a shell prompt, in a terminal. (My CLI 'Heaven':D)
(IF not, feel free to ask!!! Always!!!)
Code:

ls -ld it; df it; sudo rmdir it

Using this line gave me 'rmdir: failed to remove 'it' (no I didn't use 'it'): Directory not empty'. It sure looked it. I worked out how to view hidden files and found one called .mintbackup... which I tried a simple delete on and that didn't work. It looks like I have get rid of this first. When I checked the properties/permissions everything was greyed out and told me I was 'not the owner, so cannot change these permissions.'

So, now the question is "who is, and how do I get permission?

Quote:

You can use CODE tags around posted info (see BB code link at bottom of page.
Or you could try this &post termbin link: (cmd1;cmd2;...) | nc termbin.com 9999
(huge 'extra credit' IF you figure out: parenthesis semicolon pipe shell syntax;))
I'm not going there just yet!!!

Quote:

IF you like .pdf onlne eBook reading, I can send you some links.
Not too techy please.

Quote:

Best wishes!!! Looking forward to hearing back from you!!!

p.s. How do you 'mount'/access that NAS, while you "move"?
The truth is I don't mount it. I simply put the files I might need in Dropbox. Pictures from my camera and phone do however go directly to the NAS via WD Photos and My Cloud and are thus backed up instantly. I have to file them properly when at home, though.

Thanks for your help!

massageguy 09-10-2017 04:32 AM

Quote:

Originally Posted by Keith Hedger (Post 5756910)
if you can't remove it with root permisions boot from a live medium ( CD ) and you should be able to delete it easily, good luck an welcome to the forums

Thanks for the welcome. I'm sorry to say that I have no idea how to do this!

ondoho 09-10-2017 04:55 AM

Quote:

Originally Posted by massageguy (Post 5757263)
Thanks for the welcome. I'm sorry to say that I have no idea how to do this!

ouch. very basic stuff.
please take the time to review these search results:
https://duckduckgo.com/?q=linux+how+to+become+root
if you still have questions afterwards i'll be happy to help.

massageguy 09-10-2017 06:14 AM

Quote:

Originally Posted by ondoho (Post 5757266)
ouch. very basic stuff.
please take the time to review these search results:
https://duckduckgo.com/?q=linux+how+to+become+root
if you still have questions afterwards i'll be happy to help.

Thanks for your help! I checked it out and got root in the terminal but, the suggested command given still didn't let me delete the culprit file.

dave@burn-it.co.uk 09-10-2017 06:54 AM

How big is the file?? I seem to remember that there is a certain situation where an entry exists in the directory for a file that does not actually exist and therefore cannot be deleted. I think if that is the case you just have to live with it, though I would try creating a file with the same name and see what happens - it just might kick it into behaving.

massageguy 09-10-2017 07:07 AM

Quote:

Originally Posted by dave@burn-it.co.uk (Post 5757291)
How big is the file?? I seem to remember that there is a certain situation where an entry exists in the directory for a file that does not actually exist and therefore cannot be deleted. I think if that is the case you just have to live with it, though I would try creating a file with the same name and see what happens - it just might kick it into behaving.

The files is quite small at 119 bytes, so there must be something there.

massageguy 09-10-2017 08:47 AM

Quote:

Originally Posted by !!! (Post 5756882)
p.s. How do you 'mount'/access that NAS, while you "move"?

This question gave me a mind to check if there is another way to access my files "on the move" directly. It turned out there is!!! I'm not certain I like it much because the website site involved (although it is owned and run by WD) came with browser warnings about it not being secure (not https). I had to over-ride this making a 'security exception' to be able to access my NAS.

Setting up was relatively painless and with the 'exception' in place, easy to access. However, I think I would prefer to be a little suspicious and avoid using this method because of that security thing bearing in mind it's all rather private. Actually, I think I might get rid of that exception as well, and stick with Dropbox.

Thank you for that question !!! it made 'a moment of greater interest'. D

ondoho 09-10-2017 01:53 PM

Quote:

Originally Posted by massageguy (Post 5757283)
Thanks for your help! I checked it out and got root in the terminal but, the suggested command given still didn't let me delete the culprit file.

please show us.
full commands issued, full output received.

!!! 09-10-2017 02:32 PM

I forgot to mention: rmdir only works IF it is empty.
I was afraid to mention: rm -rf switches, because they can easily accidentally wipe-out a whole system!!! But -i will give you a chance to think first. man:D

There's new https:// tricks that Idk, so I maybe lost as to what you are doing!!!
Actually, it maybe just a web-app, that has nothing to do with Linux!!!
Can you access 'it' from the cli? ls -al it
Don't be scared: ls -la it | nc termbin.com 9999 ;)
Even this crazy idea might uncover a clue, as to what's going on:
cd it; df .* | nc ... (leave off the pipe netcat ..., to look at it first:idea:)
:thumbsup:p.s. WebSearch: shell pipe brief simple basic tutorial

Yes, specific details 'rule':jawa: "Something did something" freaks people out!!! :eek:

massageguy 09-11-2017 11:41 AM

Quote:

Originally Posted by !!! (Post 5757411)
I forgot to mention: rmdir only works IF it is empty.
I was afraid to mention: rm -rf switches, because they can easily accidentally wipe-out a whole system!!! But -i will give you a chance to think first. man:D

I think I'll give that a miss for the moment

Quote:

There's new https:// tricks that Idk, so I maybe lost as to what you are doing!!!
Actually, it maybe just a web-app, that has nothing to do with Linux!!!
I think you are correct as this happens entirely on-line in the browser...you can, however, download any of the files that are visible. And, upload any that have been changed.

Quote:

Can you access 'it' from the cli? ls -al it
This worked and gave me some info that I have yet to understand
Code:

total 12
drwxr-xr-x  2 root  root  4096 date/time.
drwxr-xr-x 39 myname myname 4096 date/time..
-rw-r--r--  1 root  root    119 date/time and filename

Quote:

Don't be scared: ls -la it | nc termbin.com 9999 ;)
I haven't done this next bit as I don't if I'm supposed to, having got the above?

chrism01 09-13-2017 04:46 AM

Can you show the actual output of these cmds please; it could be important.
Code:

pwd
ls -al

lsattr

ls -lZ

Thanks

JJJCR 09-13-2017 05:19 AM

I guess you can also post the output of the command below:

ls -ld directory

It will tell you whether you have the permissions or not


All times are GMT -5. The time now is 08:49 AM.