LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 02-21-2021, 01:54 AM   #1
andrewf8
LQ Newbie
 
Registered: Dec 2005
Location: Milky Way, sector 9
Distribution: Fedora 35
Posts: 19

Rep: Reputation: 0
Unable to delete files on USB hard disk


I use FreeFileSync in one direction to backup my data files from my Fedora 33 computer onto a USB hard disk.

It has worked well on thousands of files for years. However, a bit ago, FreeFileSync could not update five files on the USB hard disk. They do NOT have unusual characters in their filenames.

When FreeFileSync updates a file, it appears to delete the previous version at the target location, then copies the new version across. It could not do that. I get this message:
Unable to move "/run/media/u/My Passport/FedoraBoxMirror/Documents/quotes.odt" to the recycle bin.
G_IO_ERROR_NOT_FOUND: Unable to trash file /run/media/u/My Passport/FedoraBoxMirror/Documents/quotes.odt: No such file or directory [g_file_trash]

The five target files can be seen on the Fedora 33 Files Manager, they open in LibreOffice, but can not be deleted because supposedly I do not have permission. But, looking at permissions for the files, I do.

So, I tried to use terminal. I changed to root user. I CD'ed to the directory on the USB hard disk, the files come up on "ls", but when I try "rm", the system says there is "No such file or directory".

Does anyone have any ideas how to resolve this?
Attached Thumbnails
Click image for larger version

Name:	DifficultyDeletingFilesInBackupHardDisk.png
Views:	29
Size:	102.2 KB
ID:	35681  

Last edited by andrewf8; 02-22-2021 at 05:07 AM.
 
Old 02-21-2021, 03:04 AM   #2
sasongko
LQ Newbie
 
Registered: Feb 2017
Distribution: Slackware
Posts: 25

Rep: Reputation: 10
how about to unmount and run fsck?
 
Old 02-21-2021, 09:03 AM   #3
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Could there be non-printable characters in the filenames? ls -b displays them.

Or there is corruption, as suggested by sasongko.
 
Old 02-21-2021, 09:40 AM   #4
kilgoretrout
Senior Member
 
Registered: Oct 2003
Posts: 2,988

Rep: Reputation: 388Reputation: 388Reputation: 388Reputation: 388
For the directory with the problem files, could you post the output of:
Code:
# ls -l
and:
Code:
# lsattr
And for the problem file, post the output of:
Code:
# getfacl lists.xls
Also, how is your backup drive formatted, eg ntfs, vfat, ext4?

Last edited by kilgoretrout; 02-21-2021 at 09:48 AM.
 
Old 02-21-2021, 10:28 AM   #5
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
I have a number of USB sticks died like this, at one point it goes read-only and that's it. Nothing can do. RIP. Often they show also much less capacity, only a few MB, I suspect this is the area where file descriptors are held, while the storage area itself is gone. This would explain why it is read-only.
 
Old 02-21-2021, 11:13 AM   #6
kilgoretrout
Senior Member
 
Registered: Oct 2003
Posts: 2,988

Rep: Reputation: 388Reputation: 388Reputation: 388Reputation: 388
I don't think he has a flash drive. He describes it as a disk and it's mounted on "My Passport" which would indicate a Western Digital external hard drive. But to test if it's mounted read only, with the drive mounted check the output of:
Code:
$ mount
If the entry for the drive has an "ro" in it, it's mounted read only.
 
Old 02-21-2021, 11:33 AM   #7
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
Yes, my bad, I see now "hard drive" in initial post. Filesystem corruption will cause read-only mount.
 
Old 02-21-2021, 10:27 PM   #8
Brains
Senior Member
 
Registered: Apr 2009
Distribution: All OS except Apple
Posts: 1,591

Rep: Reputation: 389Reputation: 389Reputation: 389Reputation: 389
Quote:
Originally Posted by andrewf8 View Post
I use FreeFileSync in one direction to backup my data files from my Fedora 33 computer onto a USB hard disk.

It has worked well on thousands on files for years. However, a bit ago, FreeFileSync could not update five files on the USB hard disk. They do NOT have unusual characters in their filenames.

When FreeFileSync updates a file, it appars to delete the previous version at the target location, then copies the new version across. It could not do that. I get this message:
Unable to move "/run/media/u/My Passport/FedoraBoxMirror/Documents/quotes.odt" to the recycle bin.
G_IO_ERROR_NOT_FOUND: Unable to trash file /run/media/u/My Passport/FedoraBoxMirror/Documents/quotes.odt: No such file or directory [g_file_trash]

The five target files can be seen on the Fedora 33 Files Manager, they open in LibreOffice, but can not be deleted because supposedly I do not have permission. But, looking at permissions for the files, I do.

So, I tried to use terminal. I changed to root user. I CD'ed to the directory on the USB hard disk, the files come up on "ls", but when I try "rm", the system says there is "No such file or directory".

Does anyone have any ideas how to resolve this?
They are probably links to a file, when in the computer file system the link works, in the backup drive with a different path they are broken but LibreOffice is being protective or something. Check those files in Fedora to get the scoop.
Quote:
Distribution: Fedora 4 (soon)
Been a while since u updated your profile?
 
Old 02-22-2021, 04:39 AM   #9
andrewf8
LQ Newbie
 
Registered: Dec 2005
Location: Milky Way, sector 9
Distribution: Fedora 35
Posts: 19

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by berndbausch View Post
Could there be non-printable characters in the filenames? ls -b displays them.

Or there is corruption, as suggested by sasongko.
Nope, no non-printable characters.
The five files have very simple names.
When the files ceased being backed up, I added a "+" to each of their names, and those copies are the files are consistently backed up without difficulty.
 
Old 02-22-2021, 05:08 AM   #10
andrewf8
LQ Newbie
 
Registered: Dec 2005
Location: Milky Way, sector 9
Distribution: Fedora 35
Posts: 19

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by sasongko View Post
how about to unmount and run fsck?
I tried to run fsck, but it did not work.
It seemed to want an ext2 or ext3 or ext4 file system. But the USB hard disk is a fuse filesystem.

The full text is:
[u@lenofedo /]$ fsck /run/media/u/'My Passport' -a
fsck from util-linux 2.36.1
fsck.ext2: Is a directory while trying to open /run/media/u/My Passport
/run/media/u/My Passport:
The superblock could not be read or does not describe a valid ext2/ext3/ext4
filesystem. If the device is valid and it really contains an ext2/ext3/ext4
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
e2fsck -b 8193 <device>
or
e2fsck -b 32768 <device>
 
Old 02-22-2021, 05:23 AM   #11
andrewf8
LQ Newbie
 
Registered: Dec 2005
Location: Milky Way, sector 9
Distribution: Fedora 35
Posts: 19

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by kilgoretrout View Post
For the directory with the problem files, could you post the output of:
Code:
# ls -l
and:
Code:
# lsattr
And for the problem file, post the output of:
Code:
# getfacl lists.xls
Also, how is your backup drive formatted, eg ntfs, vfat, ext4?
The USB backup drive is "fuse" file format.

Context for the following outputs:
Four of the five files which will not update/delete are in this directory.
You will see four files with a "+" at the end. It is the files with the same name as these BUT WITHOUT THE "+" which will not update/delete.

[root@lenofedo Documents]# ls -l
total 1288
drwxrwxrwx. 1 u u 8192 Feb 21 16:23 accounting
-rwxrwxrwx. 1 u u 21891 Oct 5 09:35 addresses.ods
-rwxrwxrwx. 1 u u 30039 Jan 28 2017 allchileforum.odt
drwxrwxrwx. 1 u u 4096 Jan 16 18:00 andrew
-rwxrwxrwx. 1 u u 63102 Nov 28 20:22 BooksMoviesMusic.ods
drwxrwxrwx. 1 u u 4096 Sep 13 19:03 business+work
drwxrwxrwx. 1 u u 4096 Oct 19 2019 corporate+BASes
drwxrwxrwx. 1 u u 4096 May 2 2020 ebooks
drwxrwxrwx. 1 u u 4096 Feb 21 16:23 familia
drwxrwxrwx. 1 u u 24576 Apr 26 2020 GX280SavedData
drwxrwxrwx. 1 u u 4096 May 26 2019 investment
-rwxrwxrwx. 1 u u 13555 Dec 19 20:29 KnowledgeAustralia.odt
-rwxrwxrwx. 1 u u 39519 Feb 6 11:22 knowledgeGeneral+.odt
-rwxrwxrwx. 1 u u 39641 Mar 12 2020 knowledgeGeneral.odt
-rwxrwxrwx. 1 u u 168448 Feb 21 17:39 lists+.xls
-rwxrwxrwx. 1 u u 164864 Mar 29 2020 lists.xls
drwxrwxrwx. 1 u u 4096 Jul 5 2020 music+videos
drwxrwxrwx. 1 u u 20480 Jan 16 18:00 pend
drwxrwxrwx. 1 u u 8192 Nov 23 2019 PublicDocumentsOnWin7box
-rwxrwxrwx. 1 u u 161577 Feb 21 16:48 quotes+.odt
-rwxrwxrwx. 1 u u 137931 Mar 29 2020 quotes.odt
-rwxrwxrwx. 1 u u 24386 Oct 31 08:36 residences+workcontracts+overseasTrips.odt
drwxrwxrwx. 1 u u 4096 Feb 21 16:23 shares
drwxrwxrwx. 1 u u 8192 Jul 5 2020 slates
drwxrwxrwx. 1 u u 20480 Feb 21 16:23 technology+websites+OurHardwareSoftware+Items+Receipts
drwxrwxrwx. 1 u u 4096 Jul 26 2020 torrents
drwxrwxrwx. 1 u u 8192 Sep 13 19:03 trading
-rwxrwxrwx. 1 u u 48126 Mar 29 2020 URLsDesde1201.ods
-rwxrwxrwx. 1 u u 49534 Feb 13 00:58 URLsDesde1201+.ods
drwxrwxrwx. 1 u u 4096 Feb 21 16:23 ViajeTravel
[root@lenofedo Documents]#

You can see that the permissions of those with the "+" are the same as the permissions of those which will not update/delete, without the "+".

[root@lenofedo Documents]# lsattr
lsattr: Invalid argument While reading flags on ./music+videos
. . . with the same output for the entire directory.
(Reading the lsattr man page, it appears it is only for ext2 file systems, which this is not.)

[root@lenofedo Documents]# getfacl lists.xls
# file: lists.xls
# owner: u
# group: u
user::rwx
group::rwx
other::rwx
[root@lenofedo Documents]#

Last edited by andrewf8; 02-22-2021 at 05:25 AM.
 
Old 02-22-2021, 05:29 AM   #12
andrewf8
LQ Newbie
 
Registered: Dec 2005
Location: Milky Way, sector 9
Distribution: Fedora 35
Posts: 19

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Brains View Post
They are probably links to a file, when in the computer file system the link works, in the backup drive with a different path they are broken but LibreOffice is being protective or something. Check those files in Fedora to get the scoop.

Been a while since u updated your profile?
Based upon the sizes of the five files which will not update/delete, they are not links. They are the previous versions of the files themselves.

Thanks for bringing my outdated profile to my attention; I updated it.
 
Old 02-22-2021, 06:15 AM   #13
kilgoretrout
Senior Member
 
Registered: Oct 2003
Posts: 2,988

Rep: Reputation: 388Reputation: 388Reputation: 388Reputation: 388
Quote:
The USB backup drive is "fuse" file format.
Fuse isn't a filesystem format; it's a software interface typically used to mount and access ntfs formatted partitions. See:
https://en.wikipedia.org/wiki/Filesystem_in_Userspace
Your passport drive came formatted ntfs and unless you formatted it to something else, it's still ntfs. As Emerson suggested, it may be mounted read only due to some filesystem corruption. Check this possibility by running:
Code:
# mount
with the drive mounted. That will list all mounted drives. Find the entry for your Passport drive and post the output here. It should look something like this:
Code:
/dev/sdf1 on /media/patrick/Windows_Backup type fuseblk (rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096,uhelper=udisks2)
The important thing is the "rw". If yours has "ro" instead, the drive is mounted read only which would explain why you can't delete the files.
There are tools to check and repair ntfs filesytems in linux but I think you are better off doing that in windows if you have access to a windows OS.
 
Old 04-16-2022, 08:03 AM   #14
andrewf8
LQ Newbie
 
Registered: Dec 2005
Location: Milky Way, sector 9
Distribution: Fedora 35
Posts: 19

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by kilgoretrout View Post
The important thing is the "rw". If yours has "ro" instead, the drive is mounted read only which would explain why you can't delete the files.
There are tools to check and repair ntfs filesytems in linux but I think you are better off doing that in windows if you have access to a windows OS.
Many, many other files are updated (i.e. deleted then more recent files written) on the USB hard disk.
It therefore is not an issue with the permissions for the entire drive.

I still have the issue:

I can open the files using OpenOffice.

The files appear when using the "ls" command.

But the files are supposedly not there when using the "unlink" and "rm" commands. See below:

[u@lenofedo shares]$ cd ..
[u@lenofedo Documents]$ rm -rf shares
rm: cannot remove 'shares': Directory not empty
[u@lenofedo Documents]$ cd shares
[u@lenofedo shares]$ ls
SharesUnrealisedProfits.ods
[u@lenofedo shares]$ unlink Shares*
unlink: cannot unlink 'SharesUnrealisedProfits.ods': No such file or directory
[u@lenofedo shares]$

I am dubbing these "Schrodinger files".

Last edited by andrewf8; 04-16-2022 at 08:14 AM.
 
Old 04-16-2022, 05:02 PM   #15
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,340

Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
Quote:
Originally Posted by andrewf8 View Post
I can open the files using OpenOffice.
Can you make a minor change using OpenOffice and save the files?
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to enable a Hard Disk to read/write to a USB device but disable the USB device to read/write to the hard disk without user permission? ce309 Linux - General 33 05-22-2019 04:30 PM
Copy of IBM Server hard disk data to Another USB External Hard disk mazharcdn Linux - Server 2 09-02-2009 12:41 AM
mounting linux files from another hard disk(IDE) to current hard disk(sata) the lord protector Linux - Hardware 5 05-04-2008 11:30 AM
Now I have a scsi hard disk, two IDE hard disk, i want install linux on scsi hard dis tecpenguin Linux - Server 4 11-10-2007 06:44 AM
60GB laptop hard disk & 200GB external USB hard disk linux compatibility powah Linux - Hardware 0 03-07-2006 10:55 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:40 AM.

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