LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 04-19-2016, 05:54 AM   #1
Xianglong
LQ Newbie
 
Registered: Apr 2016
Posts: 1

Rep: Reputation: Disabled
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?

Thanks for any ideas!
 
Old 04-19-2016, 10:29 AM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,292

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
Navigate to a subdir of the USB drive in your console & try
Code:
find - name '*.~lock.file_name.odt\#
the extra '\' is needed before any unusual character in a filename. Also worth a try is a line like
Code:
rm -i /path/to/usb_drive/*
That wioll offer to delete everything individually, but you can answer 'y' or 'n' to each.
 
Old 04-20-2016, 11:09 AM   #3
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
If there is nothing you want on that usb, use gparted. just delete the partition, then reestablish it.
 
Old 04-20-2016, 11:23 AM   #4
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,779

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
Have you tried ntfsfix (part of the ntfsprogs package)?
 
Old 04-20-2016, 11:23 AM   #5
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
fsck?
 
Old 04-20-2016, 11:36 AM   #6
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
No, ntfsfix
 
  


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
How to remove bad filename pattern from every file in one folder? jaytd Linux - Newbie 3 07-16-2009 02:55 AM
How to remove konqueror file/folder association drudge Linux - Newbie 6 11-04-2007 05:03 AM
Broken Driver reference in GNOME racyrefinedraj Linux - Software 0 09-06-2005 06:19 PM
Remove folder and file os2 Programming 1 03-12-2005 02:12 PM
I've broken my mandrakelinux installing perl-base ethereal9 Mandriva 21 10-24-2004 07:37 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 08:21 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