Cannot remove broken file reference in base folder of external HD
Linux - HardwareThis forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Cannot remove broken file reference in base folder of external HD
Hello!
Some time ago I saved a LibreOffice document to an external USB NTFS-formatted hard disk. It messed up due to using a USB hub with other devices attached.
Now when I try to mount and open the hard disk (in Thunar, in Manjaro), I get an error message along the lines of (translating to English): Could not open folder disk_name. Error in obtaining information about the file '/run/media/user_name/disk_name/.~lock.file_name.odt#': input/output error.
However, the disk does in fact mount. I can display the files in its subfolders in Thunar, and open files. Thunar only throws the error when I ask it to display the base folder. In the console, ls -la shows the troublemaker as
-?????????? ? ? ? ? ? .~lock.file_name.odt#
I can neither rm nor chmod the file, with sudo or without: that gives I/O errors.
After the mess-up I tried to connect the disk to an old Windows computer to run chkdsk, but the old Win would not recognize the drive and then I made it worse by trying to force it to use some drivers. After this stupid detour, back on Linux I ran testdisk on it, chose Intel/PC partition > Analyse. IIRC it showed two NTFS partition entries (there is actually only a single partition on the disk): one that uses all of the disk and one that started a bit further on. I picked the former, and chose 'Write partition structure to disk'. This resulted in a usable HD as described above, but still with the broken file reference.
I do not need to recover the file in question. How can I remove the messed-up reference to it?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.