15
submitted 1 week ago* (last edited 1 week ago) by [email protected] to c/[email protected]

I switched to Pop!_OS earlier this year from Manjaro KDE. One feature that KDE had is that you could write a comment on any file by clicking Properties and going to the metadata. I assumed that this wrote the comment into the metadata of every file and that this would translate over to other distributions, but it doesn't appear to be the case.

I found this old thread from 2012 which said that KDE stores it's comments in ~/.kde/share/apps/nepomuk/. If that's still true today, I'm really worried now that all of that comment data I spent hours writing has been deleted along with Manjaro, because I had no idea that the data wasn't store inside the file itself, since it was always listed with the rest of the metadata for every file in it's properties. Is there no hope of me getting these comments back, or is there some way?

Update: Despite what that old thread seemed to imply, it turns out the comments do in fact get stored in metadata. After getting help in the comments, I found the easiest solution was to simply install Dolphin (KDE's file manager) into Pop!_OS, which allowed me to view the comments just as they were when I used KDE. For future readers, some other options that I didn't try that probably also work are:

  • Load a Linux distro using KDE into a virtual machine on top of Pop!_OS and view comments that way
  • Flash a distro like KDE Neon onto a live USB and view the comments that way
  • Use the command getfattr FILENAME -n user.xdg.comment to view the comment data within the Pop! terminal (I didn't get this working, but this was suggested to me)
top 12 comments
sorted by: hot top controversial new old
[-] [email protected] 8 points 1 week ago* (last edited 1 week ago)

Those comments are not lost, the nepomuk (later baloo) is only a indexing service that scrape the file metadata for search purposes.

The attributes are actually stored inside the files in file metadata supported by filesystem. So If those original files still reside in their original filesystem (they ware not like moved to different filesystem that doesn't support those attributes or like compressed (into zip that probably would not retain those metadata)) you can read it.

I did some local digging into it and after searching whole drive while not finding the content of the comment, after searching some filesystem docs, found a explanation at https://en.wikipedia.org/wiki/Extended_file_attributes


You can read them using:

getfattr FILENAME -n user.xdg.comment
getfattr FILENAME -n user.xdg.tags

like getfattr test.txt -n user.xdg.comment

[-] [email protected] 3 points 1 week ago* (last edited 1 week ago)

It sounds like you move those files directly from Linux FS to Linux FS, so they should be preserved (might not be if copied).

But I think if those comments are important, you should still have them stored in some markdown file next to them to avoid losing them if you move them accidentally to a Filesystem that doesn't support Extended file attributes or the "tool" that you are going to use instead of attributes goes away.

[-] [email protected] 1 points 1 week ago

Yeah, I did have that problem in the past with the comment data being demolished if I transferred the files with said comments onto my NTFS formatted external hard drive, though strangely, I'm still able to manually write a new comment on those files after the transfer.

In other words, what I find is that transferring a file with a comment from one ext4 drive to another ext4 drive retains the comment data, but transferring it from one ext4 drive to an NTFS drive deletes it, though it still allows me to rewrite a replacement comment regardless.

I've solved my issue by installing Dolphin, which allows me to see the comments now, and updated my post.

[-] [email protected] 1 points 1 week ago* (last edited 1 week ago)

Thanks, I'll try to do this tomorrow. Do you think that loading Manjaro KDE or any other distro using KDE into a VM, and connecting my drive with the files to the VM would allow me to view the comments just as I previously could using KDE?

[-] [email protected] 3 points 1 week ago* (last edited 1 week ago)

If you conmect and mount the whole drive (or at last whole partition) directly to the VM then yes. Before doing all that work, personaly I would just use the command to manually confirm the metadata is thereo on files you know that has comments. Or even simpler - boot a KDE neon (or any other KDE live disto) live from USB, and connect the drive.

But ... Why not just install Dolphin file manager in your current distro? It should be as easy as installing any other package/app. You can have more than one file manager installed at a time.

[-] [email protected] 2 points 1 week ago

Thanks so much for all the suggestions. I couldn't figure out how to use the command because it was giving me errors (which is probably just something I did wrong). But I'll try to figure that out for the sake of learning.

What did work for me, was downloading Dolphin (it looks so messes up in Cosmic though, lol) and the comments are absolutely there, thank God! So now I can recover them and I think I'm going to try to find an alternative solution for making these records that works easily across distros (because I don't plan to stick with Pop! forever)

[-] [email protected] 1 points 1 week ago

What kind of error?

[-] [email protected] 4 points 1 week ago

If that comment is true and you don't have the database anymore then there's no hope.

If you were writing comments to understand which file is which then consider a directory scheme for sorting your files and add readme.md files in a narrow category of files to describe them. I do something like: All coding projects go into home/code, each project has a readme. Etc.

If you were just logging for history purposes ie good memories in photos I'd suggest just making a markdown gallery. Or something similar.

[-] [email protected] 1 points 1 week ago

Yes, I was mainly using it for photos and videos. I wrote a lot of text in old photos from when I was a very young child or baby in order to record as many memories I still have in relation to them as possible, so these comments mean a lot.

[-] [email protected] 2 points 1 week ago* (last edited 1 week ago)

Unfortunately I'm afraid they're lost (I think). UPD: see kolorafa's comment

There's some alternatives if you're willing to continue with that:

Aves Gallery on android (is on fdroid) can embed comments into image long term metadata. But I have not tested it after transfer.

Creating a directory Gallery with markdown files and a subdir for all images and then writing comments inside those markdown files with a link to the local image. Very simple to do with Obsidian or similar markdown-powered software.

Out of the top of my head I can think of two structures for that:

  1. /Year/month/day/ dirs, hoursminutesecond.png and hourminutesecond.txt with the comment per photo.

  2. /Gallery/images/datetime.png and /Gallery/yearmonth_gallery.md with comments and links to multiple images for that month.

And probably more that I'm not aware of myself.

[-] [email protected] 3 points 1 week ago

Only lost if the files got moved to another filesystem as it turned out they are actually stored inside file metadata.

[-] [email protected] 2 points 1 week ago

Great, then they might be recoverable.

this post was submitted on 05 Jul 2024
15 points (89.5% liked)

Pop!_OS (Linux)

4910 readers
2 users here now

Pop!_OS is an operating system developed by System76 for STEM and creative professionals who use their computer as a tool to discover and create. Unleash your potential on secure, reliable open source software. Based on your exceptional curiosity, we sense you have a lot of it.

Unleash your potential

Whether this is your first experience with Linux, or your latest adventure, all are welcome to discuss and ask questions about Pop!_OS and COSMIC. Keep the discussions friendly though, and remember to assume good intentions whenever you reply. We're all here because we have a shared love for Linux and open source software.

System76 Logo

Support us by buying System76 hardware for you or your company! Or by donating on the Pop!_OS website through the "Support Pop" button. Pop!_OS and COSMIC are fully funded by System76 hardware sales. All systems are assembled in the USA. With your support, we'll work to push the Linux desktop forward with COSMIC.

Links

Guides

Hardware

Recommended

Community Rules

Follow the Code of Conduct

All posts on pop_os must adhere to the Pop!_OS community Code of Conduct. https://github.com/pop-os/code-of-conduct

Be helpful

Posts to pop_os must be helpful. When responding to a user asking for help, do not provide tongue-in-cheek responses like "RTM" or links to LMGTFY. Linking to direct sources that answer the asker's question is fine, but it's advised to provide some explanation as to how you got to that source.

Critique should be constructive

We within the Pop!_OS community welcome helpful criticism or ideas on ways to improve. However, basic "It's bad" or other simple negative comments don't help anyone fix anything. When voicing a complaint about something, try to point out ways the complaint could be improved or worked around, so that we can make a better product for it.

This rule applies to both Pop!_OS and its projects as well as other products available from third-parties.

Don't post malicious "advice"

It can be funny to joke about malicious commands, however this is not the venue for it. Do not advise users to run commands which will lock up their systems, steal their data, or erase their drive. Examples of this include (but are not limited to) fork bombs, rm, etc.

Posts violating this rule will be removed, even if the post is clearly in jest. Repeated offences may lead to a ban. You may understand that the command isn't serious, but a new user might not.

No personal attacks

Posts making a personal attack on any user will not be tolerated.

No hate speech

Hate speech of any kind will not be tolerated. Any violations will be removed, and are grounds for a ban.

founded 1 year ago
MODERATORS