LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-04-2022, 07:48 PM   #1
wh33t
Member
 
Registered: Oct 2003
Location: Canada
Posts: 922

Rep: Reputation: 61
Talking How do I delete a (broken?) file lock?


Code:
$ ls -l
ls: cannot access 'lock': No such file or directory
total 0
?????????? ? ? ? ?            ? lock
Is this a half way made symbolic link to something? I can't be certain, but I had a large syncthing transfer going on and I decided to move some data out of the directory being sync'd to make the transfer go faster and be smaller. I believe this directory was in the directory I was moving.

I can't seem to figure out how to delete this thing.
 
Old 05-04-2022, 08:11 PM   #2
computersavvy
Senior Member
 
Registered: Aug 2016
Posts: 3,345

Rep: Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484
That looks like a file corruption in the directory structure.

Have you tried booting to live media and running fsck on the installed file systems to see if it can be fixed.

Please take this to heart and do not ever interrupt, delete files, or change directory structures when a file transfer is in progress. The transfer process often creates a temporary list of files being copied / moved / transferred before it starts then walks that list to perform the transfer. If things get shifted while it is in progress bad things can happen to your file system.
 
1 members found this post helpful.
Old 05-04-2022, 08:15 PM   #3
wh33t
Member
 
Registered: Oct 2003
Location: Canada
Posts: 922

Original Poster
Rep: Reputation: 61
Quote:
Originally Posted by computersavvy View Post
That looks like a file corruption in the directory structure.

Have you tried booting to live media and running fsck on the installed file systems to see if it can be fixed.

Please take this to heart and do not ever interrupt, delete files, or change directory structures when a file transfer is in progress. The transfer process often creates a temporary list of files being copied / moved / transferred before it starts then walks that list to perform the transfer. If things get shifted while it is in progress bad things can happen to your file system.
Yup, lesson learned. Not even linux can protect me from myself.

Any live distro you suggest? Something small and quick to boot?
 
Old 05-04-2022, 08:26 PM   #4
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,263
Blog Entries: 24

Rep: Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194
When you see...

Code:
-????????? ? ? ? ?            ?  somefile
... it indicates that some parent directory is readable (i.e. 'r') but not traversable (i.e. no 'x') by user. The user can read the directory listing which includes the filename, but cannot enter the directory to read the file stats.

Your example includes a leading '?' and I am uncertain what that might mean, but I would suggest looking at the path leading to that file and make sure each directory is traversable. Fixing that would probably fix your ability to alter or delete the lock.

Last edited by astrogeek; 05-04-2022 at 08:33 PM. Reason: the -> some
 
1 members found this post helpful.
Old 05-04-2022, 08:31 PM   #5
wh33t
Member
 
Registered: Oct 2003
Location: Canada
Posts: 922

Original Poster
Rep: Reputation: 61
Quote:
Originally Posted by astrogeek View Post
When you see...

Code:
-????????? ? ? ? ?            ?  somefile
... it indicates that the parent directory is readable (i.e. 'r') but not traversable (i.e. no 'x') by user. The user can read the directory listing which includes the filename, but cannot enter the directory to read the file stats.

Your example includes a leading '?' and I am uncertain what that might mean, but I would suggest looking at the path leading to that file and make sure each directory is traversable. Fixing that would probably fix your ability to alter or delete the lock.
So chmod +x on the parent? It's already set to 777.
 
Old 05-04-2022, 08:32 PM   #6
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,263
Blog Entries: 24

Rep: Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194
Quote:
Originally Posted by wh33t View Post
So chmod +x on the parent?
Yes, and it may not be the immediate parent so check the full path for any level that is not 'x'able.

Last edited by astrogeek; 05-04-2022 at 11:55 PM. Reason: ypo
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
open lock file /var/lib/postfix/master.lock: cannot open file: Permission denied gabsik Linux - Server 6 08-30-2012 09:39 PM
deian yum lock [ ERR] Reading state information E: Could not get lock /var/lock/aptit jayakumar01 Linux - Server 1 12-05-2011 11:26 AM
[SOLVED] Can't read lock file tmp .x0-lock xinit: stale nfs file handle everal Slackware 2 10-31-2011 07:11 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:26 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration