Actual files are turning into broken links

Please post suggestions for improvement of Cinnamon on:
https://github.com/linuxmint/Cinnamon
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
mstrauss2023
Level 1
Level 1
Posts: 41
Joined: Fri Feb 17, 2023 11:07 pm

Actual files are turning into broken links

Post by mstrauss2023 »

I'm using Linux Mint 21 and have noticed a serious problem.
When I moved to Linux I moved all my files onto my hard drive (ext4).
I have started noticing that what should be actual files are now called broken links.
Today I went to copy some mp3 files to my cell in preparation for a flight. I know these were actual files when I moved them here but now 90% of the files say broken link.
I searched my entire hard drive hoping to find a copy but there were none.
I am deeply upset because these mp3 files cost me $500 and I have had them for many years and now they're gone.
I am surprised that I cannot find any post from anyone with this same issue. I never had this problem with windows.

Can anyone please tell me how I can get my actual files back?
These are Japanese language files and I intended to go through them during my 14 hour flight to Japan next week.

Here are my details:
Linux Mint 21.2 Cinnamon 64 bit
ver 5.8.4
Kernel 5.15.0-78-generic
PRocessor: intel core I7-4800MQ CPU @ 2.7GHz x 4
RAM: 31.2GB
HD: 1500.3GB
Last edited by LockBot on Mon Feb 12, 2024 11:00 pm, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
gittiest personITW
Level 12
Level 12
Posts: 4277
Joined: Tue May 28, 2019 4:27 pm

Re: Actual files are turning into broken links

Post by gittiest personITW »

Welcome to the forums.

It sounds like you copied the links over to that drive, rather than the files but you are sure that they were actual files that you copied over.

What are the sizes of these files?
Give us an example of the extension that it has now.
Rename one of the ones that don't work to 123.mp3. Does it work?

Try going into Nemo, right-click an empty space and select 'open as root'.
Type in your password.
A red Nemo window will open. BE VERY CAREFUL as ANYTHING you do in here will be done without question.
See if something opens that didn't open before.
Right-click - see what properties say - did it 'link' to the original location before the files were copied over.
Close that window.

If you can open something then it is a permissions issue.
Post back for more info.

As always - anything that is valuable should be backed up anyway.
mstrauss2023
Level 1
Level 1
Posts: 41
Joined: Fri Feb 17, 2023 11:07 pm

Re: Actual files are turning into broken links

Post by mstrauss2023 »

I've been a network engineer and IT manager for over 30 years (Windows expert) so I think I know how to properly move and copy files.
When they were moved all the files varied in length but all over 10 MB
The ones marked as link broken are 90 bytes, 97 bytes or 98 bytes.
They all have an .mp3 extension

I renamed the file Unit 2.mp3 to 123.mp3 but it didnt work. As with all broken link files when you try to open it I get the error "The Link '123.mp3' is broken. Move it to trash?
It's interesting that it also says "This link cannot be used, because its target "/home/mike/main/Documents/How To.../Learn Japanese/123.mp3" doesn't exist.
It's funny because I launched it from that folder. How can a file link to itself?

I was thinking last night. I had an issue where nemo would crash whenever I did a full search of the drive for files with specific contents. This was when I had the default folder structure that comes with Linux Mint.
I found a work around by altering the variables in /home/mike/.config/user-dirs.dirs
I changed them from the default values to these:
XDG_DESKTOP_DIR="$HOME/main/Desktop"
XDG_DOWNLOAD_DIR="$HOME/main/Downloads"
XDG_TEMPLATES_DIR="$HOME/"
XDG_PUBLICSHARE_DIR="$HOME/Public"
XDG_DOCUMENTS_DIR="$HOME/main/Documents"
XDG_MUSIC_DIR="$HOME/main/Music"
XDG_PICTURES_DIR="$HOME/main/Pictures"
XDG_VIDEOS_DIR="$HOME/main/Videos"

That seemed to solve the search issue. I reported it as a bug and support told me that they plan on fixing it.

The main thing here is that when I changed these values, the folder structure changed almost instantly. Even the panel shortcuts pointed properly to the new locations.
I know I didn't start seeing any broken link detailed type before doing this.
Do you think that making this change has somehow destroyed some of my files even though 99.9% of all my hundreds of files are fine?

Thanks
gittiest personITW
Level 12
Level 12
Posts: 4277
Joined: Tue May 28, 2019 4:27 pm

Re: Actual files are turning into broken links

Post by gittiest personITW »

So - just to check and I'm sure you've checked this, but now, there is no folder:
/home/mike/Documents/How To.../Learn Japanese/

Only a few of your files have gone walkabouts?
Is that the same with your ~/Pictures and ~/Videos folders?
mstrauss2023
Level 1
Level 1
Posts: 41
Joined: Fri Feb 17, 2023 11:07 pm

Re: Actual files are turning into broken links

Post by mstrauss2023 »

/home/mike/Documents/How To.../Learn Japanese/ was automatically moved to /home/mike/Main/Documents/How To.../Learn Japanese/ when I altered user-dirs.dirs

and currently there is no /home/mike/Documents/How To.../Learn Japanese/ folder

/home/mike/main/Pictures - there are some pictures that have turned into broken links

/home/mike/main/Videos - there are no broken link files, not even in sub folders

I just did a search for a files under /home/mike/Documents and all subfolders.
They total 7,962 files 21.6GB
Out of those, 101 files turned into broken links
98.7% of those files are fine.
So I'm looking at a 1.3% loss in files
gittiest personITW
Level 12
Level 12
Posts: 4277
Joined: Tue May 28, 2019 4:27 pm

Re: Actual files are turning into broken links

Post by gittiest personITW »

Look in Rubbish bin - if you are lucky.

Also if the files mean a lot - try Testdisk to see if you can recover them. It is in Software Manager.
If you have an ssd you might be luckier than if you are using a spinny as long as the Trim command hasn't been used. (By default I think it is run once a week).
mstrauss2023
Level 1
Level 1
Posts: 41
Joined: Fri Feb 17, 2023 11:07 pm

Re: Actual files are turning into broken links

Post by mstrauss2023 »

Yea trash is empty

I'm way ahead of you. I just finished with testdisk and found a lot of mp3 files. I dont know if it recovered some that still existed or not.

Something weird,
when going through the recovere files, I found Unit 7 (which was missing) and of course the recovered file had a different name.
I copied it back to the language folder and tried renaming it to Unit 7.mp3 and got the strangest error which makes no sense

The item could not be renamed
The name "Unit 7.mp3" is already used in this folder. Please use a different name"
Looking in nemo file manager in that folder, this file is not listed. WTH?

If I open the folder in a terminal the ls command shows me all the files including Unit 7.mp3 but that is highlighted blue

Any ideas?
gittiest personITW
Level 12
Level 12
Posts: 4277
Joined: Tue May 28, 2019 4:27 pm

Re: Actual files are turning into broken links

Post by gittiest personITW »

Have you got an SSD or a spinny HDD?
Also try renaming the file something else - for instance unit 7b.mp3

In Terminal, blue usually means a directory or a symbolic link file - I think in this case the latter.
mstrauss2023
Level 1
Level 1
Posts: 41
Joined: Fri Feb 17, 2023 11:07 pm

Re: Actual files are turning into broken links

Post by mstrauss2023 »

I'm using an SSD

I cant rename the file because I already replaced it with the one found in testfile. Good idea though
Coggy
Level 5
Level 5
Posts: 596
Joined: Thu Mar 31, 2022 10:34 am

Re: Actual files are turning into broken links

Post by Coggy »

That sounds to me as though Nemo is confused. At this point I would not trust it. Use terminal commands instead.
I have noticed in the past that Nemo sometimes loses track of what's there, and you need to manu View => Reload to correct what it's showing. I don't know what would happen if you tried to move files when it's in that confused state. Also, drag-and-drop with Ctrl-Shift and leaves the file where it is and drops a link to it instead. It's possible that you accidentally did that, and may not notice until the link target (original file) gets moved or deleted, which would break the link. The little arrow bottom-right of a Nemo icon is easy to overlook.

First check what your home directory is what you think it should be: echo ~
Maybe try find ~ -iname "unit 7.mp3" -ls : this might find more than one. Pay attention to whether they are links (third field is lrwxrwxrwx).
Also just use the cd command to move around and ls -l to list directory contents.
ls -l will tell you what's really there.

And this sounds so odd that I wonder: Your home directory is still on an ext4 filesystem isn't it? You haven't copied it to NTFS? Just a wild thought.
mstrauss2023
Level 1
Level 1
Posts: 41
Joined: Fri Feb 17, 2023 11:07 pm

Re: Actual files are turning into broken links

Post by mstrauss2023 »

Thanks for the advice.

Reload doesnt really correct what is showing that I can see.

"The little arrow bottom-right of a Nemo icon is easy to overlook." I am unable to find this little arrow you refer to. Is it possible you can provide a screen shot of where to look?

Even though I moved everything to /home/mike/main my home directory remains as /home/mike in order to keep the hidden files and folders from moving. Otherwise the search issue would not be resolved.

find ~ -iname "unit 7.mp3" -ls - This is a new command which I find interesting. I played around with it and did find a Unit 7.mp3 (actual file) in the trash. Tried it with Unit 6.mp3 but all I found were links, no actual files. I'll play with it some more throughout the day.

ls -l - I use this one daily.
Coggy
Level 5
Level 5
Posts: 596
Joined: Thu Mar 31, 2022 10:34 am

Re: Actual files are turning into broken links

Post by Coggy »

The "little arrow" is at the bottom right of any icon that's a link instead of a real file or directory. In this screenshot, Documents is a link to a directory somewhere else. You can right-click and Properties will show where it links to :
Screenshot from 2023-08-13 22-09-17.png
Screenshot from 2023-08-13 22-09-17.png (21.45 KiB) Viewed 1060 times
rudantam
Level 1
Level 1
Posts: 9
Joined: Fri May 06, 2011 2:46 pm

Re: Actual files are turning into broken links

Post by rudantam »

You might consider booting Linux from USB and check the mentioned locations again.
b5baxter
Level 1
Level 1
Posts: 1
Joined: Fri Sep 08, 2023 9:49 pm

Re: Actual files are turning into broken links

Post by b5baxter »

I have had several directories spontaneously turning into broken links (and loosing all the files inside). I thought it was a problem with the disk drive so I replaced it with a brand new SDD. But after two days the same thing started happening.
mikeflan
Level 16
Level 16
Posts: 6735
Joined: Sun Apr 26, 2020 9:28 am
Location: Houston, TX

Re: Actual files are turning into broken links

Post by mikeflan »

Wow, what are the odds. We have 2 people right here with this problem, but none of us other users, or presumably the hundreds of thousands of Linux servers across the world ever see this problem after years and decades of use. It sure would be good to solve this problem.

If somebody could provide an ls -la output on that directory of links, we would like to see that.
User avatar
The Muffin Man
Level 5
Level 5
Posts: 716
Joined: Mon Jan 17, 2022 5:31 pm
Location: Drury Lane, NC

Re: Actual files are turning into broken links

Post by The Muffin Man »

The only time I have seen something like this is if I initiate a move and not let it finish. [At least on KDE], I can initiate a move (or copy) to another drive (like a USB or some other external drive) and remove it (the drive) before it finishes. I know you've got a lot of experience on moves, but for me it will trip me up {again on KDE] since the move window can be minimized and be completely missed since it runs threaded, in the background.
"Go ahead. I don't shop here."
Coggy
Level 5
Level 5
Posts: 596
Joined: Thu Mar 31, 2022 10:34 am

Re: Actual files are turning into broken links

Post by Coggy »

This is going nowhere until we start getting reliable information about what's happening. We still have not seen an ls -l for any of the problem files or directories. mstrauss2023 even says there's something weird going on, but still refuses to give ls -l for either the file or the folder that's behaving oddly.

b5baxter says he has directories turning into broken links (different symptom, don't know if they're related) but again no actual information.

Files and directories do not spontaneously turn into links. Maybe you are using Ctrl-Shift-Drag to "move" files. This creates links instead of moving the files, so then deleting the original will leave a broken link. This might be whats going on. Can't be sure though. Nobody has said where the broken links actually link to.

It's frustrating that we can't help, but right now this is just a guessing game.
User avatar
The Muffin Man
Level 5
Level 5
Posts: 716
Joined: Mon Jan 17, 2022 5:31 pm
Location: Drury Lane, NC

Re: Actual files are turning into broken links

Post by The Muffin Man »

agreed.
I suspect, at most, they are truncated files, not broken links.
"Go ahead. I don't shop here."
mstrauss2023
Level 1
Level 1
Posts: 41
Joined: Fri Feb 17, 2023 11:07 pm

Re: Actual files are turning into broken links

Post by mstrauss2023 »

I download statements and move them to their appropriate folders and leave them there. I open each one.
Well today I am going through some previous statements and I found a broken link file.
It was downloaded and moved to this folder in July 2023 and it was fine.
Today it shows as broken link. The other statements in that folder show as FoxItReader Document

Screenshot
Image

mike@rusty:~/main/Documents/Bills/Spectrum$ ls -l
total 6736
-rw-rw-r-- 1 mike mike 2168766 Jun 12 19:34 22.06.22-22.07.25.pdf
-rw-rw-r-- 1 mike mike 4660821 Jun 12 19:33 22.07.26-22.08.25.pdf
-rw-rw-r-- 1 mike mike 57534 Jun 12 19:33 22.09.22-22.10.25.pdf
lrwxrwxrwx 1 mike mike 63 Jul 4 13:59 23.05.26-23.06.25.pdf -> '/home/mike/main/Documents/Bills/Spectrum/Spectrum June 2023.pdf'
mike@rusty:~/main/Documents/Bills/Spectrum$

This used to be a real file.

Any thoughts?
mstrauss2023
Level 1
Level 1
Posts: 41
Joined: Fri Feb 17, 2023 11:07 pm

Re: Actual files are turning into broken links

Post by mstrauss2023 »

When I look at ls -l it looks like it is pointing to itself but with the previous name; before I renamed it to 23.05.26-23.06.25.pdf

That's weird
Locked

Return to “Cinnamon”