My pen drive which is almost half full on opening shows no file. To check if the pen drive is corrupted, I tried the pen drive in Manjaro and Windows and i was able to access my files.
So it is Fedora issue.
On using ls -l , I got :
[wizard@fedora 9707-588E]$ ls -l
ls: cannot access 'Alarms': No such file or directory
ls: cannot access 'Audiobooks': No such file or directory
ls: cannot access 'class': No such file or directory
ls: cannot access 'class-copy': No such file or directory
ls: cannot access 'config': No such file or directory
ls: cannot access 'docs': No such file or directory
ls: cannot access 'Documents': No such file or directory
ls: cannot access 'Download': No such file or directory
ls: cannot access 'loop': No such file or directory
ls: cannot access 'loop-copy': No such file or directory
ls: cannot access 'Android': No such file or directory
ls: cannot access 'Movies': No such file or directory
ls: cannot access 'Music': No such file or directory
ls: cannot access 'Notifications': No such file or directory
ls: cannot access 'Photos': No such file or directory
ls: cannot access 'Pictures': No such file or directory
ls: cannot access 'Bank Details.pdf': No such file or directory
ls: cannot access 'Win10_21H2_EnglishInternational_x64.iso': No such file or directory
ls: cannot access 'IMG_20221005_142837.jpg': No such file or directory
total 5376
d?????????? ? ? ? ? ? Alarms
d?????????? ? ? ? ? ? Android
d?????????? ? ? ? ? ? Audiobooks
-?????????? ? ? ? ? ? 'Bank Details.pdf'
d?????????? ? ? ? ? ? class
d?????????? ? ? ? ? ? class-copy
d?????????? ? ? ? ? ? config
d?????????? ? ? ? ? ? docs
d?????????? ? ? ? ? ? Documents
d?????????? ? ? ? ? ? Download
-?????????? ? ? ? ? ? IMG_20221005_142837.jpg
d?????????? ? ? ? ? ? loop
d?????????? ? ? ? ? ? loop-copy
d?????????? ? ? ? ? ? Movies
d?????????? ? ? ? ? ? Music
d?????????? ? ? ? ? ? Notifications
d?????????? ? ? ? ? ? Photos
d?????????? ? ? ? ? ? Pictures
-?????????? ? ? ? ? ? Win10_21H2_EnglishInternational_x64.iso
On trying chmod u-w
[wizard@fedora 9707-588E]$ chmod u-w loop
chmod: cannot access 'loop': No such file or directory
Where is that pen drive mounted?
Normally on fedora it gets mounted at /run/media/USER/DEVICE, but may be mounted with the wrong ownership so your user cannot read it or not mounted as expected.
The mount command should show where it is mounted.
The file manager should show it when it is mounted, but if ownership is wrong it cannot be accessed that way.
To see what the ownership might be you may look at permissions with the file manager or from the command line (once you have verified the mount point) the command ls -l /path/to/mount/point should display the permissions. If mounted at the location noted above then ls -l /run/media/USER (where USER is your user name) should show the ownership.
Ok
What is the output of ls -ld /run/media/wizard /run/media/wizard/9707-588E /run/media/wizard/9707-588E/* ?
That will provide all the permissions for the content. lsblk -f will show the file system type and mount points, with UUID as well
From the name of that mount point I would guess this is either vfat or ntfs formatted and as such it will not have the normal linux file system permissions.
This means that the mount must be done differently than an auto mount so that during mounting ownership and file system permissions are properly configured to allow your user to access the files.
The mount may need to have UID, GID, and umask options set within the mount command to allow a user access to those files in a vfat or ntfs file system.
Within my /etc/fstab file I have this UUID=9CF6-618E /boot/efi vfat umask=0077,shortname=winnt,noatime 0 2 for the efi partition and that one is owned exclusively by root. When it is to be owned by a different user the UID and GID options must also be added to set ownership.
As I mentioned in the post, it is exfat formatted.
Result of ls -ld /run/media/wizard /run/media/wizard/9707-588E
[wizard@fedora ~]$ ls -ld /run/media/wizard /run/media/wizard/9707-588E
drwxr-x---+ 3 root root 60 Aug 30 15:12 /run/media/wizard
drwxr-xr-x. 37 wizard wizard 131072 Aug 30 15:12 /run/media/wizard/9707-588E
Result of ls -ld /run/media/wizard /run/media/wizard/9707-588E /run/media/wizard/9707-588E/*
[wizard@fedora ~]$ ls -ld /run/media/wizard /run/media/wizard/9707-588E /run/media/wizard/9707-588E/*
ls: cannot access '/run/media/wizard/9707-588E/Alarms': No such file or directory
ls: cannot access '/run/media/wizard/9707-588E/apps': No such file or directory
ls: cannot access '/run/media/wizard/9707-588E/Audiobooks': No such file or directory
ls: cannot access '/run/media/wizard/9707-588E/Bank Details.pdf': No such file or directory
ls: cannot access '/run/media/wizard/9707-588E/class': No such file or directory
ls: cannot access '/run/media/wizard/9707-588E/class-copy': No such file or directory
ls: cannot access '/run/media/wizard/9707-588E/config': No such file or directory
ls: cannot access '/run/media/wizard/9707-588E/docs': No such file or directory
ls: cannot access '/run/media/wizard/9707-588E/Documents': No such file or directory
ls: cannot access '/run/media/wizard/9707-588E/Download': No such file or directory
ls: cannot access '/run/media/wizard/9707-588E/IMG_20221005_142837.jpg': No such file or directory
ls: cannot access '/run/media/wizard/9707-588E/loop': No such file or directory
ls: cannot access '/run/media/wizard/9707-588E/loop-copy': No such file or directory
ls: cannot access '/run/media/wizard/9707-588E/Movies': No such file or directory
ls: cannot access '/run/media/wizard/9707-588E/Music': No such file or directory
ls: cannot access '/run/media/wizard/9707-588E/Notifications': No such file or directory
ls: cannot access '/run/media/wizard/9707-588E/Photos': No such file or directory
ls: cannot access '/run/media/wizard/9707-588E/Pictures': No such file or directory
ls: cannot access '/run/media/wizard/9707-588E/Win10_21H2_EnglishInternational_x64.iso': No such file or directorylsblk -f
drwxr-x---+ 3 root root 60 Aug 30 15:12 /run/media/wizard
drwxr-xr-x. 37 wizard wizard 131072 Aug 30 15:12 /run/media/wizard/9707-588E
[wizard@fedora ~]$ sudo fsck /dev/sda1
fsck from util-linux 2.38.1
exfatprogs version : 1.2.1
ERROR: /: the name hash of a file is wrong at 0x7c0060. Fix (y/N)? n
ERROR: /: the name hash of a file is wrong at 0x7c0120. Fix (y/N)? n
ERROR: /: the name hash of a file is wrong at 0x7c0180. Fix (y/N)? n
ERROR: /: the name hash of a file is wrong at 0x7c01e0. Fix (y/N)? n
ERROR: /: the name hash of a file is wrong at 0x7c0240. Fix (y/N)? n
ERROR: /: the name hash of a file is wrong at 0x7c02a0. Fix (y/N)? n
ERROR: /: the name hash of a file is wrong at 0x7c0300. Fix (y/N)? n
ERROR: /: the name hash of a file is wrong at 0x7c03c0. Fix (y/N)? n
ERROR: /: the name hash of a file is wrong at 0x7c0480. Fix (y/N)? n
ERROR: /: the name hash of a file is wrong at 0x7c04e0. Fix (y/N)? n
ERROR: /: the name hash of a file is wrong at 0x7c0540. Fix (y/N)? n
ERROR: /: the name hash of a file is wrong at 0x7c05a0. Fix (y/N)? n
ERROR: /: the name hash of a file is wrong at 0x7c0660. Fix (y/N)? n
ERROR: /: the name hash of a file is wrong at 0x7c06c0. Fix (y/N)? n
ERROR: /: the name hash of a file is wrong at 0x7c0720. Fix (y/N)? n
ERROR: /: the name hash of a file is wrong at 0x7c0780. Fix (y/N)? n
ERROR: /: the name hash of a file is wrong at 0x7c07e0. Fix (y/N)? n
ERROR: /: the name hash of a file is wrong at 0x7c0840. Fix (y/N)? n
ERROR: /: the name hash of a file is wrong at 0x7c08a0. Fix (y/N)? n
ERROR: /: the name hash of a file is wrong at 0x7c0900. Fix (y/N)? n
ERROR: /: the name hash of a file is wrong at 0x7c0960. Fix (y/N)? n
ERROR: /: the name hash of a file is wrong at 0x7c09c0. Fix (y/N)? n
ERROR: /: the name hash of a file is wrong at 0x7c0a20. Fix (y/N)? n
ERROR: /: the name hash of a file is wrong at 0x7c0a80. Fix (y/N)? n
ERROR: /: the name hash of a file is wrong at 0x7c0b40. Fix (y/N)? n
ERROR: /: the name hash of a file is wrong at 0x7c0ba0. Fix (y/N)? n
ERROR: /: the name hash of a file is wrong at 0x7c0c60. Fix (y/N)? n
ERROR: /: the name hash of a file is wrong at 0x7c0cc0. Fix (y/N)? n
ERROR: /: the name hash of a file is wrong at 0x7c0d40. Fix (y/N)? n
ERROR: /: the name hash of a file is wrong at 0x7c0da0. Fix (y/N)? n
ERROR: /: the name hash of a file is wrong at 0x7c0e00. Fix (y/N)? n
ERROR: /: the name hash of a file is wrong at 0x7c0e60. Fix (y/N)? n
ERROR: /: the name hash of a file is wrong at 0x7c0ee0. Fix (y/N)? n
ERROR: /: the name hash of a file is wrong at 0x7c0f60. Fix (y/N)? n
ERROR: /: the name hash of a file is wrong at 0x7c0fc0. Fix (y/N)? n
ERROR: /: the name hash of a file is wrong at 0x7c1020. Fix (y/N)? n
ERROR: /: the name hash of a file is wrong at 0x7c10a0. Fix (y/N)? n
ERROR: /: the name hash of a file is wrong at 0x7c1120. Fix (y/N)? n
ERROR: /: the name hash of a file is wrong at 0x7c1180. Fix (y/N)? n
ERROR: /: the name hash of a file is wrong at 0x7c11e0. Fix (y/N)? n
ERROR: /: the name hash of a file is wrong at 0x7c1280. Fix (y/N)? n
ERROR: /: the name hash of a file is wrong at 0x7c1320. Fix (y/N)? n
ERROR: /: the name hash of a file is wrong at 0x7c13a0. Fix (y/N)? n
ERROR: /: the name hash of a file is wrong at 0x7c1480. Fix (y/N)? n
ERROR: /: the name hash of a file is wrong at 0x7c14e0. Fix (y/N)? n
ERROR: /: the name hash of a file is wrong at 0x7c1540. Fix (y/N)? n
ERROR: /: the name hash of a file is wrong at 0x7c15a0. Fix (y/N)? n
ERROR: /: the name hash of a file is wrong at 0x7c1600. Fix (y/N)? n
ERROR: /: the name hash of a file is wrong at 0x7c16a0. Fix (y/N)? n
ERROR: /: the name hash of a file is wrong at 0x7c18e0. Fix (y/N)? n
/dev/sda1: corrupted. directories 6, files 2
/dev/sda1: files corrupted 228, files fixed 0
I tried using the drive on multiple devices and it works fine so i don’t think the files are corrupted.
Do you think reformatting it to some other format would fix it. I have read that ext4 is better compatible with linux. Still weird because the drive does work on other distoros.
That is definitely wierd. I will let someone with a little more experience with file system issues look at this.
I have not worked with exfat, and since it is newer and claimed to be better than fat32 with support of much larger drives and files it seems way overkill for use on a pen drive. I suppose it could be that fedora may not yet support an exfat file system.
My instinct would be that the drive should be reformatted to fat32 and see if that makes a difference. As far as I can see the filesystem type may be the only issue as the drive itself does not appear to have a hardware issue.
If this turns out to be that fedora does not properly support an exfat file system I would suggest that you make it known by filing a bug report at bugzilla.redhat.com.